thanks guys, I didn&#39;t realize that setting textvariable = varname explicitly delegates the value to this variable. In MATLAB things work differently. <br><br>cheers,<br><br>Alex <br><br><div class="gmail_quote">2010/10/28 Lion Kimbro <span dir="ltr">&lt;<a href="mailto:lionkimbro@gmail.com">lionkimbro@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>  Alex, does this answer what you&#39;re trying to do?<br><br>&gt;&gt;&gt; import tkinter<br>
&gt;&gt;&gt; top = tkinter.Tk()<br>&gt;&gt;&gt; intvar = tkinter.IntVar()<br>&gt;&gt;&gt; entry = tkinter.Entry(top, width=10, textvariable=intvar)<br>
&gt;&gt;&gt; entry.grid()<br>&gt;&gt;&gt; intvar.get()<br>0<br>&gt;&gt;&gt; # now I set it to 10 in the user interface...<br>...<br>&gt;&gt;&gt; intvar.get()<br>10<br>&gt;&gt;&gt;<br><br>  I found the names of the variables pretty confusing;<br>

  When I used &quot;intvar&quot; and &quot;entry&quot;, it was much clearer to me.<br><br>  You wrote &quot;<font face="Courier, Monospaced">#need to get the textvariable value from Entry popsize, not variable PopSize!</font>&quot;<br>

<br>  ...but I thought you were trying to get the widget&#39;s property?<br><br>  When you set the value with &quot;textvariable=intvar&quot;, the widget is now explicitly delegating the value to intvar.<br>  That is, the IntVar becomes the authority for the information.<div>
<div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Wed, Oct 27, 2010 at 4:39 AM, Alex Ter-Sarkissov <span dir="ltr">&lt;<a href="mailto:sigma.z.1980@gmail.com" target="_blank">sigma.z.1980@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<font face="Courier, Monospaced">hi, here&#39;s my problem: <br> </font><p><font face="Courier, Monospaced">let&#39;s say I have a function that uses some widget&#39;s property. How canI <br>
 retireve the value of this property? <br> </font></p><p><font face="Courier, Monospaced">For example, <br> </font></p><p><font face="Courier, Monospaced">PopSize=IntVar(); <br> </font></p>
<p><font face="Courier, Monospaced">popsize=Entry(root,width=10,textvariable=PopSize) <br> </font></p><p><font face="Courier, Monospaced">def rand_opo_gen (self,event): <br>       popsize_start=#need to get the textvariable value from Entry <br>


 popsize, not variable PopSize! <br>       pop1=random.random(popsize_start*2) <br> </font></p><p><font face="Courier, Monospaced">Another option, of course, is that the variable PopSize acquires the <br>
 value from Entry, but I can&#39;t see how to do it either <br> </font></p><p><font face="Courier, Monospaced">cheers, <br> </font></p><font face="Courier, Monospaced">alex </font>
<br>_______________________________________________<br>
Tkinter-discuss mailing list<br>
<a href="mailto:Tkinter-discuss@python.org" target="_blank">Tkinter-discuss@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tkinter-discuss" target="_blank">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>