[Tutor] Clock in tkinter?
Mic
o0MB0o at hotmail.se
Thu Nov 17 15:57:17 CET 2011
From: Wayne Werner
Sent: Wednesday, November 16, 2011 8:38 PM
To: Mic
Cc: tutor at python.org
Subject: Re: [Tutor] Clock in tkinter?
On Wed, Nov 16, 2011 at 11:44 AM, Mic <o0MB0o at hotmail.se> wrote:
I wonder if you have any suggestions regarding how to place widgets in my window.
Even though I try to arrange them as orderly as possible they get placed at all different kind of places in the window.
I use the grid method and place them in the window by using row=something and column=something.
It just doesn’t look good. It looks okay I suppose, but not as good as I want it to look.
http://twitpic.com/2t4n9q/full
http://twitpic.com/2t4n9p/full
Those images might help you understand a little bit more about the grid layout.
So if I got it right. Inside the constructor (__init__) I should declare:
self.the_time=’’
Then, if I understood it right, I should also place the function call there?
self.update_time() as you refered to?
Your constructor should look something like this:
def __init__(self):
#Your call to super
self.the_time = ''
# your other code
self.update_time()
I don't know for sure that it will work, but I expect that it will.
HTH,
Wayne
Okay, to begin with, I hope I am replying correctly now.
I will work to get my code into the constructor instead of
having them in the global scope.
Thanks for the pictures, I have now manged to organize the
widgets in a much better way.
I wonder, how do I add a background picture to my GUI window?
So far, I thought I could make a label that is as large as the
entire window, and then add a picture to it. The other widgets
are supposed to be placed on top of the picture.
But I am lost on how to accomplish this. Can you point me in the
right direction to solve this?
Mic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111117/2fe2fdc7/attachment.html>
More information about the Tutor
mailing list