Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 4848af60af0367b58e199c096f032e42 > files > 23

libgtk+mdk0.1_6-devel-0.1.6-11mdk.i586.rpm

The GtkMdkDialog widget is derivated from GtkDialog.

Its purpose is to provide unified and easy-to-use dialog boxes.

It basically looks like this:

       +-------------------------------------------+
       |                                           |
       | A Nice        Some descriptive text       |
       |  icon                                     |
       +-------------------------------------------+
       |   [ Button ]  [ Button ]  [ Button ]      |
       +-------------------------------------------+

Description:
------------

  The GtkMdkDialog widget provide ready-to-use and simple dialog window.

  The programmer can choose the icon out of three, and the buttons thats are
in the 'action area'.


Functions:
----------

The GtkMdkDialog widgets are created with this function:
GtkWidget *gtk_mdk_dialog_new(GtkMdkDialogType type,
                              GtkMdkDialogIcon icon,
                              gchar *title,
                              gchar *text);
where 'type' defines which button you want to be present in the dialog.
It must have one of these values:
  GTK_DIALOG_OK, GTK_DIALOG_OK_CANCEL, GTK_DIALOG_YES_NO.
'icon' defines the icon you want to be displayed at the left of the dialog.
It can be one of these:
  STOP_ICON: Guess what?
  ASK_ICON:  a '?' in a circle: (?)
  BANG_ICON: a '!' in a triangle: /!\
  NONE_ICON: no icon at all!
  
'title' is the title of the dialog window and
'text' the text displayed at the right of the dialog.

Other functions can be used with GtkMdkDialog:

- void gtk_mdk_dialog_set_parent(GtkMdkDialog *dialog, GtkWindow *parent);
  This function lets you define a 'parent window' for the dialog.
  A parent window is guarantied to always be below the dialog.

These two functions can help to connect a button to the "clicked" signal.
void gtk_mdk_dialog_button_connect(GtkMdkDialog *dialog,
                                   gint button,
                                   GtkSignalFunc callback,
                                   gpointer data);
void gtk_mdk_dialog_button_connect_object(GtkMdkDialog *dialog,
                                          gint button,
                                          GtkSignalFunc callback,
                                          GtkObject *obj);
The 'button' parameter is the index of the button you want to connect the
signal to, starting with 0.

- gint gtk_mdk_dialog_run(GtkMdkDialog *dialog);
  This function run the dialog, making it modal. The return value is the 
  index of the pressed button, or -1 if no button was pressed.

- gint gtk_mdk_dialog_run_and_close(GtkMdkDialog *dialog);
  This function does the same as the previous one and close the window, even
  if close_on_click is false.

- void gtk_mdk_dialog_set_default(GtkMdkDialog *dialog, gint button);
  This set the default button (the default button can be activated with the
  'Return' key.

- void gtk_mdk_dialog_set_accelerator(GtkMdkDialog * dialog,
                                      gint button,
                                      const guchar accelerator_key,
                                      guint8 accelerator_mods);
  This function can be used to set an accelerator for a button.

- void gtk_mdk_dialog_close(GtkMdkDialog *dialog);
  Closes the dialog (or hides it if just_hide is TRUE)

- void gtk_mdk_dialog_close_hides(GtkMdkDialog *dialog,
                                  gboolean just_hide);
  If 'just_hide' is true, then the dialog will only be hidden when request for
  closure (default is FALSE).

- void gtk_mdk_dialog_close_on_click(GtkMdkDialog * dialog,
                                     gboolean close_on_click);
 If 'close_on_click' then a click on any button will close the dialog.
 Default is TRUE.

Signals:
--------
  
  The GtkMdkDialog widget introduces two new signals:
  - "clicked": This signal is emitted when a button is clicked on.
     Callback's full prototype is:
     void callback(GtkMdkDialog *dialog, gint button_number, gpointer data);
     where 'button_number' is the index of the clicked button.

  - "close": This signal is emitted when the dialog is close (on hidden...).
     Callback's full prototype is:
     void callback(GtkMdkDialog *dialog, gpointer data);

Args:
-----
  
  To be filed.
  
Fields:
-------
 
   No fields should be accessed directly.