ui/gtk/button.c

changeset 144
29d98cff4f56
parent 143
d499b29d7cb6
child 145
853685152c1d
equal deleted inserted replaced
143:d499b29d7cb6 144:29d98cff4f56
82 e.eventdata = NULL; 82 e.eventdata = NULL;
83 e.intval = gtk_toggle_tool_button_get_active(widget); 83 e.intval = gtk_toggle_tool_button_get_active(widget);
84 event->callback(&e, event->userdata); 84 event->callback(&e, event->userdata);
85 } 85 }
86 86
87 int ui_toggle_button_get(UiInteger *integer) { 87 int64_t ui_toggle_button_get(UiInteger *integer) {
88 GtkToggleButton *button = integer->obj; 88 GtkToggleButton *button = integer->obj;
89 integer->value = (int)gtk_toggle_button_get_active(button); 89 integer->value = (int)gtk_toggle_button_get_active(button);
90 return integer->value; 90 return integer->value;
91 } 91 }
92 92
93 void ui_toggle_button_set(UiInteger *integer, int value) { 93 void ui_toggle_button_set(UiInteger *integer, int64_t value) {
94 GtkToggleButton *button = integer->obj; 94 GtkToggleButton *button = integer->obj;
95 integer->value = value; 95 integer->value = value;
96 gtk_toggle_button_set_active(button, value != 0 ? TRUE : FALSE); 96 gtk_toggle_button_set_active(button, value != 0 ? TRUE : FALSE);
97 } 97 }
98 98
224 e.intval = i->get(i); 224 e.intval = i->get(i);
225 225
226 ui_notify_evt(i->observers, &e); 226 ui_notify_evt(i->observers, &e);
227 } 227 }
228 228
229 int ui_radiobutton_get(UiInteger *value) { 229 int64_t ui_radiobutton_get(UiInteger *value) {
230 int selection = 0; 230 int selection = 0;
231 GSList *ls = value->obj; 231 GSList *ls = value->obj;
232 int i = 0; 232 int i = 0;
233 guint len = g_slist_length(ls); 233 guint len = g_slist_length(ls);
234 while(ls) { 234 while(ls) {
242 242
243 value->value = selection; 243 value->value = selection;
244 return selection; 244 return selection;
245 } 245 }
246 246
247 void ui_radiobutton_set(UiInteger *value, int i) { 247 void ui_radiobutton_set(UiInteger *value, int64_t i) {
248 GSList *ls = value->obj; 248 GSList *ls = value->obj;
249 int s = g_slist_length(ls) - 1 - i; 249 int s = g_slist_length(ls) - 1 - i;
250 int j = 0; 250 int j = 0;
251 while(ls) { 251 while(ls) {
252 if(j == s) { 252 if(j == s) {

mercurial