>From the lack of replies...I am guessing that this can't be done.  Tho I just 
>realized I had a typo in part of it.

The line that reads:
"Is there a way to do something like this in Tkinter?  Or am I correct in
 guessing that if it is not possible, it is probably more complicated 
than the above?"

...should have said, "Or am I correct in guessing tat if it IS possible, it is 
probably more..."

--- On Wed, 1/26/11, Elwin Estle <chrysalis_reb...@yahoo.com> wrote:

From: Elwin Estle <chrysalis_reb...@yahoo.com>
Subject: [Tutor] tkinter, create widgets during runtime?
To: tutor@python.org
Date: Wednesday, January 26, 2011, 12:21 PM

With Tcl/Tk, you can generate widgets "on the fly" during program execution, 
without having to explicitly create them in your code.  i.e., something like:

for {set i 0} {$i <= 5} {incr i} {
    label .myLabel_$i -text "this is label myLabel_$i"
    pack .myLabel_$i
}

...which will generate five labels from "myLabel_0" to "myLabel_5".

Useful if you need a varying number of widgets, or a series of "incremental" 
widgets.

Is there a way to do something like this in Tkinter?  Or am I correct in 
guessing that if it is not possible, it is probably more complicated than the 
above?






      
-----Inline Attachment Follows-----

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to