1 Jul 2006 05:31
1 Jul 2006 15:19
3 Jul 2006 16:24
grid sticky problem
Olivier Feys <olivier.feys <at> gmail.com>
2006-07-03 14:24:43 GMT
2006-07-03 14:24:43 GMT
I'm trying to add frames in a master frame with the grid manager, and it seems that the option 'sticky' doesn't work as it should When I change the size of the master frame, the subframes don't want to be resized like expand =1 , fill = 'both' for pack layout manager Thanks for help import Tkinter as tk root = tk.Tk() frames= [] rw = 0 col=0 fr = tk.Frame(root,borderwidth =1,relief = 'groove');frames+=[fr] fr.grid(row=rw,column=col,sticky='nswe') tk.Button(fr,text='button (%d,%d)'%(rw,col)).pack(padx=10,pady=10) col+=1 fr = tk.Frame(root,borderwidth =1,relief = 'groove');frames+=[fr] fr.grid(row=rw,column=col,sticky='wens') tk.Button(fr,text='button (%d,%d)'%(rw,col)).pack(padx=10,pady=10) rw+=1 col=0 fr = tk.Frame(root,borderwidth =1,relief = 'groove');frames+=[fr] fr.grid(row=rw,column=col,sticky='wens') tk.Button(fr,text='button (%d,%d)'%(rw,col)).pack(padx=10,pady=10) col+=1 fr = tk.Frame(root,borderwidth =1,relief = 'groove');frames+=[fr] fr.grid(row=rw,column=col,sticky='wens') tk.Button(fr,text='button (%d,%d)'%(rw,col)).pack(padx=10,pady=10) col+=1 rw+=1(Continue reading)
3 Jul 2006 17:22
Re: Canvas pixels
Cameron Laird <Cameron <at> phaseit.net>
2006-07-03 15:22:13 GMT
2006-07-03 15:22:13 GMT
On Sat, Jul 01, 2006 at 08:19:29AM -0500, Jeff Epler wrote: . . . > > is there a way to get the RGB color, pixel by pixel, of a tkinter.Canvas? > > No, tk doesn't provide a way to do this. . . . True. This annoyed me so much, though, that I researched it a tiny bit more. The Img extension, as it happens, can snapshot a canvas into a photo, and Tkinter itself can report on the pixel values in a photo image. That's as good as it gets, apparently. What I don't know is whether Tkinter supports Img at all; I must confess that I'm only aware of its availability for Tcl/Tk.
3 Jul 2006 22:04
3 Jul 2006 23:37
Re: Canvas pixels
Michael Lange <klappnase <at> web.de>
2006-07-03 21:37:57 GMT
2006-07-03 21:37:57 GMT
On Mon, 3 Jul 2006 15:22:13 +0000 Cameron Laird <Cameron <at> phaseit.net> wrote: > On Sat, Jul 01, 2006 at 08:19:29AM -0500, Jeff Epler wrote: > . > . > . > > > is there a way to get the RGB color, pixel by pixel, of a tkinter.Canvas? > > > > No, tk doesn't provide a way to do this. > . > . > . > True. > > This annoyed me so much, though, that I researched it a tiny > bit more. The Img extension, as it happens, can snapshot a > canvas into a photo, and Tkinter itself can report on the > pixel values in a photo image. > > That's as good as it gets, apparently. What I don't know is > whether Tkinter supports Img at all; I must confess that I'm > only aware of its availability for Tcl/Tk. Do you mean the tkImg library from <http://sourceforge.net/projects/tkimg/> ? If so, I have used it successfully by just adding a line root.tk.call('package', 'require', 'Img') (where root of course is my Tk() window).(Continue reading)
4 Jul 2006 05:12
simple script -Tkinter question.
jkuo <jkuo22 <at> yahoo.com.tw>
2006-07-04 03:12:45 GMT
2006-07-04 03:12:45 GMT
Hi everyone,
Here is my simple Tkinter script:
## start of entry.py
from Tkinter import *
root=Tk()
e1=Entry(root, width=16)
e1.pack()
e2=Entry(root, width=16)
e2.pack()
mainloop()
## end
from Tkinter import *
root=Tk()
e1=Entry(root, width=16)
e1.pack()
e2=Entry(root, width=16)
e2.pack()
mainloop()
## end
First, it works on win2k. When I run it as 'python entry.py' on linux,
both 'e1' and 'e2' appear perfectly except I cannot enter any
character in 'e1' entry, but 'e2' entry is ok.
both 'e1' and 'e2' appear perfectly except I cannot enter any
character in 'e1' entry, but 'e2' entry is ok.
Second, when I run it in python interactive shell LINE BY LINE, then
'e1' and 'e2' entry both can accept user input, no problem! But when I
copy and paste it into interactive shell, then the first situation
happens again.
'e1' and 'e2' entry both can accept user input, no problem! But when I
copy and paste it into interactive shell, then the first situation
happens again.
So..., has anyone ever run into this problem like me? and how do you
fix it? I use python2.3.4 now.
Thank you!
fix it? I use python2.3.4 now.
Thank you!
jkuo
___________________________________________________
最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打!
http://messenger.yahoo.com.tw/
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss <at> python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
4 Jul 2006 09:48
Re: simple script -Tkinter question.
<mkieverpy <at> tlink.de>
2006-07-04 07:48:44 GMT
2006-07-04 07:48:44 GMT
Hi jkuo! >Hi everyone, >Here is my simple Tkinter script: >## start of entry.py >from Tkinter import * >root=Tk() >e1=Entry(root, width=16) >e1.pack() >e2=Entry(root, width=16) >e2.pack() >mainloop() >## end You should call 'root.mainloop()'! Just mainloop() is the mainloop of Tcl, not Tk. I don't know what the effects of this might be. On Linux everything seems to work, nonetheless. Hope this helps, Matthias Kievernagel mkiever/at/web/dot/de software development
4 Jul 2006 11:54
Fwd: Re: simple script -Tkinter question.
jkuo <jkuo22 <at> yahoo.com.tw>
2006-07-04 09:54:22 GMT
2006-07-04 09:54:22 GMT
注意:轉寄信件已夾帶
___________________________________________________
最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打!
http://messenger.yahoo.com.tw/
From: jkuo <jkuo22 <at> yahoo.com.tw>
Subject: Re: [Tkinter-discuss] simple script -Tkinter question.
Date: 2006-07-04 09:52:40 GMT
Subject: Re: [Tkinter-discuss] simple script -Tkinter question.
Date: 2006-07-04 09:52:40 GMT
Hello mkieverpy!
I've also tried to call 'root.mainloop()', but it appeared the same.
I've once suspected that it might be the os, x window issue..., but as
I mentioned: it works by running the script line by line in python interactive shell,
It just doesn't work no matter I run it as 'python entry.py' or copy and paste into
python's interactive shell, very weired.
BR.
mkieverpy <at> tlink.de 說:
mkieverpy <at> tlink.de 說:
Hi jkuo!
>Hi everyone,
>Here is my simple Tkinter script:
>## start of entry.py
>from Tkinter import *
>root=Tk()
>e1=Entry(root, width=16)
>e1.pack()
>e2=Entry(root, width=16)
>e2.pack()
>mainloop()
>## end
You should call 'root.mainloop()'!
Just mainloop() is the mainloop of Tcl, not Tk.
I don't know what the effects of this might be.
On Linux everything seems to work, nonetheless.
Hope this helps,
Matthias Kievernagel
mkiever/at/web/dot/de
software development
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
___________________________________________________
最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打!
http://messenger.yahoo.com.tw/
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss <at> python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
4 Jul 2006 11:59
Re: simple script -Tkinter question.
Michael Lange <klappnase <at> web.de>
2006-07-04 09:59:10 GMT
2006-07-04 09:59:10 GMT
On Tue, 4 Jul 2006 09:48:44 +0200
mkieverpy <at> tlink.de wrote:
> Hi jkuo!
>
> >Hi everyone,
> >Here is my simple Tkinter script:
>
> >## start of entry.py
> >from Tkinter import *
> >root=Tk()
> >e1=Entry(root, width=16)
> >e1.pack()
> >e2=Entry(root, width=16)
> >e2.pack()
> >mainloop()
> >## end
>
> You should call 'root.mainloop()'!
> Just mainloop() is the mainloop of Tcl, not Tk.
> I don't know what the effects of this might be.
> On Linux everything seems to work, nonetheless.
>
Really? From Tkinter.py it looks to me like it should be equivalent:
def mainloop(n=0):
"""Run the main loop of Tcl."""
_default_root.tk.mainloop(n)
(...snip...)
class Tk(Misc, Wm):
"""Toplevel widget of Tk which represents mostly the main window
of an appliation. It has an associated Tcl interpreter."""
_w = '.'
def __init__(self, screenName=None, baseName=None, className='Tk'):
global _default_root
(...snip...)
if _support_default_root and not _default_root:
_default_root = self
so _default_root is the Tk() instance. Unfortunately this does not explain what is going wrong in the example.
Michael
RSS Feed