Title: Signature.html
As I understand it, there are three geometry managers: Grids, Pack and Place. Only the first two are of interest.

Is it possible to mix them? I don't think so, but maybe I'm missing something. Generally, they seem to apply with respect to a Frame, so I would think only one geometry can be used in a Frame. However, if one is used for frameA and another for frameB, can they both be used with in a parent frame, which has its own geometry (grid or pack)?

Suppose I want a parent frame to have a title and below it a 2 column grid with say a Label and Entry. I put the latter in a frame combo in a frame, and attach it to the parent. Do I need to put the title/label in a frame and do the same? Let' see if the following code clarifies this.

First, the resulting dialog looks like this:

-------------------------------------------------------
        Geographic Location
    Latitude:BOXLongitude:BOX
 Zenith x:Zenithy:BOXZenith Pixel Position

           OK   Cancel   <- Std buttons
---------------------------------------------------------
BOX = a rectangle for data entry. There's very little separation between labels and entries. Title labels are in bold.

Stuff is kind of jammed together, the "Zenith Pixel Position" title should be one line up. My guess is that I need to use the weight concept available with Grid, columnconfigure and rowconfigure to justify and open up the data entry rows. Perhaps there's a geometry tutor somewhere on the web. Bits and pieces of this stuff is scattered around the web.

=======================Start==========
# Location/Misc Dialog Prototype
from   Tkinter import *
from   tkSimpleDialog import Dialog
import tkSimpleDialog
import tkMessageBox

class DialogPrototype(Dialog):

    def body(self, master):

        # Titles
        fLocationTitle = Frame(master)  # fL... for frame
        fLocationTitle.pack()

        # Sub entries
        fCoords = Frame(master)
        fCoords.pack(side=TOP)
        fZenith = Frame(master)
        fZenith.pack(side=LEFT)
       
        self.title("Enter Site/Misc. Data")

        # Latitude and Longitude
        Label(fLocationTitle, text="Geographic Location").grid(row=0,column=0)

        Label(fCoords, text='Latitude:').grid(row=0, sticky=W)
        self.lat = Entry(fCoords, width=12)
        self.lat.grid(row=0, column=1)
       
        Label(fCoords, text='Longitude:').grid(row=0, column=2)
        self.long = Entry(fCoords, width=12)
        self.long.grid(row=0, column=3)
   
        # Zenith pixels
        fZenithTitle = Frame(master)
        fZenithTitle.pack(side=TOP)
        Label(fZenithTitle, text="Zenith Pixel Position").grid(row=0,column=0)
        Label(fZenith, text='Zenith x:').grid(row=0, sticky=W)
        self.zenith_x = Entry(fZenith, width=6)
        self.zenith_x.grid(row=0, column=1)

        Label(fZenith, text='Zenith y:').grid(row=0, column=2)
        self.zenith_y = Entry(fZenith, width=6)
        self.zenith_y.grid(row=0, column=3)

        return
========end==============
--
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)


                Life is one damn thing after another."
                     -- Mark Twain 
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to