Re: Re: Re: Making a user interface
- To: mathgroup at smc.vnet.net
- Subject: [mg99608] Re: [mg99573] Re: [mg99524] Re: Making a user interface
- From: John Fultz <jfultz at wolfram.com>
- Date: Sat, 9 May 2009 03:20:37 -0400 (EDT)
- Reply-to: jfultz at wolfram.com
Yes, this is a bug (in fact, one which merited some internal discussion among the UI development group a couple of months ago). And, as is typical with these kinds of bugs, it has nothing to do with just running under Windows XP, or even Windows in general. It does have an easy workaround, though. Just wrap Deploy around the Panel. I.e., Module[{Entry1 = "", Entry2 = "", Answer = ""}, Deploy[Panel[ Column[{Row[{"Entry 1: ", InputField[Dynamic[Entry1], String, Background -> LightCyan]}], Row[{"Entry 2: ", InputField[Dynamic[Entry2], String, Background -> LightYellow]}], Dynamic@Row[{"Answer: ", Answer}], Row[{Button["Clear", Entry1 = ""; Entry2 = ""; Answer = ""], Button["Calculate", Answer = ToExpression[Entry1] ToExpression[Entry2]]}]}], Style["Enter and Calculate_Multiplication", 16, Bold, Italic]]]]; Framed[%, Background -> LightOrange] Using Deploy also fixes other issues which are distinctly not bugs, but may be undesirable behaviors. For example, without Deploy, you can use the mouse to select the various labels. This is absolutely not a bug. There are quite possibly many kinds of Panels where this would be desirable behavior (typically to enable copy/paste). But, I think it would probably be pretty undesirable for an interface like this. Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. On Fri, 8 May 2009 00:16:20 -0400 (EDT), Murray Eisenberg wrote: > At least under Windows XP and with Mathematica 7.0.1, there seems to be > a bug with the Panel and InputField mechanism for such an example... > > I do the following: > > - click the entry field for Entry1 and type something there ("hello", > for example); > > - press Tab, which highlights the label "Entry 2:"; > > - press Tab again (presumably to get into the entry field for Entry2); > > - begin typing there. > > Then the background and outline of the 2nd entry field disappears, > becoming a uniform gray to match the panel's background. Already that's > a bug. > > But I can continue typing there, e.g., "goodbye". > > Now when I press the calculate button, what appears next to label > "Answer"" is: hello Null > > Is this bug present for other versions of Windows, or with other OS's? > > Bill wrote: >> Hi Jason: >> >> Here's one example... >> >> >> Module[{Entry1 = "", Entry2 = "", Answer = ""}, >> Panel[Column[{Row[{"Entry 1: ", >> InputField[Dynamic[Entry1], String, Background -> LightCyan]}], >> Row[{"Entry 2: ", >> InputField[Dynamic[Entry2], String, Background -> LightYellow]}], >> Dynamic@Row[{"Answer: ", Answer}], >> Row[{Button["Clear", Entry1 = ""; Entry2 = ""; Answer = ""], >> Button["Calculate", >> Answer = ToExpression[Entry1] ToExpression[Entry2]]}]}], >> Style["Enter and Calculate_Multiplication", 16, Bold, Italic]]]; >> Framed[%, Background -> LightOrange] >> >> >> Hth, >> >> Bill >> >> PS. I used Mathematica 6.0.1 with Win XP on a PC.