Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77335

Re: Sequencing images using tkinter?

Subject Re: Sequencing images using tkinter?
References <dcff98af-47cd-4dbc-9fa1-02dc6813df81@googlegroups.com> <f91837e5-2905-4e4a-b174-159f945de11d@googlegroups.com>
Date 2014-08-30 22:49 +0200
From "Albert Visser" <albert.visser@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.13653.1409433077.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, 30 Aug 2014 22:27:01 +0200, <theteacher.info@gmail.com> wrote:

> Although getting next_image to run for e.g. 10 times in a for loop is  
> still something I can't get to work. It only displays one image.

I think this is because you do all your processing befoe starting the  
event loop (myGui.mainloop() ).

A better way is to bind the function that displays the images to a button  
callback.
Referring to your first post, that could be something like (untested)

def rotate():
     for i in range(10):
         myImage = PhotoImage(file="MonsterImages/Converted/" +  
random.choice(monsters))
         myButton1.config(image=myImage, width="100", height="200")
         sleep(0.2)

myButton1=Button(canvas1, text='OK', justify = LEFT, command=rotate)
myButton1.place(x=500,y=300)

myGui.mainloop()

Hope this helps
-- 
Vriendelijke groeten / Kind regards,

Albert Visser

Using Opera's mail client: http://www.opera.com/mail/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 08:54 -0700
  Re: Sequencing images using tkinter? Terry Reedy <tjreedy@udel.edu> - 2014-08-30 15:52 -0400
  Re: Sequencing images using tkinter? Peter Otten <__peter__@web.de> - 2014-08-30 21:54 +0200
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:11 -0700
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:27 -0700
    Re: Sequencing images using tkinter? "Albert Visser" <albert.visser@gmail.com> - 2014-08-30 22:49 +0200
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:37 -0700
    Re: Sequencing images using tkinter? Peter Otten <__peter__@web.de> - 2014-08-30 23:14 +0200
      Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-31 02:51 -0700

csiph-web