GNOME Bugzilla – Bug 533003
Add an abstract window widget with support for menu and toolbars
Last modified: 2010-02-10 19:55:11 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).
Created attachment 110872 [details] UML diagram
Created attachment 110873 [details] [review] GtkMainWindow interface and GtkMainWindowFactory abstract class
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?
> 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.
The name MainWindow is probably misleading maybe something like SimpleWindow, DefaultWindow or something like that would be better.
(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.
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.
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 ***