IupTree Callbacks

IUP - Portable User Interface

IupTree Callbacks

SELECTION_CB: Action generated when an element is selected or deselected. This action occurs when the user clicks with the mouse or uses the keyboard with the appropriate combination of keys.

int function(Ihandle *self, int id, int status) [in C]
elem:selection_cb(id, status: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Node identifier.
status: 1 - node was selected, 0 - node was unselected.

This function must return IUP_IGNORE for the selected node not to be changed, or IUP_DEFAULT to change it.

MULTISELECTION_CB: Action generated when multiple nodes are selected with the mouse and the shift key pressed.

int function(Ihandle *self, int* ids, int n) [in C]
elem:multiselection_cb(ids: table, n: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
ids: Array of node identifiers.
n: Number of nodes in the array.

This function must return IUP_IGNORE for the selected nodes not to be changed, or IUP_DEFAULT to change it.

BRANCHOPEN_CB: Action generated when a branch is expanded. This action occurs when the user clicks the "+" sign on the left of the branch, or when double clicks the branch image, or hits Enter on a collapsed branch.

int function(Ihandle *self, int id) [in C] 
elem:branchopen_cb(id: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Node identifier.

This function must return IUP_IGNORE for the branch not to be opened, or IUP_DEFAULT for the branch to be opened.

BRANCHCLOSE_CB: Action generated when a branch is collapsed. This action occurs when the user clicks the "-" sign on the left of the branch, or when double clicks the branch image, or hits Enter on an expanded branch.

int function(Ihandle *self, int id); [in C]
elem:branchclose_cb(id: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node.

This function must return IUP_IGNORE for the branch not to be closed, or IUP_DEFAULT for the branch to be closed.

EXECUTELEAF_CB: Action generated when a leaf is to be executed. This action occurs when the user double clicks the leaf image, or hits Enter on a leaf.

int function(Ihandle *self, int id); [in C] 
elem:executeleaf_cb(id: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node. 

RENAMENODE_CB: Action generated when a node is to be renamed. It occurs only when the user double clicks the text associated to a node (leaf or branch) or press F2, and SHOWRENAME=NO.

int function(Ihandle *self, int id, char *name); [in C]
elem:renamenode_cb(id: number, name: string) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node.
name: Current name of the clicked node.

SHOWRENAME_CB: Action generated when a node is to be renamed in place and SHOWRENAME=YES. It occurs only when the user double clicks the text associated to a node (leaf or branch) or press F2, and SHOWRENAME=YES.

int function(Ihandle *self, int id); [in C]
elem:showrename_cb(id: number: string) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node. 

RENAME_CB: Action generated after a node was renamed in place. It occurs when the user press Enter after editing the name, or when the text box looses it focus.

int function(Ihandle *self, int id, char *name); [in C]
elem:rename_cb(id: number, name: string) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node.
name: New name of the clicked node.

The new name is accepted only if the callback returns IUP_DEFAULT. If the callback does not exists the new name is always accepted. If the user pressed Enter and the callback returns IUP_IGNORE the editing continues. If the text box looses its focus the editing stops always.

DRAGDROP_CB: Action generated when a drag & drop is executed. Only active if SHOWDRAGDROP=YES.

int function(Ihandle *self, int drag_id, int drop_id, int isshift, int iscontrol); [in C] 
elem:dragdrop_cb(drag_id, drop_id, isshift, iscontrol: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
drag_id: Identifier of the clicked node where the drag start.
drop_id: Identifier of the clicked node where the drop were executed.
isshift: Boolean flag indicatinf the shift key state.
iscontrol: Boolean flag indicatinf the control key state.

RIGHTCLICK_CB: Action generated when the right mouse button is pressed over the IupTree.

int function(Ihandle *self, int id); [in C] 
elem:rightclick_cb(id: number) -> (ret: number) [in Lua]

self: Identifier of the IupTree interacting with the user.
id: Identifier of the clicked node.


The canvas callbacks KEYPRESS_CB, ACTION, SCROLL_CB, MAP_CB, RESIZE_CB and BUTTON_CB can be changed but you should save and call the original definitions or the tree will not correctly work. This can not be done in Lua.

See also IupCanvas.