本文整理匯總了Python中tkinter.Checkbutton.toggle方法的典型用法代碼示例。如果您正苦於以下問題:Python Checkbutton.toggle方法的具體用法?Python Checkbutton.toggle怎麽用?Python Checkbutton.toggle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tkinter.Checkbutton
的用法示例。
在下文中一共展示了Checkbutton.toggle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sideWindow
# 需要導入模塊: from tkinter import Checkbutton [as 別名]
# 或者: from tkinter.Checkbutton import toggle [as 別名]
class sideWindow(AppShell):
#################################################################
# sideWindow(AppShell)
# This class will open a side window wich contains a scene graph and
# a world setting page.
#################################################################
appversion = '1.0'
appname = 'Navigation Window'
frameWidth = 325
frameHeight = 580
frameIniPosX = 0
frameIniPosY = 110
padx = 0
pady = 0
lightEnable = 0
ParticleEnable = 0
basedriveEnable = 0
collision = 0
backface = 0
texture = 1
wireframe = 0
enableBaseUseDrive = 0
def __init__(self, worldColor,lightEnable,ParticleEnable, basedriveEnable,collision,
backface, texture, wireframe, grid, widgetVis, enableAutoCamera, parent = None, nodePath = render, **kw):
self.worldColor = worldColor
self.lightEnable = lightEnable
self.ParticleEnable = ParticleEnable
self.basedriveEnable = basedriveEnable
self.collision = collision
self.backface = backface
self.texture = texture
self.wireframe = wireframe
self.grid = grid
self.enableAutoCamera = enableAutoCamera
self.widgetVis = widgetVis
# Define the megawidget options.
optiondefs = (
('title', self.appname, None),
)
self.defineoptions(kw, optiondefs)
if parent == None:
self.parent = Toplevel()
else:
self.parent = parent
AppShell.__init__(self, self.parent)
self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
def appInit(self):
print('----SideWindow is Initialized!!')
def createInterface(self):
# The interior of the toplevel panel
interior = self.interior()
mainFrame = Frame(interior)
## Creat NoteBook
self.notebookFrame = Pmw.NoteBook(mainFrame)
self.notebookFrame.pack(fill=tkinter.BOTH,expand=1)
sgePage = self.notebookFrame.add('Tree Graph')
envPage = self.notebookFrame.add('World Setting')
self.notebookFrame['raisecommand'] = self.updateInfo
## Tree Grapgh Page
self.SGE = seSceneGraphExplorer.seSceneGraphExplorer(
sgePage, nodePath = render,
scrolledCanvas_hull_width = 270,
scrolledCanvas_hull_height = 570)
self.SGE.pack(fill = tkinter.BOTH, expand = 0)
## World Setting Page
envPage = Frame(envPage)
pageFrame = Frame(envPage)
self.LightingVar = IntVar()
self.LightingVar.set(self.lightEnable)
self.LightingButton = Checkbutton(
pageFrame,
text = 'Enable Lighting',
variable = self.LightingVar,
command = self.toggleLights)
self.LightingButton.pack(side=tkinter.LEFT, expand=False)
pageFrame.pack(side=tkinter.TOP, fill=tkinter.X, expand=True)
pageFrame = Frame(envPage)
self.CollisionVar = IntVar()
self.CollisionVar.set(self.collision)
self.CollisionButton = Checkbutton(
pageFrame,
text = 'Show Collision Object',
variable = self.CollisionVar,
command = self.showCollision)
self.CollisionButton.pack(side=tkinter.LEFT, expand=False)
pageFrame.pack(side=tkinter.TOP, fill=tkinter.X, expand=True)
#.........這裏部分代碼省略.........