From xemacs-m  Tue Feb 25 23:48:15 1997
Received: from mecca.spd.louisville.edu (mecca.spd.louisville.edu [136.165.40.148])
	by xemacs.org (8.8.5/8.8.5) with SMTP id XAA12652
	for <xemacs-beta@xemacs.org>; Tue, 25 Feb 1997 23:48:14 -0600 (CST)
Received: (from tjchol01@localhost) by mecca.spd.louisville.edu (950413.SGI.8.6.12/8.6.12) id FAA13977; Wed, 26 Feb 1997 05:48:20 GMT
Date: Wed, 26 Feb 1997 05:48:20 GMT
Message-Id: <199702260548.FAA13977@mecca.spd.louisville.edu>
From: "Tomasz J. Cholewo" <tjchol01@mecca.spd.louisville.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: XEmacs-Beta Listserv <xemacs-beta@xemacs.org>
Subject: [patch] custom/widget-edit.el: W3 buttons on a tty

W3 fails on a tty when trying to display a page containing buttons with:

Signaling: (wrong-type-argument stringp nil)
  make-color-instance(nil)
  xpm-button-color-rgb-components(nil)
  xpm-button-compute-shadow-colors(nil)
  xpm-button-create("Home Page" 2 "black" nil)
  make-gui-button("Home Page" ...
  widget-push-button-value-create((push-button ...
  ...

The function `widget-push-button-value-create' before calling function
`make-gui-button' which loses on a tty (at least with xpm compiled in)
makes the following checks:

    (if (and (fboundp 'make-gui-button)  <- dumped
	     (fboundp 'make-glyph)       <- dumped
	     widget-push-button-gui
	     (string-match "XEmacs" emacs-version)) <- dumped :-)

If these checks fail it prepares a fancy text `[tag]' button so
apparently the changes should be made in this function.  It looks like
the only candidate to verify the device type is `widget-push-button-gui'.
A patch follows.

Tom

--- widget-edit.el.orig	Wed Feb 26 00:22:00 1997
+++ widget-edit.el	Wed Feb 26 00:24:56 1997
@@ -1098,7 +1098,9 @@
 
 ;;; The `push-button' Widget.
 
-(defcustom widget-push-button-gui t
+(defcustom widget-push-button-gui 
+  (and (fboundp 'device-type)
+       (equal (device-type) 'x))
   "If non nil, use GUI push buttons when available."
   :group 'widgets
   :type 'boolean)

