summaryrefslogtreecommitdiff
path: root/gtk/gtktoggletoolbutton.c
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2003-08-04 21:13:55 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2003-08-04 21:13:55 +0000
commit6f6d3a2202194c441dfa4745caa1ab83db38789c (patch)
tree36d5bdadbf11c9b8352e445dea0245ac61458f22 /gtk/gtktoggletoolbutton.c
parent72f11163875fee95067f00e8a719ec8d7a879111 (diff)
downloadgtk+-6f6d3a2202194c441dfa4745caa1ab83db38789c.tar.gz
add new "is_important" property
Fri Aug 1 15:26:46 2003 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtktoolbar.c, gtk/toolitem.c: add new "is_important" property * gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_new_from_widget): Don't take a stock id * gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_new_with_stock_from_widget): make this function take a stock_id. * gtk/toolbar: documentation
Diffstat (limited to 'gtk/gtktoggletoolbutton.c')
-rw-r--r--gtk/gtktoggletoolbutton.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gtk/gtktoggletoolbutton.c b/gtk/gtktoggletoolbutton.c
index 1cdb0238b0..81f7d61032 100644
--- a/gtk/gtktoggletoolbutton.c
+++ b/gtk/gtktoggletoolbutton.c
@@ -94,6 +94,12 @@ gtk_toggle_tool_button_class_init (GtkToggleToolButtonClass *klass)
toolitem_class->create_menu_proxy = gtk_toggle_tool_button_create_menu_proxy;
toolbutton_class->button_type = GTK_TYPE_TOGGLE_BUTTON;
+/**
+ * GtkToggleToolButton::toggled:
+ * @toggle_tool_button: the object that emitted the signal
+ *
+ * Emitted whenever the toggle tool button changes state.
+ **/
toggle_signals[TOGGLED] =
g_signal_new ("toggled",
G_OBJECT_CLASS_TYPE (klass),
@@ -214,6 +220,15 @@ button_toggled (GtkWidget *widget,
}
}
+/**
+ * gtk_toggle_tool_button_new:
+ *
+ * Returns a new #GtkToggleToolButton
+ *
+ * Return value: a newly created #GtkToggleToolButton
+ *
+ * Since: 2.4
+ **/
GtkToolItem *
gtk_toggle_tool_button_new (void)
{
@@ -225,6 +240,20 @@ gtk_toggle_tool_button_new (void)
return GTK_TOOL_ITEM (button);
}
+/**
+ * gtk_toggle_tool_button_new_from_stock:
+ * @stock_id: the name of the stock item
+ *
+ * Creates a new #GtkToggleToolButton containing the image and text from a
+ * stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK
+ * and #GTK_STOCK_APPLY.
+ *
+ * It is an error if @stock_id is not a name of a stock item.
+ *
+ * Return value: A new #GtkToggleToolButton
+ *
+ * Since: 2.4
+ **/
GtkToolItem *
gtk_toggle_tool_button_new_from_stock (const gchar *stock_id)
{
@@ -239,6 +268,17 @@ gtk_toggle_tool_button_new_from_stock (const gchar *stock_id)
return GTK_TOOL_ITEM (button);
}
+/**
+ * gtk_toggle_tool_button_set_active:
+ * @button: a #GtkToggleToolButton
+ * @is_active: whether @button should be active
+ *
+ * Sets the status of the toggle tool button. Set to %TRUE if you
+ * want the GtkToggleButton to be 'pressed in', and %FALSE to raise it.
+ * This action causes the toggled signal to be emitted.
+ *
+ * Since: 2.4
+ **/
void
gtk_toggle_tool_button_set_active (GtkToggleToolButton *button,
gboolean is_active)
@@ -251,6 +291,17 @@ gtk_toggle_tool_button_set_active (GtkToggleToolButton *button,
gtk_button_clicked (GTK_BUTTON (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button))));
}
+/**
+ * gtk_toggle_tool_button_get_active:
+ * @button: a #GtkToggleToolButton
+ *
+ * Queries a #GtkToggleToolButton and returns its current state.
+ * Returns %TRUE if the toggle button is pressed in and %FALSE if it is raised.
+ *
+ * Return value: %TRUE if the toggle tool button is pressed in, %FALSE if not
+ *
+ * Since: 2.4
+ **/
gboolean
gtk_toggle_tool_button_get_active (GtkToggleToolButton *button)
{