view lisp/generic-widgets.el @ 4981:4aebb0131297

Cleanups/renaming of EXTERNAL_TO_C_STRING and friends -------------------- ChangeLog entries follow: -------------------- modules/ChangeLog addition: 2010-02-05 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c: * postgresql/postgresql.c (CHECK_LIVE_CONNECTION): * postgresql/postgresql.c (Fpq_connectdb): * postgresql/postgresql.c (Fpq_connect_start): * postgresql/postgresql.c (Fpq_lo_import): * postgresql/postgresql.c (Fpq_lo_export): * ldap/eldap.c (Fldap_open): * ldap/eldap.c (Fldap_search_basic): * ldap/eldap.c (Fldap_add): * ldap/eldap.c (Fldap_modify): * ldap/eldap.c (Fldap_delete): * canna/canna_api.c (Fcanna_initialize): * canna/canna_api.c (Fcanna_store_yomi): * canna/canna_api.c (Fcanna_parse): * canna/canna_api.c (Fcanna_henkan_begin): EXTERNAL_TO_C_STRING returns its argument instead of storing it in a parameter, and is renamed to EXTERNAL_TO_ITEXT. Similar things happen to related macros. See entry in src/ChangeLog. More Mule-izing of postgresql.c. Extract out common code between `pq-connectdb' and `pq-connect-start'. Fix places that signal an error string using a formatted string to instead follow the standard and have a fixed reason followed by the particular error message stored as one of the frobs. src/ChangeLog addition: 2010-02-05 Ben Wing <ben@xemacs.org> * console-msw.c (write_string_to_mswindows_debugging_output): * console-msw.c (Fmswindows_message_box): * console-x.c (x_perhaps_init_unseen_key_defaults): * console.c: * database.c (dbm_get): * database.c (dbm_put): * database.c (dbm_remove): * database.c (berkdb_get): * database.c (berkdb_put): * database.c (berkdb_remove): * database.c (Fopen_database): * device-gtk.c (gtk_init_device): * device-msw.c (msprinter_init_device_internal): * device-msw.c (msprinter_default_printer): * device-msw.c (msprinter_init_device): * device-msw.c (sync_printer_with_devmode): * device-msw.c (Fmsprinter_select_settings): * device-x.c (sanity_check_geometry_resource): * device-x.c (Dynarr_add_validified_lisp_string): * device-x.c (x_init_device): * device-x.c (Fx_put_resource): * device-x.c (Fx_valid_keysym_name_p): * device-x.c (Fx_set_font_path): * dialog-msw.c (push_lisp_string_as_unicode): * dialog-msw.c (handle_directory_dialog_box): * dialog-msw.c (handle_file_dialog_box): * dialog-x.c (dbox_descriptor_to_widget_value): * editfns.c (Fformat_time_string): * editfns.c (Fencode_time): * editfns.c (Fset_time_zone_rule): * emacs.c (make_argc_argv): * emacs.c (Fdump_emacs): * emodules.c (emodules_load): * eval.c: * eval.c (maybe_signal_error_1): * event-msw.c (Fdde_alloc_advise_item): * event-msw.c (mswindows_dde_callback): * event-msw.c (mswindows_wnd_proc): * fileio.c (report_error_with_errno): * fileio.c (Fsysnetunam): * fileio.c (Fdo_auto_save): * font-mgr.c (extract_fcapi_string): * font-mgr.c (Ffc_config_app_font_add_file): * font-mgr.c (Ffc_config_app_font_add_dir): * font-mgr.c (Ffc_config_filename): * frame-gtk.c (gtk_set_frame_text_value): * frame-gtk.c (gtk_create_widgets): * frame-msw.c (mswindows_init_frame_1): * frame-msw.c (mswindows_set_title_from_ibyte): * frame-msw.c (msprinter_init_frame_3): * frame-x.c (x_set_frame_text_value): * frame-x.c (x_set_frame_properties): * frame-x.c (start_drag_internal_1): * frame-x.c (x_cde_transfer_callback): * frame-x.c (x_create_widgets): * glyphs-eimage.c (my_jpeg_output_message): * glyphs-eimage.c (jpeg_instantiate): * glyphs-eimage.c (gif_instantiate): * glyphs-eimage.c (png_instantiate): * glyphs-eimage.c (tiff_instantiate): * glyphs-gtk.c (xbm_instantiate_1): * glyphs-gtk.c (gtk_xbm_instantiate): * glyphs-gtk.c (gtk_xpm_instantiate): * glyphs-gtk.c (gtk_xface_instantiate): * glyphs-gtk.c (cursor_font_instantiate): * glyphs-gtk.c (gtk_redisplay_widget): * glyphs-gtk.c (gtk_widget_instantiate_1): * glyphs-gtk.c (gtk_add_tab_item): * glyphs-msw.c (mswindows_xpm_instantiate): * glyphs-msw.c (bmp_instantiate): * glyphs-msw.c (mswindows_resource_instantiate): * glyphs-msw.c (xbm_instantiate_1): * glyphs-msw.c (mswindows_xbm_instantiate): * glyphs-msw.c (mswindows_xface_instantiate): * glyphs-msw.c (mswindows_redisplay_widget): * glyphs-msw.c (mswindows_widget_instantiate): * glyphs-msw.c (add_tree_item): * glyphs-msw.c (add_tab_item): * glyphs-msw.c (mswindows_combo_box_instantiate): * glyphs-msw.c (mswindows_widget_query_string_geometry): * glyphs-x.c (x_locate_pixmap_file): * glyphs-x.c (xbm_instantiate_1): * glyphs-x.c (x_xbm_instantiate): * glyphs-x.c (extract_xpm_color_names): * glyphs-x.c (x_xpm_instantiate): * glyphs-x.c (x_xface_instantiate): * glyphs-x.c (autodetect_instantiate): * glyphs-x.c (safe_XLoadFont): * glyphs-x.c (cursor_font_instantiate): * glyphs-x.c (x_redisplay_widget): * glyphs-x.c (Fchange_subwindow_property): * glyphs-x.c (x_widget_instantiate): * glyphs-x.c (x_tab_control_redisplay): * glyphs.c (pixmap_to_lisp_data): * gui-x.c (menu_separator_style_and_to_external): * gui-x.c (add_accel_and_to_external): * gui-x.c (button_item_to_widget_value): * hpplay.c (player_error_internal): * hpplay.c (play_sound_file): * hpplay.c (play_sound_data): * intl.c (Fset_current_locale): * lisp.h: * menubar-gtk.c (gtk_xemacs_set_accel_keys): * menubar-msw.c (populate_menu_add_item): * menubar-msw.c (populate_or_checksum_helper): * menubar-x.c (menu_item_descriptor_to_widget_value_1): * nt.c (init_user_info): * nt.c (get_long_basename): * nt.c (nt_get_resource): * nt.c (init_mswindows_environment): * nt.c (get_cached_volume_information): * nt.c (mswindows_readdir): * nt.c (read_unc_volume): * nt.c (mswindows_stat): * nt.c (mswindows_getdcwd): * nt.c (mswindows_executable_type): * nt.c (Fmswindows_short_file_name): * ntplay.c (nt_play_sound_file): * objects-gtk.c: * objects-gtk.c (gtk_valid_color_name_p): * objects-gtk.c (gtk_initialize_font_instance): * objects-gtk.c (gtk_font_list): * objects-msw.c (font_enum_callback_2): * objects-msw.c (parse_font_spec): * objects-x.c (x_parse_nearest_color): * objects-x.c (x_valid_color_name_p): * objects-x.c (x_initialize_font_instance): * objects-x.c (x_font_instance_truename): * objects-x.c (x_font_list): * objects-xlike-inc.c (XFUN): * objects-xlike-inc.c (xft_find_charset_font): * process-nt.c (mswindows_report_winsock_error): * process-nt.c (nt_create_process): * process-nt.c (get_internet_address): * process-nt.c (nt_open_network_stream): * process-unix.c: * process-unix.c (allocate_pty): * process-unix.c (get_internet_address): * process-unix.c (unix_canonicalize_host_name): * process-unix.c (unix_open_network_stream): * realpath.c: * select-common.h (lisp_data_to_selection_data): * select-gtk.c (symbol_to_gtk_atom): * select-gtk.c (atom_to_symbol): * select-msw.c (symbol_to_ms_cf): * select-msw.c (mswindows_register_selection_data_type): * select-x.c (symbol_to_x_atom): * select-x.c (x_atom_to_symbol): * select-x.c (hack_motif_clipboard_selection): * select-x.c (Fx_store_cutbuffer_internal): * sound.c (Fplay_sound_file): * sound.c (Fplay_sound): * sound.h (sound_perror): * sysdep.c: * sysdep.c (qxe_allocating_getcwd): * sysdep.c (qxe_execve): * sysdep.c (copy_in_passwd): * sysdep.c (qxe_getpwnam): * sysdep.c (qxe_ctime): * sysdll.c (dll_open): * sysdll.c (dll_function): * sysdll.c (dll_variable): * sysdll.c (search_linked_libs): * sysdll.c (dll_error): * sysfile.h: * sysfile.h (PATHNAME_CONVERT_OUT_TSTR): * sysfile.h (PATHNAME_CONVERT_OUT_UTF_8): * sysfile.h (PATHNAME_CONVERT_OUT): * sysfile.h (LISP_PATHNAME_CONVERT_OUT): * syswindows.h (ITEXT_TO_TSTR): * syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR): * syswindows.h (TSTR_TO_LOCAL_FILE_FORMAT): * syswindows.h (LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN): * syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR): * text.h: * text.h (eicpy_ext_len): * text.h (enum new_dfc_src_type): * text.h (EXTERNAL_TO_ITEXT): * text.h (GET_STRERROR): * tooltalk.c (check_status): * tooltalk.c (Fadd_tooltalk_message_arg): * tooltalk.c (Fadd_tooltalk_pattern_attribute): * tooltalk.c (Fadd_tooltalk_pattern_arg): * win32.c (tstr_to_local_file_format): * win32.c (mswindows_lisp_error_1): * win32.c (mswindows_report_process_error): * win32.c (Fmswindows_shell_execute): * win32.c (mswindows_read_link_1): Changes involving external/internal format conversion, mostly code cleanup and renaming. 1. Eliminate the previous macros like LISP_STRING_TO_EXTERNAL that stored its result in a parameter. The new version of LISP_STRING_TO_EXTERNAL returns its result through the return value, same as the previous NEW_LISP_STRING_TO_EXTERNAL. Use the new-style macros throughout the code. 2. Rename C_STRING_TO_EXTERNAL and friends to ITEXT_TO_EXTERNAL, in keeping with overall naming rationalization involving Itext and related types. Macros involved in previous two: EXTERNAL_TO_C_STRING -> EXTERNAL_TO_ITEXT EXTERNAL_TO_C_STRING_MALLOC -> EXTERNAL_TO_ITEXT_MALLOC SIZED_EXTERNAL_TO_C_STRING -> SIZED_EXTERNAL_TO_ITEXT SIZED_EXTERNAL_TO_C_STRING_MALLOC -> SIZED_EXTERNAL_TO_ITEXT_MALLOC C_STRING_TO_EXTERNAL -> ITEXT_TO_EXTERNAL C_STRING_TO_EXTERNAL_MALLOC -> ITEXT_TO_EXTERNAL_MALLOC LISP_STRING_TO_EXTERNAL LISP_STRING_TO_EXTERNAL_MALLOC LISP_STRING_TO_TSTR C_STRING_TO_TSTR -> ITEXT_TO_TSTR TSTR_TO_C_STRING -> TSTR_TO_ITEXT The following four still return their values through parameters, since they have more than one value to return: C_STRING_TO_SIZED_EXTERNAL -> ITEXT_TO_SIZED_EXTERNAL LISP_STRING_TO_SIZED_EXTERNAL C_STRING_TO_SIZED_EXTERNAL_MALLOC -> ITEXT_TO_SIZED_EXTERNAL_MALLOC LISP_STRING_TO_SIZED_EXTERNAL_MALLOC Sometimes additional casts had to be inserted, since the old macros played strange games and completely defeated the type system of the store params. 3. Rewrite many places where direct calls to TO_EXTERNAL_FORMAT occurred with calls to one of the convenience macros listed above, or to make_extstring(). 4. Eliminate SIZED_C_STRING macros (they were hardly used, anyway) and use a direct call to TO_EXTERNAL_FORMAT or TO_INTERNAL_FORMAT. 4. Use LISP_PATHNAME_CONVERT_OUT in many places instead of something like LISP_STRING_TO_EXTERNAL(..., Qfile_name). 5. Eliminate some temporary variables that are no longer necessary now that we return a value rather than storing it into a variable. 6. Some Mule-izing in database.c. 7. Error functions: -- A bit of code cleanup in maybe_signal_error_1. -- Eliminate report_file_type_error; it's just an alias for signal_error_2 with params in a different order. -- Fix some places in the hostname-handling code that directly inserted externally-retrieved error strings into the supposed ASCII "reason" param instead of doing the right thing and sticking text descriptive of what was going on in "reason" and putting the external message in a frob. 8. Use Ascbyte instead of CIbyte in process-unix.c and maybe one or two other places. 9. Some code cleanup in copy_in_passwd() in sysdep.c. 10. Fix a real bug due to accidental variable shadowing in tstr_to_local_file_format() in win32.c.
author Ben Wing <ben@xemacs.org>
date Fri, 05 Feb 2010 11:02:24 -0600
parents 7039e6323819
children 308d34e9f07d
line wrap: on
line source

