comparison src/dialog-x.c @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents c5d627a313b1
children 57709be46d1b
comparison
equal deleted inserted replaced
283:fa3d41851a08 284:558f606b08ae
211 unbind_to (count, Qnil); 211 unbind_to (count, Qnil);
212 return dbox; 212 return dbox;
213 } 213 }
214 } 214 }
215 215
216 DEFUN ("popup-dialog-box", Fpopup_dialog_box, 1, 1, 0, /* 216 static void
217 Pop up a dialog box. 217 x_popup_dialog_box (struct frame* f, Lisp_Object dbox_desc)
218 A dialog box description is a list.
219
220 The first element of a dialog box must be a string, which is the title or
221 question.
222
223 The rest of the elements are descriptions of the dialog box's buttons.
224 Each of these is a vector, the syntax of which is essentially the same as
225 that of popup menu items. They may have any of the following forms:
226
227 [ "name" callback <active-p> ]
228 [ "name" callback <active-p> "suffix" ]
229 [ "name" callback :<keyword> <value> :<keyword> <value> ... ]
230
231 The name is the string to display on the button; it is filtered through the
232 resource database, so it is possible for resources to override what string
233 is actually displayed.
234
235 If the `callback' of a button is a symbol, then it must name a command.
236 It will be invoked with `call-interactively'. If it is a list, then it is
237 evaluated with `eval'.
238
239 One (and only one) of the buttons may be `nil'. This marker means that all
240 following buttons should be flushright instead of flushleft.
241
242 Though the keyword/value syntax is supported for dialog boxes just as in
243 popup menus, the only keyword which is both meaningful and fully implemented
244 for dialog box buttons is `:active'.
245 */
246 (dbox_desc))
247 { 218 {
248 int dbox_id; 219 int dbox_id;
249 struct frame *f = selected_frame ();
250 widget_value *data; 220 widget_value *data;
251 Widget parent, dbox; 221 Widget parent, dbox;
252 Lisp_Object frame; 222 Lisp_Object frame;
253 223
254 XSETFRAME (frame, f); 224 XSETFRAME (frame, f);
286 if (zmacs_regions) 256 if (zmacs_regions)
287 zmacs_region_stays = 1; 257 zmacs_region_stays = 1;
288 258
289 popup_up_p++; 259 popup_up_p++;
290 lw_pop_up_all_widgets (dbox_id); 260 lw_pop_up_all_widgets (dbox_id);
291 return Qnil;
292 } 261 }
293 262
294 void 263 void
295 syms_of_dialog_x (void) 264 syms_of_dialog_x (void)
296 { 265 {
297 DEFSUBR (Fpopup_dialog_box); 266 }
267
268 void
269 console_type_create_dialog_x (void)
270 {
271 CONSOLE_HAS_METHOD (x, popup_dialog_box);
298 } 272 }
299 273
300 void 274 void
301 vars_of_dialog_x (void) 275 vars_of_dialog_x (void)
302 { 276 {