Beispiel #1
0
    def PaneWithLabelframe(cls,
                           master,
                           f_name,
                           s_name,
                           orient=Tkconstants.HORIZONTAL):
        '''Sample usage:
            from com.ui import ROOT    
            (frame1, frame2) = Components.PaneWithLabelframe(ROOT, "frame1", "frame2")[1:]
            Window.widg = Widget.Button(frame1,text = "button1")
            Window.Pack()
            
            Window.widg = Widget.Button(frame2,text = "button2")
            Window.Pack()
            ROOT.mainloop()
        '''
        p = Widget.Panedwindow(master, orient=orient)
        l1 = Widget.Labelframe(master, text=f_name)
        l2 = Widget.Labelframe(master, text=s_name)
        p.add(l1)
        p.add(l2)
        Window.widg = p
        Window.Pack(side="top",
                    fill=Tkconstants.BOTH,
                    expand=Tkconstants.YES,
                    pady=2,
                    padx=2)

        return (p, l1, l2)
Beispiel #2
0
        '''
        radios = []
        var = Tkinter.StringVar()
        radio_items = dict(zip(texts, values))
        for text, value in radio_items.items():
            Window.widg = Widget.Radiobutton(master, variable=var)
            Window.Config(text=text, value=value)
            if command:
                Window.Config(command=command)
            Window.Pack(side="top", fill="x", expand="yes", pady=2, anchor="w")
            radios.append(Window.widg)

        if radios:
            return var, radios


if __name__ == "__main__":
    from ui import ROOT
    frame1 = Widget.Labelframe(ROOT, text="XXXX")
    Window.widg = frame1
    Window.Pack(side="top", fill="both", expand="yes", padx="0.2c")

    (t, x, y) = Components.TextWithScrollbar(frame1)
    t.insert(
        "end",
        "0.ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss\n"
    )
    t.insert("end", "1.sdf\n")
    t.insert("end", 1)
    ROOT.mainloop()