hildon 2.1.24 Reference Manual | ||||
---|---|---|---|---|
HildonNote; 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_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); void hildon_note_set_button_text (HildonNote *note, const gchar *text); void hildon_note_set_button_texts (HildonNote *note, const gchar *text_ok, const gchar *text_cancel); enum HildonNoteType;
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkWindow +----GtkDialog +----HildonNote
"description" gchar* : Read / Write "icon" gchar* : Read / Write "note-type" HildonNoteType : Read / Write / Construct "progressbar" GtkProgressBar* : Read / Write "stock-icon" gchar* : Read / Write
Notes are used to for confirmation (OK/Cancel/etc.) from the user. A simple note contains an information text. Additional features such as progress bars or animation can also be included.
Example 22. HildonNote example
gboolean show_confirmation_note (GtkWindow *parent) { gint retcode; GtkWidget *note; note = hildon_note_new_confirmation (parent, "Confirmation message..."); retcode = gtk_dialog_run (GTK_DIALOG (note)); gtk_widget_destroy (note); if (retcode == GTK_RESPONSE_OK) { g_debug ("User pressed 'OK' button'"); return TRUE; } else { g_debug ("User pressed 'Cancel' button"); return FALSE; } }
GtkWidget* hildon_note_new_confirmation (GtkWindow *parent, const gchar *description);
Create a new confirmation note. Confirmation note has a text (description) that you specify and two buttons.
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 |
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 |
GtkWidget* hildon_note_new_confirmation_with_icon_name (GtkWindow *parent, const gchar *description, const gchar *icon_name);
hildon_note_new_confirmation_with_icon_name
is deprecated and should not be used in newly-written code. Since 2.2.0, icons are not shown in confirmation notes. Icons set
with this function will be ignored. Use hildon_note_new_confirmation()
instead.
Create a new confirmation note. Confirmation note has a text (description) that you specify and two buttons.
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 |
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. |
GtkWidget* hildon_note_new_information (GtkWindow *parent, const gchar *description);
Create a new information note. Information note has a text (description) that you specify and an OK button.
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 |
GtkWidget* hildon_note_new_information_with_icon_name (GtkWindow *parent, const gchar *description, const gchar *icon_name);
hildon_note_new_information_with_icon_name
is deprecated and should not be used in newly-written code. Since 2.2.0, icons are not shown in confirmation notes. Icons set
with this function will be ignored. Use hildon_note_new_information()
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_name : |
icon to be displayed. If NULL, default icon is used. |
Returns : | a GtkWidget pointer of the note |
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". |
void hildon_note_set_button_texts (HildonNote *note, const gchar *text_ok, const gchar *text_cancel);
Sets the button texts to be used by this hildon_note widget.
note : |
a HildonNote |
text_ok : |
the new text of the default OK button |
text_cancel : |
the new text of the default cancel button |
"description"
property"description" gchar* : Read / Write
Description for the note.
Default value: ""
"note-type"
property"note-type" HildonNoteType : Read / Write / Construct
The type of the note dialog.
Default value: HILDON_NOTE_TYPE_CONFIRMATION
"progressbar"
property"progressbar" GtkProgressBar* : Read / Write
Progressbar for the note (if any).