[9932] 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 (Erik Andersen)
Fri Nov 6 15:49:59 1998

Date: Fri, 6 Nov 1998 13:48:23 -0700 (MST)
From: Erik Andersen <andersen@inconnect.com>
To: gtk-list@redhat.com
In-Reply-To: <364337C7.F6992E63@pobox.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

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+.
 
 -Erik

--
Erik B. Andersen   Web:    http://www.inconnect.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--


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


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