Re: [gtk-list] Re: Blocking Dialog and Button listening to right,left mouse



On 2 Jul 1998, Tero Pulkkinen wrote:

> Christoph "Gröver" <grover@hottemax.uni-muenster.de> writes:
> > I want to be able to popup a dialog which asks the user for 1 out of 3
> > options, but the MainWindow should not be usable at that time and
> > - most importantly - the execution of the program waits for the user to
> > select one of the options. The dialog then returns a number (or something
> > similar) to the calling function and there is a switch statement
> > which selects the appropriate handling code.
> 
> gtk_grab_add()
> /* connect something to gtk_main_quit() */
> gtk_main();
> gtk_grab_remove()
I think he means 'blocking' as in a blocking read() or function of that
sort. ex:
    result = make_dialog();
    switch (result) {
    case 1: /* handle first button... */
    ....
So the dialog will return the button pressed from the function without
having to establish signal handlers.  I'm pretty sure this is not possible
in gtk.  But that doesn't matter much since you can accomplish the same
thing by just connecting all the buttons to a single handler (but passing
different values depending on which button it is), and using
gtk_grab_add/remove.

> > So I want a kind of blocking dialog, which enforces the user to act and
> > which doesn't call signal handlers, but instead just returns the user made
> > selection.
> > 
> > Is this possible with gtk ?
> 
> yup. Of course. Not recommended, but possible.
> 
> > Also I would like to try and make the Normal Button widget listen to
> > the left and middle mouse buttons.
> 
> see button_press_event in GtkWidget.
> 
> -- 
> -- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --

---
Matt Perry [guy@mikepery.linuxos.org]

QOTD:	I looked out my window, and saw Kyle Pettys' car upside down,
	then I thought 'One of us is in real trouble'.
		-- Davey Allison, on a 150 m.p.h. crash
---



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