Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Peter Otten
Emeka wrote:

> for i,cha in enumerate(wordi):
> 
> label = Label(root,  image=photoimage, text = cha)
> label.grid(row=1, column=i, columnspan=1, rowspan=1,sticky=W+E+N+S,
> padx=0, pady=1)
> label1 = Label(root,  image=IMAGE)
> 
> I used grid ... Though I used labels, I was dealing only on character
> level.
> So for word like "JAVA" . I will have  a row with four cells and each
> filled with the individual character so that I could manipulate them
> individually.
> 
> Now, if I late have "ORACLE" in level 2.. I would want to use to write it
> in the same row as above however with six cells.

Keep the labels in a list and ensure that there are enough labels (the list 
is long enough) before you configure them to show the characters. 

Use the grid_forget() method to hide extra labels if the current word is 
shorter than a previous one.

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


Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Emeka
for i,cha in enumerate(wordi):

label = Label(root,  image=photoimage, text = cha)
label.grid(row=1, column=i, columnspan=1, rowspan=1,sticky=W+E+N+S,
padx=0, pady=1)
label1 = Label(root,  image=IMAGE)

I used grid ... Though I used labels, I was dealing only on character level.
So for word like "JAVA" . I will have  a row with four cells and each filled
with the individual character so that I could manipulate them individually.

Now, if I late have "ORACLE" in level 2.. I would want to use to write it in
the same row as above however with six cells.

I will check the link you posted




On Sun, Jul 24, 2011 at 8:00 AM, Corey Richardson  wrote:

> Excerpts from Emeka's message of Sun Jul 24 02:56:02 -0400 2011:
> > Hello All,
> >
> > I am putting up a simple game .. the game is about manipulation. If the
> gets
> > through level one ... I have to change the word with another...
> >
> > Am I going to destroy level window and build level 2 or is there a way to
> > just adjust the word (I used labels)
> >
>
> When working with tkinter, http://effbot.org/tkinterbook/ will likely be
> your
> best friend. Specifically, you're going to want
>
> your_label1.config(text="New word!")
> your_label2.config(text="Another!")
> --
> Corey Richardson
>  "Those who deny freedom to others, deserve it not for themselves"
> -- Abraham Lincoln
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
*Satajanus  Nig. Ltd


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


Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Corey Richardson
Excerpts from Emeka's message of Sun Jul 24 02:56:02 -0400 2011:
> Hello All,
> 
> I am putting up a simple game .. the game is about manipulation. If the gets
> through level one ... I have to change the word with another...
> 
> Am I going to destroy level window and build level 2 or is there a way to
> just adjust the word (I used labels)
> 

When working with tkinter, http://effbot.org/tkinterbook/ will likely be your
best friend. Specifically, you're going to want 

your_label1.config(text="New word!")
your_label2.config(text="Another!")
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
 -- Abraham Lincoln


signature.asc
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor