pan_setbutton(PANEL*, var num, var type, var x, var y, BMAP* bmapOn, BMAP* bmapOff, BMAP* bmapOver, BMAP* bmapOverOff, void* functionClick, void* functionLeave, void* functionOver);

Adds or modifies a push, toggle, or radio button on a panel. LC

Parameters:

PANEL* Panel pointer.
num Number of an existing button (1 = first button of the panel), or 0 for adding a new button to the panel.
type Type of the button, 0 = push, 2 = toggle, 4 = radio.
x, y, ... Parameters similar to the button element, but with the parameter types given above.

Returns:

Number of the button, or 0 if the button could not be found or created.

Example:

BMAP* clicked_pcx = "clicked.pcx";
BMAP* over_pcx = "over.pcx";
BMAP* normal_pcx = "normal.pcx";

PANEL* main_pan = { bmap = "main.pcx"; flags = SHOW; }

function exit_program() { sys_exit(NULL); }

function main()
{
  mouse_mode = 4; // activate mouse
  pan_setbutton(main_pan,0,0, // set a new push button for quitting the game
     150,130,clicked_pcx,normal_pcx,over_pcx,NULL,exit_program,NULL,NULL); 	
}

See also:

PANEL, button, button_state, pan_setslider, pan_setpos

► latest version online