;;; generic-widgets.el --- Generic UI building

;; Copyright (C) 2000 Free Software Foundation

;; Maintainer: William Perry <wmperry@gnu.org>
;; Keywords: extensions, dumped

;; This file is part of XEmacs.

;; XEmacs is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; XEmacs is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with XEmacs; see the file COPYING.  If not, write to the Free
;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
;; 02111-1307, USA.

;;; Synched up with: Not in FSF

;;; Commentary:

;; This file is dumped with XEmacs.

(globally-declare-fboundp
 '(gtk-label-new
   gtk-widget-show-all gtk-signal-connect
   gtk-window-new gtk-container-add gtk-vbox-new gtk-hbox-new
   gtk-box-pack-start gtk-notebook-new
   gtk-notebook-set-homogeneous-tabs gtk-notebook-set-scrollable
   gtk-notebook-set-show-tabs gtk-notebook-set-tab-pos
   gtk-notebook-append-page gtk-text-new gtk-text-set-editable
   gtk-text-set-word-wrap gtk-text-set-line-wrap
   gtk-widget-set-style gtk-text-insert gtk-label-set-line-wrap
   gtk-label-set-justify gtk-radio-button-new
   gtk-radio-button-group gtk-check-button-new
   gtk-toggle-button-new gtk-button-new gtk-progress-bar-new
   gtk-progress-bar-set-orientation gtk-progress-bar-set-bar-style))

