[9933] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Make an entire window insensitive?

daemon@ATHENA.MIT.EDU (Jeff Garzik)
Fri Nov 6 15:57:57 1998

Date: Fri, 06 Nov 1998 16:04:34 -0500
From: Jeff Garzik <jgarzik@pobox.com>
To: Erik Andersen <andersen@inconnect.com>
CC: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Erik Andersen wrote:
> 
> On Fri, 6 Nov 1998, Jeff Garzik wrote:
> 
> > I'm interested in popping-up a progress dialog while my app does some
> > work.  This dialog appears as the child of another dialog.
> >
> > The parent dialog is not modal, but when the progress dialog appears, I
> > don't want the user to be able to do anything in the parent, until the
> > operation completes and the progress dialog disappears.
> >
> > The best thing I can come up with is keeping track of all the widgets in
> > the dialog and toggling the insensitivity of each.  That seems messy.
> > Is there a single function that will make an entire dialog disabled, or
> > insensitive, or similar?
> >
> > Thanks,
> >
> >       Jeff
> >
> 
> What you want is to call either:
>         Gtk_Main::instance()->grab_add( *this);
>         Gtk_Main::instance()->grab_remove( *this);
> 
> or
>         gtk_grab_add(widget);
>         gtk_grab_remove(widget);
> 
> depending on whether you are using Gtk-- or Gtk+.  Either way, this
> just prevents everything else from receiving events, which is the
> Right Way(tm) to make stuff be modal in Gtk+.

gtk_window_set_modal() would probably work for doing that, too.  The
window I'm hacking on needs to -not- be selectable at all.

Since it is not modal, then user cannot proceed down that particular
logic path.  But they can still pick another menu item, and do something
else while waiting for the first operation to complete.

	Jeff

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post