/src/wrappers/gtk/examples/buttons/eiffel_compiler_button.e
Specman e | 31 lines | 25 code | 6 blank | 0 comment | 2 complexity | 98d821e0115a8128a283f648d9cf6346 MD5 | raw file
1class EIFFEL_COMPILER_BUTTON 2inherit 3 GTK_RADIO_BUTTON redefine with_label,with_label_from_widget, on_toggled end 4 G_SIGNALS 5 6creation with_label, with_label_from_widget 7 8feature 9 with_label (a_group: G_SLIST[GTK_RADIO_BUTTON]; a_label: STRING) is 10 do 11 Precursor (a_group, a_label) 12 connect (Current, "toggled", $on_toggled) 13 end 14 15 with_label_from_widget (a_widget: GTK_RADIO_BUTTON; a_label: STRING) is 16 do 17 Precursor (a_widget, a_label) 18 connect (Current, "toggled", $on_toggled) 19 end 20feature -- Callback 21 on_toggled is 22 do 23 print ("Button `") 24 print (label) 25 if is_active then print ("' activated%N") 26 else print ("' deactivated%N") end 27 end 28 29end 30 31