75 |
FD_pupform *fdui = ob->form->fdui; |
FD_pupform *fdui = ob->form->fdui; |
76 |
char buf[128]; |
char buf[128]; |
77 |
|
|
78 |
sprintf(buf,"item %d (%s) selected", |
sprintf(buf,"item %d (%s) selected", |
79 |
fl_get_menu(ob), fl_get_menu_text(ob)); |
fl_get_menu(ob), fl_get_menu_text(ob)); |
80 |
|
|
81 |
fl_set_object_label(fdui->status, buf); |
fl_set_object_label(fdui->status, buf); |
82 |
} |
} |
83 |
|
|
84 |
/** menu initialization entries. No callbacks for the item */ |
/** menu initialization entries. No callbacks for the item */ |
85 |
FL_PUP_ENTRY menu_entries[] = |
FL_PUP_ENTRY menu_entries[] = |
86 |
{ |
{ |
87 |
{"Menu Item1"}, |
{"Menu Item1"}, |
88 |
{"Menu Item2"}, |
{"Menu Item2"}, |
98 |
{0} |
{0} |
99 |
}; |
}; |
100 |
|
|
101 |
static void |
static void |
102 |
menuitem_entercb(int n, void *data) |
menuitem_entercb(int n, void *data) |
103 |
{ |
{ |
104 |
char buf[128]; |
char buf[128]; |
131 |
|
|
132 |
static int pupID = -1; |
static int pupID = -1; |
133 |
|
|
134 |
static int |
static int |
135 |
pupitem_cb(int selected) |
pupitem_cb(int selected) |
136 |
{ |
{ |
137 |
char buf[128]; |
char buf[128]; |
143 |
return selected; |
return selected; |
144 |
} |
} |
145 |
|
|
146 |
FL_PUP_ENTRY pup_entries[] = |
FL_PUP_ENTRY pup_entries[] = |
147 |
{ |
{ |
148 |
{"Popup Item1", pupitem_cb, "1", FL_PUP_RADIO}, |
{"Popup Item1", pupitem_cb, "1", FL_PUP_RADIO}, |
149 |
{"Popup Item2", pupitem_cb, "2", FL_PUP_RADIO}, |
{"Popup Item2", pupitem_cb, "2", FL_PUP_RADIO}, |
160 |
}; |
}; |
161 |
|
|
162 |
static void pup_entercb(int n, void *data) |
static void pup_entercb(int n, void *data) |
163 |
{ |
{ |
164 |
FD_pupform *fdui = data; |
FD_pupform *fdui = data; |
165 |
char buf[128]; |
char buf[128]; |
166 |
fprintf(stderr,"pupId=%d\n",fl_current_pup()); |
fprintf(stderr,"pupId=%d\n",fl_current_pup()); |
168 |
fl_set_object_label(fdui->status, buf); |
fl_set_object_label(fdui->status, buf); |
169 |
} |
} |
170 |
|
|
171 |
void |
void |
172 |
dopup_callback(FL_OBJECT *ob, long data) |
dopup_callback(FL_OBJECT *ob, long data) |
173 |
{ |
{ |
174 |
if(pupID < 0) |
if(pupID < 0) |
182 |
fl_dopup(pupID); |
fl_dopup(pupID); |
183 |
} |
} |
184 |
|
|
185 |
/********* End of pup *****************/ |
/********* End of pup *****************/ |
186 |
|
|
187 |
static void |
static void |
188 |
init_choice(FL_OBJECT *ob) |
init_choice(FL_OBJECT *ob) |