HildonNote

HildonNote — A widget to ask confirmation from the user

Synopsis




enum        HildonNoteType;
GtkWidget*  hildon_note_new_confirmation    (GtkWindow *parent,
                                             const gchar *description);
GtkWidget*  hildon_note_new_confirmation_add_buttons
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             ...);
GtkWidget*  hildon_note_new_confirmation_with_icon_stock
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *stock_id);
GtkWidget*  hildon_note_new_confirmation_with_icon_name
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon_name);
GtkWidget*  hildon_note_new_cancel_with_progress_bar
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             GtkProgressBar *progressbar);
GtkWidget*  hildon_note_new_information     (GtkWindow *parent,
                                             const gchar *description);
GtkWidget*  hildon_note_new_information_with_icon_name
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon_name);
GtkWidget*  hildon_note_new_information_with_icon_stock
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *stock_id);
GtkWidget*  hildon_note_new_information_with_icon_theme
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon);
void        hildon_note_set_button_text     (HildonNote *note,
                                             const gchar *text);
void        hildon_note_set_button_texts    (HildonNote *note,
                                             const gchar *textOk,
                                             const gchar *textCancel);
GType       hildon_note_type_get_type       (void);

Description

Notes are used to for confirmation (OK/Cancel/etc.) from the user. A simple note contains an information text and an OK button to be pressed. Additional features such as progress bars or animation can also be included.


hildon_note_new_confirmation( window, "Confirmation message..." );

i = gtk_dialog_run (GTK_DIALOG (note));
gtk_widget_destroy (GTK_WIDGET (note));

if (i == GTK_RESPONSE_OK)
   gtk_infoprint( window, "User pressed 'OK' button'" );
else
   gtk_infoprint( window, "User pressed 'Cancel' button" );

Details

enum HildonNoteType

typedef enum /*< skip >*/
{
    HILDON_NOTE_CONFIRMATION_TYPE = 0,
    HILDON_NOTE_CONFIRMATION_BUTTON_TYPE,
    HILDON_NOTE_INFORMATION_TYPE,
    HILDON_NOTE_INFORMATION_THEME_TYPE,
    HILDON_NOTE_PROGRESSBAR_TYPE
} HildonNoteType;


hildon_note_new_confirmation ()

GtkWidget*  hildon_note_new_confirmation    (GtkWindow *parent,
                                             const gchar *description);

Create a new confirmation note. Confirmation note has text (description) that you specify, two buttons and a default confirmation stock icon.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
Returns : a GtkWidget pointer of the note

hildon_note_new_confirmation_add_buttons ()

GtkWidget*  hildon_note_new_confirmation_add_buttons
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             ...);

Create a new confirmation note with custom buttons. Confirmation note has a text and any number of buttons. It's important to note that even though the name of the function might suggest, the default ok/cancel buttons are not appended but you have to provide all of the buttons.

FIXME: This doc seems to be wrong, the two buttons aren't added so it would only contain the "additional" buttons? However, changing this would break those applications that rely on current behaviour.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
... : arguments pairs for new buttons(label and return value). Terminate the list with NULL value.
Returns : A GtkWidget pointer of the note

hildon_note_new_confirmation_with_icon_stock ()

GtkWidget*  hildon_note_new_confirmation_with_icon_stock
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *stock_id);

Warning

hildon_note_new_confirmation_with_icon_stock is deprecated and should not be used in newly-written code. this function is broken, and really should not be used by anyone!

Create a new confirmation note. Confirmation note has text (description) that you specify, two buttons and an icon.

Returns:

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
stock_id : icon to be displayed. If NULL, default icon is used.
Returns : a GtkWidget pointer of the note

hildon_note_new_confirmation_with_icon_name ()

GtkWidget*  hildon_note_new_confirmation_with_icon_name
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon_name);

Create a new confirmation note. Confirmation note has text(description) that you specify, two buttons and an icon.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
icon_name : icon to be displayed. If NULL, default icon is used.
Returns : a GtkWidget pointer of the note

hildon_note_new_cancel_with_progress_bar ()

GtkWidget*  hildon_note_new_cancel_with_progress_bar
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             GtkProgressBar *progressbar);

Create a new cancel note with a progress bar. Cancel note has text(description) that you specify, a Cancel button and a progress bar.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the action to cancel
progressbar : a pointer to GtkProgressBar to be filled with the progressbar assigned to this note. Use this to set the fraction of progressbar done. This parameter can be NULL as well, in which case plain text cancel note appears.
Returns : a GtkDialog. Use this to get rid of this note when you no longer need it.

hildon_note_new_information ()

GtkWidget*  hildon_note_new_information     (GtkWindow *parent,
                                             const gchar *description);

Create a new information note. Information note has a text(description) that you specify, an OK button and an icon.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
Returns : a GtkWidget pointer of the note

hildon_note_new_information_with_icon_name ()

GtkWidget*  hildon_note_new_information_with_icon_name
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon_name);

Create a new information note. Information note has text(description) that you specify, an OK button and an icon.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
icon_name : icon to be displayed. If NULL, default icon is used.
Returns : a GtkWidget pointer of the note

hildon_note_new_information_with_icon_stock ()

GtkWidget*  hildon_note_new_information_with_icon_stock
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *stock_id);

Create a new information note. Information note has text(description) that you specify, an OK button and a default stock note icon.

Note! This function is broken and deprecated and should not be used by anybody. Since the platform doesn't use stock icons, use hildon_note_new_information_with_icon_name instead.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
stock_id : icon to be displayed. If NULL, default icon is used.
Returns : a GtkWidget pointer of the note

hildon_note_new_information_with_icon_theme ()

GtkWidget*  hildon_note_new_information_with_icon_theme
                                            (GtkWindow *parent,
                                             const gchar *description,
                                             const gchar *icon);

This function is deprecated. Use hildon_note_new_information_with_icon_name instead.

Create a new information note. Information note has text(description) that you specify, an OK button and an icon.

parent : the parent window. The X window ID of the parent window has to be the same as the X window ID of the application. This is important so that the window manager could handle the windows correctly. In GTK the X window ID can be checked using GDK_WINDOW_XID(GTK_WIDGET(parent)->window).
description : the message to confirm
icon : GtkIconTheme icon to be displayed
Returns : a GtkWidget pointer of the note.

hildon_note_set_button_text ()

void        hildon_note_set_button_text     (HildonNote *note,
                                             const gchar *text);

Sets the button text to be used by the hildon_note widget.

note : a HildonNote
text : sets the button text and if there is two buttons in dialog, the button texts will be <text>, "Cancel".

hildon_note_set_button_texts ()

void        hildon_note_set_button_texts    (HildonNote *note,
                                             const gchar *textOk,
                                             const gchar *textCancel);

Sets the button texts to be used by this hildon_note widget.

note : a HildonNote
textOk : the new text of the default OK button
textCancel : the new text of the default cancel button

hildon_note_type_get_type ()

GType       hildon_note_type_get_type       (void);

Returns : GType