Commit 6f6d3a22 authored by Soeren Sandmann's avatar Soeren Sandmann Committed by Søren Sandmann Pedersen

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
parent 72f11163
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
Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init): * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
......
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
Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init): * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
......
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
Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init): * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
......
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
Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init): * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
......
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
Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 4 14:53:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init): * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
......
...@@ -2,21 +2,63 @@ ...@@ -2,21 +2,63 @@
GtkRadioToolButton GtkRadioToolButton
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
A toolbar item that contains a radio button.
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
A #GtkRadioToolButton is a #GtkToolItem that contains a radio button,
that is, a button that is part of a group of toggle buttons where only
one button can be active at a time.
</para>
<para>
Use gtk_radio_tool_button_new() to create a new
#GtkRadioToolButton. use gtk_radio_tool_button_new_from_widget() to
create a new #GtkRadioToolButton that is part of the same group as an
existing #GtkRadioToolButton. Use
gtk_radio_tool_button_new_from_stock() or
gtk_radio_tool_button_new_from_widget_with_stock() to create a new
#GtkRAdioToolButton containing a stock item.
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkToolButton</term>
<listitem><para>
An ancestor class of GtkRadioToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on a
#GtkRadioToolButton.
</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar. It is usually a good idea to put a separator
before and after a group of #GtkRadioToolButtons on a #GtkToolbar.
</para>
</listitem>
</varlistentry>
</variablelist>
</para> </para>
<!-- ##### STRUCT GtkRadioToolButton ##### --> <!-- ##### STRUCT GtkRadioToolButton ##### -->
<para> <para>
The #GtkRadioToolButton contains only private data and should only
be accessed through the functions described below.
</para> </para>
...@@ -45,7 +87,6 @@ GtkRadioToolButton ...@@ -45,7 +87,6 @@ GtkRadioToolButton
</para> </para>
@group: @group:
@stock_id:
@Returns: @Returns:
...@@ -55,6 +96,7 @@ GtkRadioToolButton ...@@ -55,6 +96,7 @@ GtkRadioToolButton
</para> </para>
@group: @group:
@stock_id:
@Returns: @Returns:
......
...@@ -2,21 +2,37 @@ ...@@ -2,21 +2,37 @@
GtkSeparatorToolItem GtkSeparatorToolItem
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
A toolbar item that separates groups of other toolbar items.
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
A #GtkSeparatorItem is a #GtkToolItem that separates groups of other
#GtkToolItems. Depending on the theme, a #GtkSeparatorToolItem will
often look like a vertical line on horizontally docked toolbars.
</para>
<para>
Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem.
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkRadioToolButton</term>
<listitem><para>A toolbar item containing a radio
button</para></listitem>
</varlistentry>
</variablelist>
</para> </para>
<!-- ##### STRUCT GtkSeparatorToolItem ##### --> <!-- ##### STRUCT GtkSeparatorToolItem ##### -->
<para> <para>
The #GtkSeparatorToolItem struct contains only private data and
should only be accessed through the functions described below.
</para> </para>
......
...@@ -58,18 +58,22 @@ void make_toggles (void) { ...@@ -58,18 +58,22 @@ void make_toggles (void) {
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>#GtkButton</term> <term>#GtkButton</term>
<listitem><para>a more general button.</para></listitem> <listitem><para>a more general button.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>#GtkCheckButton</term> <term>#GtkCheckButton</term>
<listitem><para>another way of presenting a toggle option.</para></listitem> <listitem><para>another way of presenting a toggle option.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>#GtkCheckMenuItem</term> <term>#GtkCheckMenuItem</term>
<listitem><para>a #GtkToggleButton as a menu item.</para></listitem> <listitem><para>a #GtkToggleButton as a menu item.</para></listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
......
...@@ -2,21 +2,48 @@ ...@@ -2,21 +2,48 @@
gtktoggletoolbutton gtktoggletoolbutton
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
A #GtkToolItem containing a toggle button.
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
A #GtkToggleToolButton is a #GtkToolItem that contains a toggle
button.
</para>
<para>
Use gtk_toggle_tool_button_new() to create a new
#GtkToggleToolButton. Use gtk_toggle_tool_button_new_from_stock() to
create a new #GtkToggleToolButton containing a stock item.
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para>
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkToggleToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkToggleToolButton<!-- -->s.
</para>
</listitem>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar.
</para>
</listitem>
</varlistentry>
</para> </para>
<!-- ##### STRUCT GtkToggleToolButton ##### --> <!-- ##### STRUCT GtkToggleToolButton ##### -->
<para> <para>
The #GtkToggleToolButton struct contains only private data and
should only be accessed through the functions described below.
</para> </para>
......
...@@ -2,42 +2,41 @@ ...@@ -2,42 +2,41 @@
GtkToolbar GtkToolbar
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
create bars of buttons and other widgets. Create bars of buttons and other widgets.
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
A toolbar is created with a call to gtk_toolbar_new(). A toolbar is created with a call to gtk_toolbar_new().
</para> </para>
<para> <para>
Buttons with text and/or images are added with gtk_toolbar_append_item(), gtk_toolbar_prepend_item(), and gtk_toolbar_insert_item(). A toolbar can contain instances of a subclass of #GtkToolItem. To add
a #GtkToolItem to the a toolbar, use gtk_toolbar_insert(). To remove
an item from the toolbar use gtk_container_remove(). To add a button
to the toolbar, add an instance of #GtkToolButton. Toolbar items can
be visually grouped by adding instances of #GtkSeparatorToolItem to
the toolbar.
</para> </para>
<para> <para>
Any of #GtkToggleButton, #GtkRadioButton, or an arbitrary widget can be added to the toolbar with gtk_toolbar_append_element(), gtk_toolbar_prepend_element(), and gtk_toolbar_insert_element(). Creating a context menu for the toolbar can be done by connecting to
</para> the #GtkToolbar::popup-context-menu signal.
<para>
Widgets can be visibly grouped by adding gaps between widgets using gtk_toolbar_append_space(), gtk_toolbar_prepend_space(), and gtk_toolbar_insert_space().
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>#GtkToolTips</term> <term>#GtkToolItem</term>
<listitem><para>Change the properties of a #GtkToolbar's #GtkTooltips.</para></listitem> <listitem><para>Base class of widgets that can be added to a toolbar.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkTipsQuery</term>
<listitem><para>Make use of the private tips of toolbar elements.</para></listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<!-- ##### STRUCT GtkToolbar ##### --> <!-- ##### STRUCT GtkToolbar ##### -->
<para> <para>
<structfield>num_children</structfield> is an integer specifying how many toolbar items the #GtkToolbar contains. <structfield>children</structfield> is a #GList of the child widgets of the toolbar. The #GtkToolbar struct only contains private data and should only be
</para> accessed through the function described below.
<para>
<structfield>orientation</structfield>
</para> </para>
......
...@@ -2,21 +2,70 @@ ...@@ -2,21 +2,70 @@
GtkToolButton GtkToolButton
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
A #GtkToolItem subclass that displays buttons
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
#GtkToolButton<!-- -->s are #GtkToolItems containing buttons.
</para>
<para>
Use gtk_tool_button_new() to create a new #GtkToolButton. Use
gtk_tool_button_new_with_stock() to create a #GtkToolButton
containing a stock item.
</para>
<para>
The label of a #GtkToolButton is determined by the properties
"label_widget", "label", and "stock_id". If "label_widget" is
non-%NULL, then that widget is used as the label. Otherwise, if
"label" is non-%NULL, that string is used as the label. Otherwise, if
"stock_id" is non-%NULL, the label is determined by the stock
item. Otherwise, the button does not have a label.
</para>
<para>
The icon of a #GtkToolButton is determined by the properties
"icon_widget" and "stock_id". If "icon_widget" is non-%NULL, then
that widget is used as the icon. Otherwise, if "stock_id" is
non-%NULL, the icon is determined by the stock item. Otherwise,
the button does not have a label.
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkToggleToolButton</term>
<listitem><para>A subclass of #GtkToolButton that displays toggle
buttons on the toolbar</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkRadioToolButton</term>
<listitem><para>A subclass of #GtkToolButton that displays radio
buttons on the toolbar</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkSeparatorToolItem</term>
<listitem><para>A subclass of #GtkToolItem that separates groups of
items on a toolbar</para></listitem>
</varlistentry>
</variablelist>
</para> </para>
<!-- ##### STRUCT GtkToolButton ##### --> <!-- ##### STRUCT GtkToolButton ##### -->
<para> <para>
The #GtkToolButton struct contains only private. It should only be
accessed with the function described below.
</para> </para>
...@@ -99,7 +148,7 @@ GtkToolButton ...@@ -99,7 +148,7 @@ GtkToolButton
</para> </para>
@button: @button:
@icon: @icon_widget:
<!-- ##### FUNCTION gtk_tool_button_get_icon_widget ##### --> <!-- ##### FUNCTION gtk_tool_button_get_icon_widget ##### -->
......
...@@ -2,21 +2,50 @@ ...@@ -2,21 +2,50 @@
GtkToolItem GtkToolItem
<!-- ##### SECTION Short_Description ##### --> <!-- ##### SECTION Short_Description ##### -->
#GtkToolItem is the base class of widgets that can be added to
#GtkToolbar.
<!-- ##### SECTION Long_Description ##### --> <!-- ##### SECTION Long_Description ##### -->
<para> <para>
#GtkToolItem<!-- -->s are widgets that can appear on a toolbar. To
create a toolbar item that contain something else than a button, use
gtk_tool_item_new(). Use gtk_container_add() to add a child
widget to the tool item.
</para>
<para>
For toolbar items that contain buttons, see the #GtkToolButton,
#GtkToggleToolButton and #GtkRadioToolButton classes.
</para>
See the #GtkToolbar class for a description of the toolbar widget.
<para>
</para> </para>
<!-- ##### SECTION See_Also ##### --> <!-- ##### SECTION See_Also ##### -->
<para> <para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkToolButton</term>
<listitem><para>A subclass of #GtkToolItem that displays buttons on
the toolbar</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkSeparatorToolItem</term>
<listitem><para>A subclass of #GtkToolItem that separates groups of
items on a toolbar</para></listitem>
</varlistentry>
</para> </para>
<!-- ##### STRUCT GtkToolItem ##### --> <!-- ##### STRUCT GtkToolItem ##### -->
<para> <para>
The GtkToolItem struct contains only private data. It should only be
accessed through the functions described below.
</para> </para>
...@@ -135,7 +164,7 @@ GtkToolItem ...@@ -135,7 +164,7 @@ GtkToolItem
</para> </para>
@toolitem: @toolitem:
@visible_horizontal: @visible_vertical:
<!-- ##### FUNCTION gtk_tool_item_get_visible_vertical ##### --> <!-- ##### FUNCTION gtk_tool_item_get_visible_vertical ##### -->
...@@ -229,6 +258,11 @@ GtkToolItem ...@@ -229,6 +258,11 @@ GtkToolItem
@toolitem: the object which received the signal. @toolitem: the object which received the signal.
<!-- ##### ARG GtkToolItem:is-important ##### -->
<para>
</para>
<!-- ##### ARG GtkToolItem:visible-horizontal ##### --> <!-- ##### ARG GtkToolItem:visible-horizontal ##### -->
<para> <para>
......
...@@ -71,6 +71,16 @@ gtk_radio_tool_button_init (GtkRadioToolButton *button) ...@@ -71,6 +71,16 @@ gtk_radio_tool_button_init (GtkRadioToolButton *button)
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (_gtk_tool_button_get_button (tool_button)), FALSE); gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (_gtk_tool_button_get_button (tool_button)), FALSE);
} }
/**
* gtk_radio_tool_button_new:
* @group: An existing radio button group, or %NULL if you are creating a new group
*
* Creates a new #GtkRadioToolButton, adding it to @group.
*
* Return value: The new #GtkRadioToolButton
*
* Since: 2.4
**/
GtkToolItem * GtkToolItem *
gtk_radio_tool_button_new (GSList *group) gtk_radio_tool_button_new (GSList *group)
{ {
...@@ -84,6 +94,19 @@ gtk_radio_tool_button_new (GSList *group) ...@@ -84,6 +94,19 @@ gtk_radio_tool_button_new (GSList *group)
return GTK_TOOL_ITEM (button); return GTK_TOOL_ITEM (button);
} }
/**
* gtk_radio_tool_button_new_from_stock:
* @group: an existing radio button group, or %NULL if you are creating a new group
* @stock_id: the name of a stock item
*
* Creates a new #GtkRadioToolButton, adding it to @group.
* The new #GtkRadioToolButton will contain an icon and label from the
* stock item indicated by @stock_id.
*
* Return value: The new #GtkRadioToolItem
*
* Since: 2.4
**/
GtkToolItem * GtkToolItem *
gtk_radio_tool_button_new_from_stock (GSList *group, gtk_radio_tool_button_new_from_stock (GSList *group,
const gchar *stock_id) const gchar *stock_id)
...@@ -102,9 +125,18 @@ gtk_radio_tool_button_new_from_stock (GSList *group, ...@@ -102,9 +125,18 @@ gtk_radio_tool_button_new_from_stock (GSList *group,
return GTK_TOOL_ITEM (button); return GTK_TOOL_ITEM (button);
} }
/**
* gtk_radio_tool_button_new_from_widget:
* @group: An existing #GtkRadioToolButton
*
* Creates a new #GtkRadioToolButton adding it to the same group as @gruup
*
* Return value: The new #GtkRadioToolButton
*
* Since: 2.4
**/
GtkToolItem * GtkToolItem *
gtk_radio_tool_button_new_from_widget (GtkWidget *group, gtk_radio_tool_button_new_from_widget (GtkWidget *group)
const gchar *stock_id)
{ {
GSList *list = NULL; GSList *list = NULL;
...@@ -113,11 +145,25 @@ gtk_radio_tool_button_new_from_widget (GtkWidget *group, ...@@ -113,11 +145,25 @@ gtk_radio_tool_button_new_from_widget (GtkWidget *group,
if (group) if (group)
list = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (group)); list = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (group));
return gtk_radio_tool_button_new_from_stock (list, stock_id); return gtk_radio_tool_button_new (list);
} }
/**
* gtk_radio_tool_button_new_with_stock_from_widget:
* @group: An existing #GtkRadioToolButton.
* @stock_id: the name of a stock item
*
* Creates a new #GtkRadioToolButton adding it to the same group as @group.
* The new #GtkRadioToolButton will contain an icon and label from the
* stock item indicated by @stock_id.
*
* Return value: A new #GtkRadioToolButton
*
* Since: 2.4
**/
GtkToolItem * GtkToolItem *
gtk_radio_tool_button_new_with_stock_from_widget (GtkWidget *group) gtk_radio_tool_button_new_with_stock_from_widget (GtkWidget *group,
const gchar *stock_id)
{ {
GSList *list = NULL; GSList *list = NULL;
...@@ -126,7 +172,7 @@ gtk_radio_tool_button_new_with_stock_from_widget (GtkWidget *group) ...@@ -126,7 +172,7 @@ gtk_radio_tool_button_new_with_stock_from_widget (GtkWidget *group)
if (group) if (group)
list = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (group)); list = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (group));
return gtk_radio_tool_button_new (list); return gtk_radio_tool_button_new_from_stock (list, stock_id);
} }
static GtkRadioButton * static GtkRadioButton *
...@@ -135,6 +181,16 @@ get_radio_button (GtkRadioToolButton *button) ...@@ -135,6 +181,16 @@ get_radio_button (GtkRadioToolButton *button)
return GTK_RADIO_BUTTON (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button))); return GTK_RADIO_BUTTON (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button)));
} }
/**