Path: lvirden
 From: lvirden@cas.org (Larry W. Virden)
 Subject: comp.lang.tcl Frequently Asked Questions (2/3)
-	 (Last updated: August 24, 1992)
+	 (Last updated: October 8, 1992)
 Followup-To: comp.lang.tcl
 Summary: A regular posting of the comp.lang.tcl Frequently Asked Questions 
-	(FAQ) and their answers.  This is the first of three parts.
+	(FAQ) and their answers.  This is the second of three parts.
 Originator: lvirden@cas.org
 Keywords: tcl, expect, extended tcl, wish, tk
 Sender: lvirden@cas.org
@@ -15,9 +15,14 @@
 
 
 Archive-name: tcl-faq/part2
-Version: 2.3
-Last-modified: August 24, 1992
+Version: 2.4
+Last-modified: October 8, 1992
 
+Please do not be offended if I neglect to acknowledge your contribution
+to this FAQ!  I sometimes forget to put an attribution in.  I expecially
+try to add them if it appears that there is further experimentation or
+debugging being done though.
+
 Index of questions:
 
 7. Questions on building Tcl and friends on your system
@@ -34,6 +39,9 @@
 	Q7h. When I try to run tcl v6.2 tclTest under Irix 4.0.1 I get
 		lots of errors.
 	Q7i. Does anyone else have problems with Tcl on a Cray?
+	Q7j. Does anyone know how to get Tk to run on a SparcBook or other
+		laptop with a limited number of colors?
+
 8.  How can I XXX in Tcl/Tk?
 	Q8a. get association lists or property lists?
 	Q8b. call one proc with the multi parameter value returned by 
@@ -49,7 +57,19 @@
 	Q8j. change the default class bindings?
 	Q8k. delete a binding?
 	Q8l. raise or lower a window?
-	Q8m. change the X11 cursor?
+	Q8m. re-map a withdrawn window id?
+	Q8n. change the X11 cursor?
+	Q8o. change a binding while it is being executed?
+	Q8p. fill a canvas which is bounded by lines as opposed to a
+		shape like a polygon, oval, etc.?
+	Q8q. specify bitmap patterns on the command line instead of 
+		as a file name?
+	Q8r. ,using a machine with less than 8 bit color, run?
+	Q8s. get parray to recognize an array variable I have created
+		via upvar?
+	Q8t. get more than 7 digits of double precision?
+	Q8u. grab the command line whenever a non-built-in call is made?
+	Q8v. get an application to also use libXt?
 	
 End of FAQ Index
 
@@ -218,6 +238,17 @@
 version 3.0.2.1, things are much better, except for a minor formatting
 problem and serious problems with scan.
 
+Subject: -Q7j- Does anyone know how to get Tk to run on a SparcBook or other
+laptop with a limited number of colors?
+
+A7j.  On a SparcBook, if you start openwin (the OpenWindows server starting
+command) as:
+
+openwin -dev "/dev/fb staticvis"
+
+you get a static visual color model that Tk copes with better than the
+default.  Somethings are ugly, but not as ugly as monochrome.
+
 ------------------------------
 Subject: -8-  How can I do XXX in Tcl/Tk?
 
@@ -410,9 +441,9 @@
 
 A8m. Use wm deiconify <windowid>.
 
-Subject: -Q8m- change the X11 cursor?
+Subject: -Q8n- change the X11 cursor?
 
-Here is a tip from mgc@cray.com (M. G. Christenson).
+A8n. Here is a tip from mgc@cray.com (M. G. Christenson).
 
 Look at /usr/include/X11/cursorfont.h for a list of available cursors.
 You can use the names in there by removing the 'XC_'.  
@@ -461,4 +492,77 @@
     }
 }
 
+Subject: -Q8o- change a Tk binding while it is being executed?
+
+A8o. As of June, 1992, this was not a safe thing to do in Tk.  It was
+put on the bug list by John Ousterhout to be fixed in a future version.
+
+The solution for now is not to change the bindings, but to change
+something in the code they execute.  For example, keep a state variable
+that indicates which binding you'd like, but always have the binding
+call a given procedure.  Then that procedure checks the variable and
+executes one piece of code or another.  Or, you could just make the
+binding's command "eval $cmd" and then change the variable "cmd"
+depending on your application's state.
+
+Subject: -Q8p- fill a canvas which is bounded by lines as opposed to a
+shape like a polygon, oval, etc.?
+
+A8p. No, you have to at least use a polygon if you want to fill an area
+bounded by some lines.
+
+Subject: -Q8q- specify bitmap patterns on the command line instead of as 
+a file name?
+
+A8q. You can not, at least as of June, 1992.
+
+Subject: -Q8r- ,using a machine with less than 8 bit color, run?
+
+A8r. Tk doesn't behave very well with less than 8-bit color screens.  To
+try to use it, find all the places in the Tk/wish source where 
+DefaultDepthOfScreen is invoked to test teh number of bit-planes.  Change all
+of these to pretend there is just 1 bit-plane, or call a procedure which
+monitors a Tcl variable so that it is configurable, and you should be okay.
+
+Another alternative is to see if the server you are using has alternative
+visual / color models, such as static visual, etc.  One of the alternatives
+may allow Tk to work better.
+
+Thanks to "Nathaniel Borenstein" <nsb@thumper.bellcore.com> for this info!
+
+Subject: -Q8s- get parray to recognize an array variable I have created
+	via upvar?
+
+A8s. Right now (June, 1992) upvar doesn't allow you to attach to an
+individual element of an array.  This is considered a bug by 
+Mr. Ousterhout and has been place on a bug list.
+
+Subject: -Q8t- get more than 7 digits of double precision ?
+
+A8t. Modify the tclExpr.c module to use %lf instead of %g.
+
+Subject: -Q8u- grab the command line whenever a non-built-in call is made?
+
+A8u. The procedure "unknown" is called automatically with arguments 
+containing the command and its arguments for any command that couldn't be 
+found.  In fact, Tcl and Extended Tcl use this feature to provide demand
+loaded commands, and even entire libraries.
+
+So by modifying the unknown procedure you can provide your own extended
+functionality, or even remove the demand loading capability if you so
+desire.
+
+Subject: -Q8v- get an application to also use libXt?
+
+A8v. Tk2.1 and Xt have different X connections, and XtAppNextEvent will
+block is there is nothing coming from the X connection.  One way
+of fixing this is get the connection number of Tk using
+
+   ConnectionNumber(Tk_Display(tk_window));
+
+and using XtAddInput to register this with the Xt event handler.  The
+callback procedure for XtAddInput wrapper procedure that runs
+Tk_OneEvent(1).  There might be problems with Tk file sources which
+aren't registered with Xt.
 
+Thanks to joe@astro.as.utexas.edu (Joe Wang) for this information.
--- old.tcl-faq.p03	Thu Oct  8 07:14:53 1992
+++ tcl-faq.p03	Thu Oct  8 07:15:03 1992
@@ -2,10 +2,10 @@