Project

General

Profile

Up

_CBcompRollOverUnClick Scol 5.x or above required

Define the callback to an unclick event.

Prototype :

fun [CompRollOver fun [CompRollOver u0 I I I I] u1 u0] CompRollOver

  • CompRollOver : a rollover container.
  • fun [CompRollOver u0 I I I I] u1 : the callback. Supplementals arguments are : the x mouse position, the y mouse position, the mouse button and the mask (special key pressed).
  • u0 : a user parameter, at your convenience.

Return : CompRollOver the same object or nil if error.

See also :

_CBcompRollOverClick

Example :

fun rollUnclick (compObj, tuple, xclick, yclick, buttonmouse, mask)=
	let tuple -> [abmp cont win] in
	(
	_DScompRollOver compObj;
	_DScontainer cont;
	_DSwindow win;
	_DSalphaBitmap abmp;
	_closemachine
	);;
	
fun rollClick (compObj, cont, xclick, yclick, buttonmouse, mask)=
	// do something
	0;;
	
fun main ()=
	let [500 400] -> [w h] in
	let 0x777777 -> color in
	let _LDalphaBitmap _channel _checkpack "tests/2dscol/rollover/map.png" -> abmp in
	let _CRwindow _channel nil 0 0 w h WN_NORMAL "Test" -> win in
	let _CRcontainerFromObjWin _channel nil 0 0 w h CO_CHILDINSIDE color nil -> cont in
	let _CRcompRollOver _channel cont nil [5 5] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK OBJ_CONTAINER_ALLEVENTS abmp -> roll in
	(
	_CBcompRollOverClick roll @rollClick cont;
	_CBcompRollOverUnClick roll @rollUnclick [abmp cont win];
	0
	);;