_gtkTextTagCBclickEx

Set the callback when the user press a mouse button on a part of text which has a particular tag. This is a "full" callback.

Définit un réflexe de click (bouton appuyé) sur une partion du texte sur lequel un tag a été apposé.

Type :

fun [ObjGtk fun [ObjGtk u0 S S I I I I I I I [S I] I I I] u1 u0 S I] ObjGtk

_textview_ : ObjGtk : any textview object already created.

_reflex_ : fun [ObjGtk u0 S S I I I I I I I [S I] I I I] u1 u0 S I] u1 : callback

_userparam_ : u0 : a parameter at your convenience.

_tagname_ : S : the name of the tag. The tag must be already created. If _tagname_ is equal at nil, then a click will call the callback from anywhere on the _textview_.

_typeevent_ : I : the type of the event to call the callback : SGTK_PRESSED (the user press the mouse button), SGTK_2PRESSED (the user has double-clicked), SGTK_3PRESSED (the user has triple-clicked) or SGTK_RELEASED (the mouse button is released). Another value don't set the callback.

Return : ObjGtk : the same textview or nil if error (tag not created, object unknown, ...).


See also : _gtkTextTagCBclick.

Example :

	fun cbTagForeground (obj, userparam, tagname, text, mbutton, mevent, mx, my, maxes, mmask, mtime, mdevice, mxroot, myroot, pos)=
		_fooS strcat "tag name = " tagname;
		_fooS strcat "user parameter = " userparam;
		_fooS strcat "text = " text;
		_fooS strcat "button number = " itoa mbutton;
		_fooS strcat "mouse event = " itoa mevent;
		_fooS strcatn "x = " :: (itoa mx) :: " y = " :: (itoa my) :: nil;
		_fooS strcat "axes = " itoa maxes;
		_fooS strcat "mask = " itoa mmask;
		_fooS strcat "time = " itoa mtime;
		let mdevice -> [name type] in
		_fooS strcatn "device name = " :: name :: " type = " :: (itoa type) :: nil;
		_fooS strcatn "xroot = " :: (itoa mxroot) :: " yroot = " :: (itoa myroot) :: nil;
		_fooS strcat "position = " itoa pos;
		0;;
	
	fun main ()=
		_showconsole;
		...
		/* create a tag */
		_gtkTextTableTagAddS table "tag_foreground" ["foreground" "brown"] :: nil; 
		/* set the callback, it will call when the user double-click into this part of the text */
		_gtkTextTagCBclickEx object @cbTagForeground "test reflex !" "tag_foreground" SGTK_2PRESSED; 
		...
	

Back