RE: [gtk-list] gtk_grab_add()




On 16-Jun-98 gale@daedalus.dra.hmg.gb wrote:
> I want to create a modal window.  And when I say "modal", I mean I
> want
> the user to have to answer the question before going on AND I want
> the
> window to function like a scanf--wait for input before going on.
> 
<snip>
> 
> I've seen references to gtk_grab_add() but I'm not using it right
> (it
> doesn't do anything).  Also, the instructions for using
> gtk_grab_remove() are very vague (what does "after I destroy the
> window"
> mean?)

Well,  use gtk_grab_add on the window, after your call to
gtk_widget_show on that window, i.e.

   gtk_widget_show(GTK_WIDGET(window));
   gtk_grab_add(GTK_WIDGET(window));

Destroying the window will also remove the grab, but you can remove
it explicitly when destorying the window:

  gtk_grab_remove ( GTK_WIDGET(window) );
  gtk_widget_destroy ( GTK_WIDGET(window) );
  
thanks,

tony


---
E-Mail: trog@gtk.org
The best things in life go on sale sooner or later.

Go Bezerk! http://www.gtk.org/~trog



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