comparison src/menubar-gtk.c @ 563:183866b06e0b

[xemacs-hg @ 2001-05-24 07:50:48 by ben] Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c: -- defsymbol -> DEFSYMBOL. -- add an error type to all errors. -- eliminate the error functions in eval.c that let you just use Qerror as the type. -- redo the error API to be more consistent, sensibly named, and easier to use. -- redo the error hierarchy somewhat. create new errors: structure-formation-error, gui-error, invalid-constant, stack-overflow, out-of-memory, process-error, network-error, sound-error, printing-unreadable-object, base64-conversion- error; coding-system-error renamed to text-conversion error; some others. -- fix Mule problems in error strings in emodules.c, tooltalk.c. -- fix error handling in mswin open-network-stream. -- Mule-ize all sound files and clean up the headers. -- nativesound.h -> sound.h and used for all sound files. -- move some shared stuff into glyphs-shared.c: first attempt at eliminating some of the massive GTK code duplication. xemacs.mak: add glyphs-shared.c. xemacs-faq.texi: document how to debug X errors subr.el: fix doc string to reflect reality
author ben
date Thu, 24 May 2001 07:51:33 +0000
parents 0784d089fdc9
children 02339d4ebed4
comparison
equal deleted inserted replaced
562:c775bd016b32 563:183866b06e0b
437 while (key = Fcar (desc), KEYWORDP (key)) 437 while (key = Fcar (desc), KEYWORDP (key))
438 { 438 {
439 Lisp_Object cascade = desc; 439 Lisp_Object cascade = desc;
440 desc = Fcdr (desc); 440 desc = Fcdr (desc);
441 if (NILP (desc)) 441 if (NILP (desc))
442 signal_simple_error ("keyword in menu lacks a value", 442 sferror ("keyword in menu lacks a value",
443 cascade); 443 cascade);
444 val = Fcar (desc); 444 val = Fcar (desc);
445 desc = Fcdr (desc); 445 desc = Fcdr (desc);
446 if (EQ (key, Q_included)) 446 if (EQ (key, Q_included))
447 include_p = val, included_spec = 1; 447 include_p = val, included_spec = 1;
456 #if 0 456 #if 0
457 if ( SYMBOLP (val) 457 if ( SYMBOLP (val)
458 || CHARP (val)) 458 || CHARP (val))
459 wv->accel = LISP_TO_VOID (val); 459 wv->accel = LISP_TO_VOID (val);
460 else 460 else
461 signal_simple_error ("bad keyboard accelerator", val); 461 invalid_argument ("bad keyboard accelerator", val);
462 #endif 462 #endif
463 } 463 }
464 else if (EQ (key, Q_label)) 464 else if (EQ (key, Q_label))
465 { 465 {
466 /* implement in 21.2 */ 466 /* implement in 21.2 */
467 } 467 }
468 else 468 else
469 signal_simple_error ("unknown menu cascade keyword", cascade); 469 invalid_argument ("unknown menu cascade keyword", cascade);
470 } 470 }
471 471
472 gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, LISP_TO_VOID (desc)); 472 gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, LISP_TO_VOID (desc));
473 gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, LISP_TO_VOID (hook_fn)); 473 gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, LISP_TO_VOID (hook_fn));
474 474
484 484
485 gtk_widget_set_sensitive (GTK_WIDGET (menu_item), ! NILP (active_p)); 485 gtk_widget_set_sensitive (GTK_WIDGET (menu_item), ! NILP (active_p));
486 } 486 }
487 else 487 else
488 { 488 {
489 signal_simple_error ("menu name (first element) must be a string", 489 invalid_argument ("menu name (first element) must be a string",
490 desc); 490 desc);
491 } 491 }
492 492
493 /* If we are reusing a widget, we need to make sure we clean 493 /* If we are reusing a widget, we need to make sure we clean
494 ** everything up. 494 ** everything up.
610 int plist_p; 610 int plist_p;
611 int selected_spec = 0, included_spec = 0; 611 int selected_spec = 0, included_spec = 0;
612 GtkWidget *widget = NULL; 612 GtkWidget *widget = NULL;
613 613
614 if (length < 2) 614 if (length < 2)
615 signal_simple_error ("button descriptors must be at least 2 long", descr); 615 sferror ("button descriptors must be at least 2 long", descr);
616 616
617 /* length 2: [ "name" callback ] 617 /* length 2: [ "name" callback ]
618 length 3: [ "name" callback active-p ] 618 length 3: [ "name" callback active-p ]
619 length 4: [ "name" callback active-p suffix ] 619 length 4: [ "name" callback active-p suffix ]
620 or [ "name" callback keyword value ] 620 or [ "name" callback keyword value ]
634 else 634 else
635 { 635 {
636 /* the new way */ 636 /* the new way */
637 int i; 637 int i;
638 if (length & 1) 638 if (length & 1)
639 signal_simple_error ( 639 sferror (
640 "button descriptor has an odd number of keywords and values", 640 "button descriptor has an odd number of keywords and values",
641 descr); 641 descr);
642 642
643 name = contents [0]; 643 name = contents [0];
644 callback = contents [1]; 644 callback = contents [1];
645 for (i = 2; i < length;) 645 for (i = 2; i < length;)
646 { 646 {
647 Lisp_Object key = contents [i++]; 647 Lisp_Object key = contents [i++];
648 Lisp_Object val = contents [i++]; 648 Lisp_Object val = contents [i++];
649 if (!KEYWORDP (key)) 649 if (!KEYWORDP (key))
650 signal_simple_error_2 ("not a keyword", key, descr); 650 invalid_argument_2 ("not a keyword", key, descr);
651 651
652 if (EQ (key, Q_active)) active_p = val; 652 if (EQ (key, Q_active)) active_p = val;
653 else if (EQ (key, Q_suffix)) suffix = val; 653 else if (EQ (key, Q_suffix)) suffix = val;
654 else if (EQ (key, Q_keys)) keys = val; 654 else if (EQ (key, Q_keys)) keys = val;
655 else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compat */ 655 else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compat */
661 else if (EQ (key, Q_accelerator)) 661 else if (EQ (key, Q_accelerator))
662 { 662 {
663 if ( SYMBOLP (val) || CHARP (val)) 663 if ( SYMBOLP (val) || CHARP (val))
664 accel = val; 664 accel = val;
665 else 665 else
666 signal_simple_error ("bad keyboard accelerator", val); 666 invalid_argument ("bad keyboard accelerator", val);
667 } 667 }
668 else if (EQ (key, Q_filter)) 668 else if (EQ (key, Q_filter))
669 signal_simple_error(":filter keyword not permitted on leaf nodes", descr); 669 sferror(":filter keyword not permitted on leaf nodes", descr);
670 else 670 else
671 signal_simple_error_2 ("unknown menu item keyword", key, descr); 671 invalid_argument_2 ("unknown menu item keyword", key, descr);
672 } 672 }
673 } 673 }
674 674
675 #ifdef HAVE_MENUBARS 675 #ifdef HAVE_MENUBARS
676 if ((!NILP (config_tag) && NILP (Fmemq (config_tag, Vmenubar_configuration))) 676 if ((!NILP (config_tag) && NILP (Fmemq (config_tag, Vmenubar_configuration)))
807 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), 807 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget),
808 NILP (selected_p) ? FALSE : TRUE); 808 NILP (selected_p) ? FALSE : TRUE);
809 } 809 }
810 else 810 else
811 { 811 {
812 signal_simple_error_2 ("unknown style", style, descr); 812 invalid_argument_2 ("unknown style", style, descr);
813 } 813 }
814 814
815 gtk_widget_set_sensitive (widget, ! NILP (active_p)); 815 gtk_widget_set_sensitive (widget, ! NILP (active_p));
816 816
817 gtk_signal_connect (GTK_OBJECT (widget), "activate-item", 817 gtk_signal_connect (GTK_OBJECT (widget), "activate-item",