Re: Message boxes



On Mon, 03 Sep 2001 04:41:14 -0700, Deekshit Mantampady said:

Hi,
 
   I want to know how, to display Error message windows, confirmation
 windows(with bottons yes,no) cancel. Please help me in this case
 
 Deekshit M

The way I handle this is to create a separate module which will
create a dialog widget with all the buttons. Basically I code in
the creation and destruction of the dialog with all its callbacks
(for its various buttons).

Then I create a `get_response()' function that whenever you call
it will; map the dialog I created, wait for the user to click on
a button, then return control.

This is handled by having a gtk_main() in get_response(), so that
after the dialog is mapped, gtk_main() is called to ```block'''
execution untill a user clicks on a dialog's button.
When the dialog's button is clicked I call gtk_main_quit() to
break out of the loop, unmap the dialog widget, and return control
to the calling function (with an optional return value).

You should pass to get_response() a reference toplevel window to
set modal and transient for so that the user must make a response
on the dialog and not interact with widgets on other windows.

If you have any question on any of the points above, please ask.


-- 
--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
.__                          ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/






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