Esempio n. 1
0
 def body(self, master):
     master.configure(relief=RAISED, bd=1)
     master.pack_configure(fill=BOTH, expand=YES)
     self.shlist = Tix.ScrolledHList(master, name="hlist")
     #self.shlist.hlist["selectmode"] = SINGLE
     self.shlist.hlist["indent"] = 20
     self.shlist.hlist["browsecmd"] = self.__onbrowse
     self.rightfr = Frame(master)
     self.caption = Label(self.rightfr, name="caption")
     self.caption.pack(padx=5, pady=5, anchor=W, fill=X, expand=YES)
     self.hint = Message(self.rightfr, anchor=W, justify=LEFT)
     self.hint.bind("<Configure>", self.__onhintconfigure)
     #self.hint = Label(self.rightfr, justify=LEFT)
     self.hint.pack(padx=5, anchor=W, fill=BOTH, expand=YES)
     self.edfr = Frame(self.rightfr)
     self.edtvar = StringVar()
     self.edttracename = self.edtvar.trace('w', self.__ontrace_edtvar)
     self.edt = Entry(self.edfr, textvariable=self.edtvar)
     #self.edt.pack(padx=5, pady=5, anchor=W, fill=X, expand=YES)
     self.edt.pack(side=LEFT, fill=X, expand=YES)
     self.edtbtnimg = PhotoImage(data=_editor_img)
     self.edtbtn = Button(self.edfr, image=self.edtbtnimg)
     self.edtbtn.pack(side=LEFT, padx=5)
     self.edfr.pack(padx=5, pady=5, anchor=W, fill=X, expand=YES)
     self.validhintvar = StringVar()
     self.validhint = Label(self.rightfr, name="validhint", textvariable=self.validhintvar, justify=LEFT)
     self.validhint.pack(padx=5, side=LEFT)
     self.shlist.place(relx=.01, rely=.01, relwidth=.48, relheight=.98)
     self.rightfr.place(relx=.5, relwidth=.5)
     self.__load_list()
     #self.shlist.hlist.bind("<KeyRelease>", lambda ev: self.edtbtn.event_generate("<Button-1>"))
     tkutils.set_relsize(self, "screen", .5, .5)
     return self.shlist.hlist
Esempio n. 2
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
Esempio n. 3
0
 def body(self, master):
     master.configure(relief=RAISED, bd=1)
     master.pack_configure(fill=BOTH, expand=YES)
     self.hint = Label(master, justify=LEFT, text=self._h)
     self.hint.pack(anchor=W, padx=5, pady=5)
     self.st = Tix.ScrolledText(master, height=5)
     self.st.text["font"] = "Arial 9"
     self.st.text.insert(INSERT, self._t)
     self.st.pack(padx=5, pady=5, fill=BOTH, expand=YES)
     tkutils.set_relsize(self, "screen", .4, .4)
     return self.st.text
Esempio n. 4
0
 def body(self, master):
     master.configure(relief=RAISED, bd=1)
     master.pack_configure(fill=BOTH, expand=YES)
     self.hint = Label(master, justify=LEFT, text=self._h)
     self.hint.pack(anchor=W, padx=5, pady=5)
     self.sb = Spinbox(master, **self.sb)
     # set only AFTER creation of widget
     if self._iv:
         self.v.set(self._iv)
     self.sb.pack(anchor=W, padx=5, pady=5, fill=X)
     tkutils.set_relsize(self, "screen", .2, .2)
     return self.sb
Esempio n. 5
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
Esempio n. 6
0
 def body(self, master):
     master.configure(relief=RAISED, bd=1)
     master.pack_configure(fill=BOTH, expand=YES)
     self.hint = Label(master, justify=LEFT, text=self._h)
     self.hint.pack(anchor=W, padx=5, pady=5)
     self.stl = Tix.ScrolledTList(master)
     self.stl.tlist["selectmode"] = self._sm
     for k,v in self.items.iteritems():
         self.stl.tlist.insert(END, itemtype=Tix.TEXT, text=unicode(v))
     if self.items:
         # if there are items then try to select initialsel items or first
         if self._is:
             for el in self._is.split(','):
                 index = self.items.keys().index(el.strip())
                 if index!=-1:
                     self.stl.tlist.selection_set(index)
         else:
             self.stl.tlist.selection_set(0)
     self.stl.pack(padx=5, pady=5, fill=BOTH, expand=YES)
     tkutils.set_relsize(self, "screen", .3, .4)
     return self.stl.tlist