2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 Andrej Kacian and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __COMBOBOX_H__
21 #define __COMBOBOX_H__
33 #define COMBOBOX_ADD(menu, label, data) \
35 gtk_list_store_append(menu, &iter); \
36 gtk_list_store_set(menu, &iter, \
37 COMBOBOX_TEXT, label, \
38 COMBOBOX_DATA, data, \
39 COMBOBOX_SENS, TRUE, \
43 #define COMBOBOX_ADD_ESCAPED(menu, label, data) \
45 gchar *tmp_esc = g_markup_printf_escaped("%s", label); \
46 gtk_list_store_append(menu, &iter); \
47 gtk_list_store_set(menu, &iter, \
48 COMBOBOX_TEXT, (tmp_esc ? tmp_esc : ""), \
49 COMBOBOX_DATA, data, \
50 COMBOBOX_SENS, TRUE, \
55 GtkWidget
*combobox_text_new(const gboolean with_entry
, const gchar
*text
, ...);
57 void combobox_select_by_data (GtkComboBox
*combobox
,
59 void combobox_select_by_text (GtkComboBox
*combobox
,
62 gint
combobox_get_active_data (GtkComboBox
*combobox
);
64 /* these two functions require a GtkComboBoxText, so let the compiler warn */
65 void combobox_unset_popdown_strings(GtkComboBoxText
*combobox
);
66 void combobox_set_popdown_strings(GtkComboBoxText
*combobox
,
69 gboolean
combobox_set_value_from_arrow_key(GtkComboBox
*combobox
,
71 void combobox_set_sensitive (GtkComboBox
*combobox
,
73 const gboolean sensitive
);
75 #endif /* __COMBOBOX_H__ */