Re: About dialog api



On Sun, 2003-04-27 at 01:35, iain wrote:
> On Sat, 2003-04-26 at 16:40, Havoc Pennington wrote:
> 
> 
> > The issue here is just whether the convenience function about dialog
> > should be global or per-toplevel. I don't actually see the harm in
> > opening two about dialogs if you have two separate toplevels with an
> > About menu item, and having each about dialog transient for its
> > toplevel. What is the problem with that?
> 
> I've always seen having one application opening two about dialogs that
> are the same as being sloppy.
> As far as I remember there was an ancient gnome application development
> doc that said it was a bad thing to do.
> 
> > The reason this is better than a global is that you may want to have
> > multiple kinds of toplevel with different About entries in the same
> > app.
> 
> Surely you can still do that with gtk_about_new?

Sure.

> 
> > A simple solution to the whole controversy though: keep a global about
> > dialog if you pass in NULL for the toplevel to the convenience
> > function - useful anyhow since some apps such as applets may not have
> > toplevels.
> 
> Would be a good idea, but I don't know. having gtk_about_new and
> gtk_about_show which creates its own widget seems confusing to me (even
> now that I'm not quite so tired...). It doesn't even follow the standard
> gtk convention of the first parameter is the widget to work on. Are
> there any other widget functions (besides the gtk_*_new functions) that
> do this?

Maybe the _show() convenience function would be better of as part of the
AppWindow api: gtk_application_show_about (appwindow, ...). Or at least
we could rename it to gtk_show_about_dialog (...), so that not having an
aboutdialog as first parameter doesn't look so wrong.

> 
> Why can't gtk_about_new take all the extra options?
> 
> > Of course, passing in NULL would still be wrong if you *do* have a
> > toplevel, since transient for would not get set.
> 
> But seeing as you can't have one window being transient for multiple
> windows, you're never going to get it right if you do it by hand either.

Well, you can switch transient parents on the fly...

> 
> Is there a technical reason why one window can't be transient for more
> than one toplevel?

ICCCM baggage. But there is a de facto extension which allows to declare
a window transient for its window group.

Matthias





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]