"Wayne Watson" <sierra_mtnv...@sbcglobal.net> wrote

I'm using Grid. It's gone pretty well, but I'd like to make it "prettier".

For that Frame is usually your friend. Create your widgets inside
frames and then pack or grid the Frames. You can then use a
combination of padding, filling and anchoring etc in both way
you insert the widgets into the Frame and the way you insert
the Frame into the window.

Personally I find drawing it out with pencil and paper helps a
lot when layouts start to get complicated.

For example, a row with latitude and longitude gets spread
across the dialog, whereas, they should be closer together.

If you put them both in a Frame and then put the frame into
one of yourgrid cells they will both be together on one side.

However, at the moment, I'm trying to build a title across
row 8. I want some centering of the text, but the methods

Use a Frame to hold the label then use pack to put the label
centred in the Frame. Then grid the frame into your window
spanning cells as needed. Frames are your friend for layout.

To be honest I usually use the packer for the layout of my top
window then use grid inside a Frame. I can then create smaller
frames to insert into the grid.

Don't forget that when creating subframes the subframe
should be used as the parent of the widgets:

fCoords = Frame(self.master) # the subframe as child of the main window
eLat = Entry(fCoords,.....)    # use subframe as parent
eLat.grid(row=0, col=0) # grid it within the subframe so reset counts to 0
eLong = Entry(fCoords,.....)  # and here
eLong.grid(row = 0, col=1)
fCoords.grid(row = current, col = whatever)


HTH,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to