Beispiel #1
0
    def body(self, master):
        master.pack_configure(fill=BOTH, expand=YES)
        self.option_add("*authprompt.text", "Welcome to system", 60)
        self.option_add("*authlogin.text", "Login", 60)
        self.option_add("*authpasswd.text", "Password", 60)

        l = Label(master, name="authprompt")
        l.grid(row=0, column=0, columnspan=2)

        l = Label(master, name="authlogin")
        l.grid(row=1, column=0, sticky=NE, ipadx=10, pady=10)

        self.logv = StringVar()
        self.loginedt = Entry(master, textvariable=self.logv)
        self.loginedt.grid(row=1, column=1, sticky=NW, pady=10)

        l = Label(master, name="authpasswd")
        l.grid(row=2, column=0, sticky=NE, ipadx=10, pady=10)

        self.passv = StringVar()
        self.passwdedt = Entry(master, textvariable=self.passv, show='*')
        self.passwdedt.grid(row=2, column=1, sticky=NW, pady=10)

        tkutils.set_stretchable_grid(master, 2, 3)

        tkutils.set_relsize(self, "screen", .3, .2)
        return self.loginedt
Beispiel #2
0
    def body(self, master):
        master.configure(relief=RAISED, bd=1)
        master.pack_configure(fill=BOTH, expand=YES)

        # grid for headers
        self.hfr = Frame(master)
        self.hfr.pack(fill=X)
        self.h1 = Label(self.hfr, justify=LEFT, text=self._h[0], relief=RAISED)
        self.h2 = Label(self.hfr, justify=LEFT, text=self._h[1], relief=RAISED)
        self.h1.grid(column=0, row=0, sticky=N+W+E)
        self.h2.grid(column=1, row=0, sticky=N+W+E)
        tkutils.set_stretchable_grid(self.hfr, 2, 1)

        self.st = Tix.ScrolledText(master, height=5)
        tkutils.set_relsize(self, "screen", .4, .6)
        self.st.pack(padx=5, pady=5, fill=BOTH, expand=YES)
        # and after set size...
        self.update_idletasks() # to update size of widgets
        self.st.text.config(font="Arial 9", wrap=NONE, spacing3=10, state=DISABLED)
        return self.st.text