Set border : Border « GUI Tk « Python






Set border

Set border
from Tkinter import *

class AllTkinterWidgets:
    def __init__(self, master):
        frame = Frame(master, width=500, height=400, bd=1)
        frame.pack()

        iframe1 = Frame(frame, bd=2, relief=SUNKEN)
        Button(iframe1, text='Button').pack(side=LEFT, padx=5)
        Checkbutton(iframe1, text='CheckButton').pack(side=LEFT, padx=5)

        v=IntVar()
        Radiobutton(iframe1, text='Button 1', variable=v,
                    value=3).pack(side=RIGHT, anchor=W)
        Radiobutton(iframe1, text='Button 2', variable=v,
                    value=2).pack(side=RIGHT, anchor=W)
        Radiobutton(iframe1, text='Button 3', variable=v,
                    value=1).pack(side=RIGHT, anchor=W)
        iframe1.pack(expand=1, fill=X, pady=10, padx=5)


    
root = Tk()
all = AllTkinterWidgets(root)
root.title('Tkinter Widgets')
root.mainloop()

           
       








Related examples in the same category

1.Titled BorderTitled Border
2.Label border: RAISED, SUNKEN, FLAT, RIDGE, GROOVE, SOLIDLabel border: RAISED, SUNKEN, FLAT, RIDGE, GROOVE, SOLID
3.Button Border stylesButton Border styles
4.Button BorderButton Border
5.Border for a group of check boxesBorder for a group of check boxes
6.Label with borderLabel with border