Button.
Input:
o_par parentBox
ltext caption (button-text)
funcnam callbackfunktion for the press-button-event
data get this (static) data from the callbackfunktion; NULL for none
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
'e' = expand widget; default is fixed size.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
Output:
gBut must exist as long as button is alive.
funcnam prototyp:
int funcnam (MemObj *mo, void **data);
GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress
GUI_DATA_I1=*(int*)data[1] or GUI_DATA_S1=(char*)data[1] user-data
Example with string-data:
GUI_button__ (box0, "TestButton", UI_func1, "b1-clicked", "");
int UI_func1 (MemObj *mo, void **data) {
printf(" button |%s|\n", GUI_DATA_S1);
..
Example with integer-data:
static int icb = UI_FuncUCB1;
GUI_button__ (box0,
"TestButton", UI_func1, (
void*)&icb,
"");
int UI_func1 (MemObj *mo, void **data) {
if(GUI_DATA_EVENT == TYP_EventPress) {
if(GUI_DATA_I1 == UI_FuncUCB1) {
..
Disactivate:
Change text/caption/label: