Name
GtkButton -- A widget that creates a signal when clicked on.
Description
The GtkButton widget is generally used to attach a function to that
is called when the button is pressed. The various signals and how to use
them are outlined below.
The GtkButton widget can hold any valid child widget. That is it can
hold most any other standard GtkWidget. The most commonly used child is
the GtkLabel.
Details
struct GtkButton
This should not be accessed directly. Use the accessor functions below.
gtk_button_new ()
Creates a new GtkButton widget.
gtk_button_new_with_label ()
GtkWidget* gtk_button_new_with_label (const gchar *label); |
Creates a GtkButton widget with a GtkLabel child containing the given
text.
gtk_button_new_with_mnemonic ()
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label); |
Creates a new GtkButton containing a label.
If characters in label are preceded by an underscore, they are underlined
indicating that they represent a keyboard accelerator called a mnemonic.
Pressing Alt and that key activates the button.
gtk_button_new_from_stock ()
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id); |
Creates a new GtkButton containing the image and text from a stock item.
Some stock ids have preprocessor macros like GTK_STOCK_OK and
GTK_STOCK_APPLY.
gtk_button_set_relief ()
Sets the relief style of the edges of the given GtkButton widget.
Three styles exist, GTK_RELIEF_NORMAL, GTK_RELIEF_HALF, GTK_RELIEF_NONE.
The default style is, as one can guess, GTK_RELIEF_NORMAL.
gtk_button_get_relief ()
Returns the current relief style of the given GtkButton.
Signals
The "activate" signal
void user_function (GtkButton *button,
gpointer user_data); |
The "clicked" signal
void user_function (GtkButton *button,
gpointer user_data); |
Emitted when a button clicked on by the mouse and the cursor stays on the
button. If the cursor is not on the button when the mouse button is released,
the signal is not emitted.
The "enter" signal
void user_function (GtkButton *button,
gpointer user_data); |
Emitted when the mouse cursor enters the region of the button.
The "leave" signal
void user_function (GtkButton *button,
gpointer user_data); |
Emitted when the mouse cursor leaves the region of the button.
The "pressed" signal
void user_function (GtkButton *button,
gpointer user_data); |
Emitted when the button is initially pressed.
The "released" signal
void user_function (GtkButton *button,
gpointer user_data); |
Emitted when a button which is pressed is released, no matter where the
mouse cursor is.