Signals and callbacks
Prev The Glade2script Reference Next


Signals and callbacks

In the glade, for each widget on which you want to associate an action, you will have to add a signal. This signal, to which a callback will be linked, will run a function of the associate script, corresponding to the widget name, with an argument.

Few callbacks do not have any output, they act directly on the interface.

It can be useful to add user data. The widget indicated in this data will run the callback.
FOr example, if we add in user data a widget entry on the signal of a button,signal clicked, callback on_entry, the function of the entry will be run with its content as argument when the button will be pressed. It can be said that the button will act as the entry.
The user data are also necessary for the callbacks that act directly on the interface.


auto_scale
auto_scale_img
clear_entry
clic_droit
double_clic
drag_data_get
drag_data_received
drag_drop
enter_notify_event
expander_cb
get_pointer
gtk_widget_destroy
gtk_widget_destroy_save
key_press
key_release
kill_term_child
leave_notify_event
my_callback
off_active
off_blinking
off_expander
off_sensitive
on_active
on_blinking
on_calendar
on_clicked
on_colorbutton
on_colorsel
on_combo
on_entry
on_expander
on_filechoose
on_font
on_hide
on_linkbutton
on_menu
on_page
on_scale
on_sensitive
on_show
on_spinbutton
on_toggled
on_treeview
page_next
page_prev
press_event
redim_term
release_event
select_bottom
select_down
select_top
select_up
systray_hide
systray_show
toggle_active
toggle_expander
toggle_sensitive
toggle_visible


auto_scale
when the widget size is modified
sh: scale@width height
py: ('scale', width, height)
auto_scale_img
changes the size of a picture according to its container
put the image in a box and connect the signal
signal: size-allocate, user data: image
sh: img_scale="width height"
py: img_scale = (width, height)
clear_entry
delete the text of an entry
clic_droit
when right click
clic_droit
double_clic
the treeview selection
signal: row-activated
sh: double_clic@line@data
py: ((path), [row selected,], 'double_clic')
drag_data_get
The treeview can drag selection
add this to drag-data-get signal
drag_data_received
The treeview can received drag selection
add this to drag-data-received signal
drag_drop
Used for drop in a widget
add this to drag-drop signal
sh: drop@text/row
py: ('drop', text/row)
enter_notify_event
when the cursor enters above a widget
signal: enter-notify-event
enter_notify_event
expander_cb
action on expander
signal: activate
True or False
get_pointer
Curseur location in the widget
sh: pointer@x y
py: ('pointer', x, y)
gtk_widget_destroy
equivalent to EXIT@@, e.g. to be used for closing via the cross
gtk_widget_destroy_save
equivalent to EXIT@@SAVE
key_press
press a key
signal: key_ press_event
sh: press@key
py: (press, key)
key_release
release a key
signal: key_ release_event
sh: release@key
py: release, key
kill_term_child
kills the process launched in terminal
leave_notify_event
when the cursor goes out a widget
signal: leave_notify_event
leave_notify_event
my_callback
can be used for any widget
my_callback
off_active
toggle deactivate
the widget must be indicated in the user data
off_blinking
stops notify icon blinking
only availble with 'systray' name choosed
off_expander
close the expander
the widget must be indicated in the user data
off_sensitive
widget becomes grey
the widget must be indicated in the user data
on_active
toggle activate
the widget must be indicated in the user data
on_blinking
starts notify icon blinking
only availble with 'systray' name choosed
on_calendar
the chosen date
(year, month, day)
on_clicked
can be used for any widget
clicked
on_colorbutton
the chosen colour
signal: color-set
on_colorsel
to be filled in for the colorselectiondialog, colorsel­color_selection
signal: color-changed
couleur (#FFEEFF)
on_combo
the combobox selection
signal: changed
selection
on_entry
the entry text, or click on primary or secondary icon
sh: text or primary@text or secondary@text
py: (arg, text)
arg = '' or 'primary' or 'secondary'
on_expander
expand the expander
the widget must be indicated in the user data
on_filechoose
the filechooser selection
signal: selection-changed
selected file
on_font
the chosen font
pangoFontDescription
on_hide
hide a widget
the widget must be indicated in the user data
on_linkbutton
web link
http://...
on_menu
launch contextmenu
the widget menu must be indicated in the user data
on_page
Displays a page of the notebook
the page must be indicated in the user data
on_scale
when the cursor moves
signal: value-changed
(0 to 100)
on_sensitive
widget stops being grey
the widget must be indicated in the user data
on_show
display a widget
the widget must be indicated in the user data
on_spinbutton
the spinbutton value
value (1.0)
on_toggled
the status of a check/radio/togglebutton
signal: toggled
True or False
on_treeview
the treeview selection
signal: cursor-changed
sh: line@data
py: ((path), [row selected,])
page_next
Displays next page of the notebook
the notebook must be indicated in the user data
page_prev
Displays previous page of the notebook
the notebook must be indicated in the user data
press_event
can be used for any widget
press_event
redim_term
Auto resize VTE terminal
see --terminal-redim option
release_event
can be used for any widget
release_event
select_bottom
push down the selected line in last position
select_down
push down the selected line
select_top
push up the selected line in first position
select_up
push up the selected line
systray_hide
hide the systray
only availble with 'systray' name choosed
systray_show
display the systray
only availble with 'systray' name choosed
toggle_active
toggle between activate/deactivate
the widget must be indicated in the user data
toggle_expander
change the expander state
the widget must be indicated in the user data
toggle_sensitive
toggle between grey/not-grey
the widget must be indicated in the user data
toggle_visible
toggle between show/hide
the widget must be indicated in the user data



Prev The Glade2script Reference Next