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




On Thu, 2 Jul 1998, Some Guy wrote:
> 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... */
>     ....

Look at gnome-dialog.[hc] in gnome-libs/libgnomeui/ on the Gnome CVS
server. Sample use:

dialog = gnome_dialog_new("Title", GNOME_STOCK_BUTTON_CANCEL,
	                  GNOME_STOCK_BUTTON_OK, NULL);
result = gnome_dialog_run(dialog);
switch(result) {
 case -1: /* User deleted the dialog without clicking a button */
 case 0: /* Cancel */
 case 1: /* OK */
}

I'd look at the Gnome function before or instead of rolling your own - it
does a lot of things you might overlook, like handling delete_event, etc. 
(In general, familiarity with Gnome will save you a lot of wheel
reinvention when writing Gtk apps.)

Havoc Pennington ==== http://pobox.com/~hp




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