Radio button in a group : RadioButton « GUI Tk « Python

Home
Python
1.2D
2.Application
3.Buildin Function
4.Class
5.Data Structure
6.Data Type
7.Database
8.Development
9.Dictionary
10.Event
11.Exception
12.File
13.Function
14.GUI Pmw
15.GUI Tk
16.Language Basics
17.List
18.Math
19.Network
20.String
21.System
22.Thread
23.Tuple
24.Utility
25.XML
Python » GUI Tk » RadioButtonScreenshots 
Radio button in a group
Radio button in a group

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', variable=v,
                    value=3).pack(side=RIGHT, anchor=W)
        Radiobutton(iframe1, text='Dio', variable=v,
                    value=2).pack(side=RIGHT, anchor=W)
        Radiobutton(iframe1, text='Ra', variable=v,
                    value=1).pack(side=RIGHT, anchor=W)
        iframe1.pack(expand=1, fill=X, pady=10, padx=5)


    
root = Tk()
#root.option_add('*font', ('verdana', 10'bold'))
all = AllTkinterWidgets(root)
root.title('Tkinter Widgets')
root.mainloop()
           
       
Related examples in the same category
1.Radio Button DemoRadio Button Demo
2.Toogle group Radio ButtonToogle group Radio Button
3.Radio Button MenuRadio Button Menu
4.Radio button bar: get selected button for a group radio buttonRadio button bar: get selected button for a group radio button
5.Get Radio button stateGet Radio button state
6.Hold on to your radio variables Hold on to your radio variables
7.Save Radio button statesSave Radio button states
8.What happens when some buttons have same valueWhat happens when some buttons have same value
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.