Package: gtk

Function gtk:native-dialog-run

Lambda List

gtk:native-dialog-run (dialog)

Arguments

dialog -- a gtk:native-dialog widget

Return Value

The integer with the response ID.

Details

Blocks in a recursive main loop until self emits the "response" signal. It then returns the response ID from the "response" signal emission.

Before entering the recursive main loop, the gtk:native-dialog-run function calls the gtk:native-dialog-show function on the dialog for you.

After the gtk:native-dialog-run function returns, then dialog window will be hidden.

Examples

Typical usage of this function might be:
gint result = gtk_native_dialog_run (GTK_NATIVE_DIALOG (dialog));
switch (result)
  {
    case GTK_RESPONSE_ACCEPT:
       do_application_specific_something ();
       break;
    default:
       do_nothing_since_dialog_was_cancelled ();
       break;
  }
g_object_unref (dialog);    


Note that even though the recursive main loop gives the effect of a modal dialog window, it prevents the user from interacting with other windows in the same window group while the dialog is run, callbacks such as timeouts, IO channel watches, DND drops, etc, will be triggered during a gtk:native-dialog-run function call.
 

See also

#2023-6-10