Re: GUIkit problem
- To: mathgroup at smc.vnet.net
- Subject: [mg56719] Re: GUIkit problem
- From: "Lalu" <BhuvaneshBhatt at gmail.com>
- Date: Wed, 4 May 2005 00:34:34 -0400 (EDT)
- References: <d57h2q$p8q$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
babazar... 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[] You need to use AppendTo instead of Append. In[1]:= ?Append Append[expr, elem] gives expr with elem appended. In[2]:= ?AppendTo AppendTo[s, elem] appends elem to the value of s, and resets s to the result. In[3]:= list = {x} Out[3]= {x} In[4]:= Append[list, y] Out[4]= {x, y} In[5]:= list Out[5]= {x} In[6]:= AppendTo[list, y] Out[6]= {x, y} In[7]:= list Out[7]= {x, y} Hope this helps. Bhuvanesh Bhatt, Wolfram Research.