Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

horizontal line in tkinter????

0 views
Skip to first unread message

jub...@zipmail.com.br

unread,
Jul 15, 2002, 4:18:40 PM7/15/02
to
I want a horizontal line to separate the frames
in my tkinter aplication, how can i insert it????

Juliano Freitas
www.gebrasil.hpg.com.br

------------------------------------------
Use o melhor sistema de busca da Internet
Radar UOL - http://www.radaruol.com.br

Matthew Dixon Cowles

unread,
Jul 15, 2002, 4:29:23 PM7/15/02
to
On Mon, 15 Jul 2002 17:18:40 -0300, jub...@zipmail.com.br
<jub...@zipmail.com.br> wrote:

> I want a horizontal line to separate the frames in my tkinter
> aplication, how can i insert it????

Use a frame that's one dot tall:

>>> from Tkinter import *
>>> r=Tk()
>>> f=Frame(r,height=20,width=50,bg="green")
>>> f.pack()
>>> f=Frame(r,height=1,width=50,bg="black")
>>> f.pack()
>>> f=Frame(r,height=20,width=50,bg="yellow")
>>> f.pack()

Regards,
Matt

jep...@unpythonic.net

unread,
Jul 15, 2002, 6:45:53 PM7/15/02
to
Another poster suggests using a frame which is 1 pixel tall and black.

The following looks a little more like a <HR> in HTML. A height of 2 gives
a pixel for the lighter color and for the darker color, and the padx/pady
leaves a gap on all sides in the color of the enclosing frame or toplevel.

I just translated this from some experimentation in wish, so the code is
only probably right...

def Separator(master):
return Frame(relief=ridge, height=2, bg="white")

def PackedSeparator(master, **pack_kw):
f = Separator(master)
f.pack(padx=5, pady=5, **pack_kw)
return f

def GriddedSeparator(master, **grid_kw):
f = Separator(master)
f.grid(padx=5, pady=5, **pack_kw)
return f

Jeff


0 new messages