(defun build-ui (ui)
  (if (null ui)
      (gtk-label-new "[empty]")
    (let ((builder-func (intern-soft (format "build-ui::%s" (car ui))))
	  (widget nil))
      (if (and builder-func (fboundp builder-func))
	  (progn
	    (setq widget (funcall builder-func ui))
	    (setcdr ui (plist-put (cdr ui) :x-internal-widget widget))
	    widget)
	(error "Unknown ui element: %s" (car ui))))))

(defun show-ui (ui)
  (let ((widget (plist-get (cdr ui) :x-internal-widget)))
    (if (not widget)
	(error "Attempting to show unrealized UI"))
    (gtk-widget-show-all widget)
    (gtk-signal-connect widget 'destroy
			(lambda (widget ui)
			  (setcdr ui (plist-put (cdr ui) :x-internal-widget nil))) ui)))


(defun build-ui::window (spec)
  "Create a top-level window for containing other widgets.
Properties:
:items		list			A list of child UI specs.  Only the first is used.
:type		toplevel/dialog/popup	What type of window to create.  Window managers
					can (and usually do) treat each type differently.
"
  (let ((plist (cdr spec))
	(window nil)
	(child nil))
    (setq window (gtk-window-new (plist-get plist :type 'toplevel))
	  child (build-ui (car (plist-get plist :items))))
    (gtk-container-add window child)
    window))

(defun build-ui::box (spec)
  "Create a box for containing other widgets.
Properties:
:items		list			A list of child UI specs.
:homogeneous	t/nil			Whether all children are the same width/height.
:spacing	number			Spacing between children.
:orientation	horizontal/vertical	How the widgets are stacked.

Additional properties on child widgets:
:expand		t/nil		Whether the new child is to be given extra space
				allocated to box. The extra space will be divided
				evenly between all children of box that use this
				option.
:fill		t/nil		Whether space given to child by the expand option is
				actually allocated to child, rather than just padding
				it. This parameter has no effect if :expand is set to
				nil. A child is always allocated the full height of a
				horizontal box and the full width of a vertical box.
				This option affects the other dimension.
:padding	number		Extra padding around this widget.
"
  (let* ((plist (cdr spec))
	 (orientation (plist-get plist :orientation 'horizontal))
	 (children (plist-get plist :items))
	 (box nil)
	 (child-widget nil)
	 (child-plist nil))
    (case orientation
      (vertical (setq box (gtk-vbox-new (plist-get plist :homogeneous)
					(plist-get plist :spacing))))
      (horizontal (setq box (gtk-hbox-new (plist-get plist :homogeneous)
					  (plist-get plist :spacing))))
      (otherwise (error "Unknown orientation for box: %s" orientation)))
    (mapc
     (lambda (child)
       (setq child-plist (cdr child)
	     child-widget (build-ui child))
       (if (listp child-widget)
	   (mapc (lambda (w)
		   (gtk-box-pack-start box w
				       (plist-get child-plist :expand)
				       (plist-get child-plist :fill)
				       (plist-get child-plist :padding))) child-widget)
	 (gtk-box-pack-start box child-widget
			     (plist-get child-plist :expand)
			     (plist-get child-plist :fill)
			     (plist-get child-plist :padding))))
     children)
    box))

(defun build-ui::tab-control (spec)
  "Create a notebook widget.
Properties:
:items		list		A list of UI specs to use as notebook pages.
:homogeneous	t/nil		Whether all tabs are the same width.
:orientation	top/bottom/left/right	Position of tabs
:show-tabs	t/nil		Show the tabs on screen?
:scrollable	t/nil		Allow scrolling to view all tab widgets?

Additional properties on child widgets:
:tab-label	ui		A UI spec to use for the tab label.
"
  (let* ((plist (cdr spec))
	 (notebook (gtk-notebook-new))
	 (children (plist-get plist :items))
	 (page-counter 1)
	 (label-widget nil)
	 (child-widget nil)
	 (child-plist nil))
    ;; Set all the properties
    (gtk-notebook-set-homogeneous-tabs notebook (plist-get plist :homogeneous))
    (gtk-notebook-set-scrollable notebook (plist-get plist :scrollable t))
    (gtk-notebook-set-show-tabs notebook (plist-get plist :show-tabs t))
    (gtk-notebook-set-tab-pos notebook (plist-get plist :orientation 'top))

    ;; Now fill in the tabs
    (mapc
     (lambda (child)
       (setq child-plist (cdr child)
	     child-widget (build-ui child)
	     label-widget (build-ui (plist-get child-plist :tab-label
					       (list 'label :text (format "tab %d" page-counter))))
	     page-counter (1+ page-counter))
       (gtk-notebook-append-page notebook child-widget label-widget))
     children)
    notebook))

(defun build-ui::text (spec)
  "Create a multi-line text widget.
Properties:
:editable	t/nil		Whether the user can change the contents
:word-wrap	t/nil		Automatic word wrapping?
:line-wrap	t/nil		Automatic line wrapping?
:text		string		Initial contents of the widget
:file		filename	File for initial contents (takes precedence over :text)
:face		facename	XEmacs face to use in the widget.
"
  (let* ((plist (cdr spec))
	 (text (gtk-text-new nil nil))
	 (face (plist-get plist :face 'default))
	 (info (plist-get plist :text))
	 (file (plist-get plist :file)))
    (gtk-text-set-editable text (plist-get plist :editable))
    (gtk-text-set-word-wrap text (plist-get plist :word-wrap))
    (gtk-text-set-line-wrap text (plist-get plist :line-wrap))
    (gtk-widget-set-style text 'default)

    ;; Possible convert the file portion
    (if (and file (not (stringp file)))
	(setq file (eval file)))

    (if (and info (not (stringp info)))
	(setq info (eval info)))

    (if (and file (file-exists-p file) (file-readable-p file))
	(save-excursion
	  (set-buffer (get-buffer-create " *improbable buffer name*"))
	  (insert-file-contents file)
	  (setq info (buffer-string))))

    (gtk-text-insert text
		     (face-font face)
		     (face-foreground face)
		     (face-background face)
		     info (length info))
    text))

(defun build-ui::label (spec)
  "Create a label widget.
Properties:
:text		string			Text inside the label
:face		facename		XEmacs face to use in the widget.
:justification  right/left/center	How to justify the text.
"
  (let* ((plist (cdr spec))
	 (label (gtk-label-new (plist-get plist :text))))
    (gtk-label-set-line-wrap label t)
    (gtk-label-set-justify label (plist-get plist :justification))
    (gtk-widget-set-style label (plist-get plist :face 'default))
    label))

(defun build-ui::pixmap (spec)
  "Create a multi-line text widget.
Properties:
:text		string			Text inside the label
:face		facename		XEmacs face to use in the widget.
:justification  right/left/center	How to justify the text.
"
  (let* ((plist (cdr spec))
	 (label (gtk-label-new (plist-get plist :text))))
    (gtk-label-set-line-wrap label t)
    (gtk-label-set-justify label (plist-get plist :justification))
    (gtk-widget-set-style label (plist-get plist :face 'default))
    label))

(defun build-ui::radio-group (spec)
  "A convenience when specifying a group of radio buttons."
  (declare (special build-ui::radio-group))
  (let ((build-ui::radio-group nil))
    (mapcar 'build-ui (plist-get (cdr spec) :items))))

(defun build-ui::button (spec)
  "Create a button widget.
Properties:
:type		radio/check/toggle/nil	What type of button to create.
:text		string			Text in the button.
:glyph		glyph			Image in the button.
:label		ui			A UI spec to use for the label.
:relief		normal/half/none	How to draw button edges.

NOTE: Radio buttons must be in a radio-group object for them to work.
"
  (declare (special build-ui::radio-group))
  (let* ((plist (cdr spec))
	 (button nil)
	 (button-type (plist-get plist :type 'normal)))
    (case button-type
      (radio
       (if (not (boundp 'build-ui::radio-group))
	   (error "Attempt to use a radio button outside a radio-group"))
       (setq button (gtk-radio-button-new build-ui::radio-group)
	     build-ui::radio-group (gtk-radio-button-group button)))
      (check
       (setq button (gtk-check-button-new)))
      (toggle
       (setq button (gtk-toggle-button-new)))
      (normal
       (setq button (gtk-button-new)))
      (otherwise
       (error "Unknown button type: %s" button-type)))
    (gtk-container-add
     button
     (build-ui (plist-get plist :label
			  (list 'label :text
				(plist-get plist
					   :text (format "%s button" button-type))))))
    button))

(defun build-ui::progress-gauge (spec)
  "Create a progress meter.
Properties:
:orientation		left-to-right/right-to-left/top-to-bottom/bottom-to-top
:type			discrete/continuous

"
  (let ((plist (cdr spec))
	(gauge (gtk-progress-bar-new)))
    (gtk-progress-bar-set-orientation gauge (plist-get plist :orientation 'left-to-right))
    (gtk-progress-bar-set-bar-style gauge (plist-get plist :type 'continuous))
    gauge))

(provide 'generic-widgets)

(when (featurep 'gtk)			; just loading this file should be OK
(gtk-widget-show-all
  (build-ui
   '(window :type dialog
	    :items ((tab-control
		     :homogeneous t
		     :orientation bottom
		     :items ((box :orientation vertical
				  :tab-label (label :text "vertical")
				  :items ((label :text "Vertical")
					  (progress-gauge)					  
					  (label :text "Box stacking")))
			     (box :orientation horizontal
				  :spacing 10
				  :items ((label :text "Horizontal box")
					  (label :text "stacking")))

			     (box :orientation vertical
				  :items
				  ((radio-group
				    :items ((button :type radio
						    :expand nil
						    :fill nil
						    :text "Item 1")
					    (button :type radio
						    :expand nil
						    :fill nil
						    :text "Item 2")
					    (button :type radio
						    :expand nil
						    :fill nil
						    :text "Item 3")
					    (button :type radio
						    :expand nil
						    :fill nil)))))
			     (box :orientation vertical
				  :items ((button :type check
						  :text "Item 1")
					  (button :type check
						  :text "Item 2")
					  (button :type normal
						  :text "Item 3")
					  (button :type toggle)))
			     (text :editable t
				   :word-wrap t
				   :file (locate-data-file "COPYING"))
			     (text :editable t
				   :face display-time-mail-balloon-enhance-face
				   :word-wrap t
				   :text "Text with a face on it")))))))
)