MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: GUIkit problem


Hi Baba,
Look at your statement: Append[newlist, label2]
This creates an a list with 2 elements and then discards it!
You need "AppendTo" to store the list in newlist.

Sincerely, Daniel

babazaroni at gmail.com wrote:
> Hello,
> 
> I'm new to Mathematica and GUIkit and wonder why the following
> expressions produce a GUI with only the first label (Hello World1!).
> 
> Needs["GUIKit`"];
> label1 := Widget["Label", {"text" -> "Hello World1!"}]
> label2 := Widget["Label", {"text" -> "Hello World2!"}]
> newlist = {label1}
> Append[newlist, label2]
> HelloWorld[] := GUIRunModal[ Widget["Panel", newlist]]
> HelloWorld[]
> 
> This code below works correctly, but I need to dynamically add labels.
> 
> Needs["GUIKit`"];
> mine1 := Widget["Label", {"text" -> "Hello World1!"}]
> mine2 := Widget["Label", {"text" -> "Hello World2!"}]
> HelloWorld[] := GUIRunModal[ Widget["Panel", {label1,label2}]]
> HelloWorld[]
> 
> Thanks,
> 
> Baba
> 


  • Prev by Date: Re: debugging
  • Next by Date: garbage collection and netlink
  • Previous by thread: Re: GUIkit problem
  • Next by thread: managing order of magnitude instead of numbers