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



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



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