3 * Copyright (C) 2001-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
30 /*==========================================================================*/
31 /* Private macros and constants. */
32 /*==========================================================================*/
35 /*==========================================================================*/
37 /*==========================================================================*/
40 /*==========================================================================*/
42 /*==========================================================================*/
45 /*==========================================================================*/
46 /* Local function prototypes */
47 /*==========================================================================*/
50 /*****************************************************************************/
51 /** Set sensitivity of verb. */
52 /*****************************************************************************/
54 gl_ui_util_set_verb_sensitive (GtkUIManager *ui,
60 gl_debug (DEBUG_UI, "START");
62 g_return_if_fail (cname != NULL);
63 g_return_if_fail (GTK_IS_UI_MANAGER (ui));
65 action = gtk_ui_manager_get_action (ui, cname);
68 gl_debug (DEBUG_UI, "Set action \"%s\" sensitive = %d", cname, sensitive);
69 gtk_action_set_sensitive (action, sensitive);
72 gl_debug (DEBUG_UI, "END");
76 /*****************************************************************************/
77 /** Set sensitivity of a list of verbs. */
78 /*****************************************************************************/
80 gl_ui_util_set_verb_list_sensitive (GtkUIManager *ui,
86 gl_debug (DEBUG_UI, "START");
88 g_return_if_fail (vlist != NULL);
89 g_return_if_fail (GTK_IS_UI_MANAGER (ui));
91 for ( ; *vlist; ++vlist)
93 action = gtk_ui_manager_get_action (ui, *vlist);
96 gtk_action_set_sensitive (action, sensitive);
100 gl_debug (DEBUG_UI, "END");
104 /*****************************************************************************/
105 /** Set state of a verb. */
106 /*****************************************************************************/
108 gl_ui_util_set_verb_state (GtkUIManager *ui,
112 GtkToggleAction *action;
114 gl_debug (DEBUG_UI, "START");
116 g_return_if_fail (cname != NULL);
117 g_return_if_fail (GTK_IS_UI_MANAGER (ui));
119 action = GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui, cname));
122 gtk_toggle_action_set_active (action, state);
125 gl_debug (DEBUG_UI, "END");
131 * Local Variables: -- emacs
133 * c-basic-offset: 8 -- emacs
134 * tab-width: 8 -- emacs
135 * indent-tabs-mode: nil -- emacs