_gtkButtonCBpressed
Set a pressed callback.
Définit la callback à appeler lorsque le bouton est pressé.
Type :
fun [ObjGtk fun [ObjGtk u0 I I I I] I u0] ObjGtk
_button_ : ObjGtk : any button already created.
_reflex_ : fun [ObjGtk u0 I I I I] I : the callback, can be nil
- the same _button_;
- the same _user_param_;
- the mouse button (left, right, ...);
- the mask key (the user has pressed a key too) : it can be a combination of any values below :
- 0 : no key pressed;
- SGTK_MASK_SHIFT : SHIFT key;
- SGTK_MASK_LOCK : CapsLock or ShiftLock key;
- SGTK_MASK_CTRL : Control (CTRL) key;
- SGTK_MASK_MOD1 : can be the ALT key;
- SGTK_MASK_MOD2 : depends on the user configuration;
- SGTK_MASK_MOD3 : depends on the user configuration;
- SGTK_MASK_MOD4 : depends on the user configuration;
- SGTK_MASK_MOD5 : depends on the user configuration;
- SGTK_MASK_SUPER : Super key;
- SGTK_MASK_HYPER : Hyper key;
- SGTK_MASK_META : Meta key;
- the x coordonate of the click;
- the y coordonate of the click.
Return an integer
_user_param_ : u0 : any user parameter, at your convenience
Return : ObjGtk : the same button or nil if error.
Example :
typeof button = ObjGtk;;
fun cbButton (objbutton, userparam, mousebutton, keymask, xclick, yclick)=
_fooS strcat "the user paramater is : " userparam;
_fooS strcat "the mouse button is : " itoa mousebutton;
_fooS strcat "the key mask is : " itoa keymask;
_fooS strcatn "the click coordonate is : " :: (itoa xclick) :: " , " :: (itoa yclick) :: nil;
0;;
fun main()=
_showconsole;
set button = _gtkButtonNewLabel _channel "Bouton";
_gtkButtonCBpressed button @cbButton "It's Bouton";
...