After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 533003 - Add an abstract window widget with support for menu and toolbars
Add an abstract window widget with support for menu and toolbars
Status: RESOLVED DUPLICATE of bug 127958
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-05-13 20:19 UTC by Jan Arne Petersen
Modified: 2010-02-10 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
UML diagram (50.98 KB, image/png)
2008-05-13 20:22 UTC, Jan Arne Petersen
  Details
GtkMainWindow interface and GtkMainWindowFactory abstract class (13.19 KB, patch)
2008-05-13 20:23 UTC, Jan Arne Petersen
none Details | Review

Description Jan Arne Petersen 2008-05-13 20:19:15 UTC
Most applications use windows with menus and toolbars. An abstract widget which adds support for a menushell and toolbars would be nice.

This could be used as a sane way to implement a OSX like global menu (see Bug 353076) without hacking GtkMenuBar.

Embedded environments like maemo could use it to handle menus and toolbars in a particular way (see http://maemo.org/api_refs/4.0/hildon/HildonWindow.html).
Comment 1 Jan Arne Petersen 2008-05-13 20:22:49 UTC
Created attachment 110872 [details]
UML diagram
Comment 2 Jan Arne Petersen 2008-05-13 20:23:43 UTC
Created attachment 110873 [details] [review]
GtkMainWindow interface and GtkMainWindowFactory abstract class
Comment 3 Christian Dywan 2008-05-13 20:37:07 UTC
After looking at this for a moment I am not decided how I like this fixed sort of window interface. However *if* I pretend to find this useful for the moment, I wonder:

What if one of my "toolbars" is a GtkStatusbar?

What if one of them is a toolbar widget but not actually a GtkToolbar?

Can/ should a program have multiple main windows?
Comment 4 Jan Arne Petersen 2008-05-13 20:53:24 UTC
> What if one of my "toolbars" is a GtkStatusbar?
Could support for a statusbar with set_statusbar / get_statusbar solve this problem?

> What if one of them is a toolbar widget but not actually a GtkToolbar?
I don't know if an implementation would really need GtkToolbar semantics, so GtkWidget* in add_toolbar would be ok too.

> Can/ should a program have multiple main windows?
Yes.
Comment 5 Jan Arne Petersen 2008-05-13 21:03:32 UTC
The name MainWindow is probably misleading maybe something like SimpleWindow, DefaultWindow or something like that would be better.
Comment 6 Christian Dywan 2008-05-21 19:56:34 UTC
(In reply to comment #4)
> > What if one of my "toolbars" is a GtkStatusbar?
> Could support for a statusbar with set_statusbar / get_statusbar solve this
> problem?
> 
> > What if one of them is a toolbar widget but not actually a GtkToolbar?
> I don't know if an implementation would really need GtkToolbar semantics, so
> GtkWidget* in add_toolbar would be ok too.

From your answers it looks like real examples would be essential to design an interface. Then questions can be posed, to determine what parts of a window actually make sense to incorporate here.
So far you mentioned HildonWindow and OS X, what about other platforms?

Also, since you expressly mentioned the global menubar on OS X, does this interface help in any way when it comes to multiple windows having menubars? As far as I can see it, you would still end up with different menubars if you use multiple main windows which is probably not helpful.
Comment 7 Christian Dywan 2008-10-06 19:03:03 UTC
We do have GtkToolShell at this point, maybe the best idea is to expect that instead of only GtkToolbar widgets.

And I think one accessor for a statusbar should be sufficient, there's hardly a usecase of more than one.

And I think, answering my own question, multiple windows having a menubar each, is totally fine. Hildon does just the same now that I think about it.
Comment 8 Sven Herzberg 2010-02-10 19:55:11 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 127958 ***