Commit 9dd7f257 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

added new functions gimp_int_combo_box_[prepend|append}.

2004-04-21  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.[ch]: added new functions
	gimp_int_combo_box_[prepend|append}.

	* plug-ins/common/sample_colorize.c: ported to GimpDrawableComboBox.
parent 62dcfaec
2004-04-21 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.[ch]: added new functions
gimp_int_combo_box_[prepend|append}.
* plug-ins/common/sample_colorize.c: ported to GimpDrawableComboBox.
2004-04-21 Michael Natterer <mitch@gimp.org>
* app/actions/qmask-actions.c
......
2004-04-21 Sven Neumann <sven@gimp.org>
* libgimpwidgets/libgimpwidgets-sections.txt
* libgimpwidgets/tmpl/gimpintcombobox.sgml: added new functions
gimp_int_combo_box_[prepend|append}.
2004-04-20 Sven Neumann <sven@gimp.org>
* libgimpwidgets/libgimpwidgets-docs.sgml
......
......@@ -185,6 +185,8 @@ GimpIntComboBox
gimp_int_combo_box_new
gimp_int_combo_box_new_valist
gimp_int_combo_box_new_array
gimp_int_combo_box_prepend
gimp_int_combo_box_append
gimp_int_combo_box_set_active
gimp_int_combo_box_get_active
<SUBSECTION Standard>
......
......@@ -52,6 +52,24 @@ GimpIntComboBox
@Returns:
<!-- ##### FUNCTION gimp_int_combo_box_prepend ##### -->
<para>
</para>
@combo_box:
@Varargs:
<!-- ##### FUNCTION gimp_int_combo_box_append ##### -->
<para>
</para>
@combo_box:
@Varargs:
<!-- ##### FUNCTION gimp_int_combo_box_set_active ##### -->
<para>
......
......@@ -9,13 +9,11 @@ GimpIntStore
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GimpIntStore ##### -->
<para>
......
......@@ -217,6 +217,68 @@ gimp_int_combo_box_new_array (gint n_values,
return combo_box;
}
/**
* gimp_int_combo_box_prepend:
* @combo_box: a #GimpIntComboBox
* @...: pairs of column number and value, terminated with -1
*
* This function provides a convenient way to prepend items to a
* #GimpIntComboBox. It prepends a row to the @combo_box's list store
* and calls gtk_list_store_set() for you.
*
* The column number must be taken from the enum #GimpIntStoreColumns.
**/
void
gimp_int_combo_box_prepend (GimpIntComboBox *combo_box,
...)
{
GtkListStore *store;
GtkTreeIter iter;
va_list args;
g_return_if_fail (GIMP_IS_INT_COMBO_BOX (combo_box));
store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box)));
va_start (args, combo_box);
gtk_list_store_prepend (store, &iter);
gtk_list_store_set_valist (store, &iter, args);
va_end (args);
}
/**
* gimp_int_combo_box_append:
* @combo_box: a #GimpIntComboBox
* @...: pairs of column number and value, terminated with -1
*
* This function provides a convenient way to append items to a
* #GimpIntComboBox. It appends a row to the @combo_box's list store
* and calls gtk_list_store_set() for you.
*
* The column number must be taken from the enum #GimpIntStoreColumns.
**/
void
gimp_int_combo_box_append (GimpIntComboBox *combo_box,
...)
{
GtkListStore *store;
GtkTreeIter iter;
va_list args;
g_return_if_fail (GIMP_IS_INT_COMBO_BOX (combo_box));
store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box)));
va_start (args, combo_box);
gtk_list_store_append (store, &iter);
gtk_list_store_set_valist (store, &iter, args);
va_end (args);
}
/**
* gimp_int_combo_box_set_active:
* @combo_box: a #GimpIntComboBox
......
......@@ -56,9 +56,15 @@ GtkWidget * gimp_int_combo_box_new (const gchar *first_label,
GtkWidget * gimp_int_combo_box_new_valist (const gchar *first_label,
gint first_value,
va_list values);
GtkWidget * gimp_int_combo_box_new_array (gint n_values,
const gchar *labels[]);
void gimp_int_combo_box_prepend (GimpIntComboBox *combo_box,
...);
void gimp_int_combo_box_append (GimpIntComboBox *combo_box,
...);
gboolean gimp_int_combo_box_set_active (GimpIntComboBox *combo_box,
gint value);
gboolean gimp_int_combo_box_get_active (GimpIntComboBox *combo_box,
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment