本文整理汇总了Python中fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar.grid方法的典型用法代码示例。如果您正苦于以下问题:Python HiddenScrollbar.grid方法的具体用法?Python HiddenScrollbar.grid怎么用?Python HiddenScrollbar.grid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar
的用法示例。
在下文中一共展示了HiddenScrollbar.grid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addToDialog
# 需要导入模块: from fabmetheus_utilities.hidden_scrollbar import HiddenScrollbar [as 别名]
# 或者: from fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar import grid [as 别名]
def addToDialog( self, gridPosition ):
"Add this to the dialog."
#http://www.pythonware.com/library/tkinter/introduction/x5453-patterns.htm
self.root = gridPosition.master
gridPosition.increment()
scrollbar = HiddenScrollbar( gridPosition.master )
self.listbox = settings.Tkinter.Listbox( gridPosition.master, selectmode = settings.Tkinter.SINGLE, yscrollcommand = scrollbar.set )
self.listbox.bind( '<ButtonRelease-1>', self.buttonReleaseOne )
gridPosition.master.bind( '<FocusIn>', self.focusIn )
scrollbar.config( command = self.listbox.yview )
self.listbox.grid( row = gridPosition.row, column = 0, sticky = settings.Tkinter.N + settings.Tkinter.S )
scrollbar.grid( row = gridPosition.row, column = 1, sticky = settings.Tkinter.N + settings.Tkinter.S )
self.setStateToValue()
self.repository.saveListenerTable[ 'updateProfileSaveListeners' ] = updateProfileSaveListeners
示例2: activateMouseModeTool
# 需要导入模块: from fabmetheus_utilities.hidden_scrollbar import HiddenScrollbar [as 别名]
# 或者: from fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar import grid [as 别名]
class TableauWindow:
def activateMouseModeTool(self):
"Activate the mouse mode tool."
self.repository.setToDisplaySave()
self.canvas.focus_set()
self.createMouseModeTool()
self.mouseTool.update()
def addCanvasMenuRootScrollSkein(self, repository, skein, suffix, title):
"Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein."
self.imagesDirectoryPath = settings.getPathInFabmetheus(os.path.join("fabmetheus_utilities", "images"))
self.movementTextID = None
self.mouseInstantButtons = []
self.photoImages = {}
self.repository = repository
self.root = settings.Tkinter.Tk()
self.gridPosition = settings.GridVertical(0, 1)
self.gridPosition.master = self.root
self.root.title(os.path.basename(skein.fileName) + " - " + title)
self.rulingExtent = 24
self.rulingTargetSeparation = 150.0
self.screenSize = skein.screenSize
self.skein = skein
self.skeinPanes = skein.skeinPanes
self.suffix = suffix
self.timerID = None
repository.animationSlideShowRate.value = max(repository.animationSlideShowRate.value, 0.01)
repository.animationSlideShowRate.value = min(repository.animationSlideShowRate.value, 85.0)
repository.drawArrows.setUpdateFunction(self.setWindowToDisplaySaveUpdate)
repository.goAroundExtruderOffTravel.setUpdateFunction(self.setWindowToDisplaySavePhoenixUpdate)
repository.layerExtraSpan.setUpdateFunction(self.setWindowToDisplaySaveUpdate)
repository.widthOfSelectionThread.setUpdateFunction(self.setWindowToDisplaySaveUpdate)
repository.widthOfTravelThread.setUpdateFunction(self.setWindowToDisplaySaveUpdate)
repository.window = self
for menuRadio in repository.mouseMode.menuRadios:
fileName = menuRadio.name.lower()
fileName = fileName.replace(" ", "_") + ".ppm"
menuRadio.mouseButton = self.getPhotoButtonGridIncrement(menuRadio.invoke, fileName, self.gridPosition)
self.gridPosition = settings.GridHorizontal(1, 99)
self.gridPosition.master = self.root
self.xScrollbar = HiddenScrollbar(self.root, orient=settings.Tkinter.HORIZONTAL)
self.xScrollbar.grid(row=98, column=2, columnspan=96, sticky=settings.Tkinter.E + settings.Tkinter.W)
self.yScrollbar = HiddenScrollbar(self.root)
self.yScrollbar.grid(row=1, rowspan=97, column=99, sticky=settings.Tkinter.N + settings.Tkinter.S)
self.canvasHeight = min(
int(skein.screenSize.imag), self.root.winfo_screenheight() - repository.screenVerticalInset.value
)
self.canvasWidth = min(
int(skein.screenSize.real), self.root.winfo_screenwidth() - repository.screenHorizontalInset.value
)
scrollRegionBoundingBox = (0, 0, int(skein.screenSize.real), int(skein.screenSize.imag))
self.canvas = settings.Tkinter.Canvas(
self.root,
highlightthickness=3,
width=self.canvasWidth,
height=self.canvasHeight,
scrollregion=scrollRegionBoundingBox,
)
self.canvas.grid(
row=1,
rowspan=97,
column=2,
columnspan=96,
sticky=settings.Tkinter.E + settings.Tkinter.W + settings.Tkinter.N + settings.Tkinter.S,
)
self.fileHelpMenuBar = settings.FileHelpMenuBar(self.root)
self.exportMenu = settings.Tkinter.Menu(self.fileHelpMenuBar.fileMenu, tearoff=0)
self.fileHelpMenuBar.fileMenu.add_cascade(label="Export", menu=self.exportMenu, underline=0)
exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath(os.path.dirname(__file__), "export_canvas_plugins")
exportCanvasPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath(exportCanvasPluginsFolderPath)
for exportCanvasPluginFileName in exportCanvasPluginFileNames:
ExportCanvasDialog().addPluginToMenu(
self.canvas, skein.fileName, self.exportMenu, exportCanvasPluginFileName, suffix
)
self.fileHelpMenuBar.fileMenu.add_separator()
self.fileHelpMenuBar.completeMenu(self.close, repository, self.save, self)
def addLayer(self, gridPosition):
"Add the layer frame items."
self.diveButton = self.getPhotoButtonGridIncrement(self.dive, "dive.ppm", gridPosition)
self.soarButton = self.getPhotoButtonGridIncrement(self.soar, "soar.ppm", gridPosition)
gridPosition.increment()
settings.Tkinter.Label(gridPosition.master, text="Layer:").grid(
row=gridPosition.row, column=gridPosition.column, sticky=settings.Tkinter.W
)
gridPosition.increment()
self.limitIndex()
self.layerEntry = settings.Tkinter.Spinbox(
gridPosition.master,
command=self.layerEntryReturnPressed,
from_=0,
increment=1,
to=getLengthMinusOneMinimumOne(self.skeinPanes),
)
self.layerEntry.bind("<Return>", self.layerEntryReturnPressed)
self.layerEntry.grid(row=gridPosition.row, column=gridPosition.column, sticky=settings.Tkinter.W)
def addLine(self, gridPosition):
"Add the line frame items."
self.lineDiveButton = self.getPhotoButtonGridIncrement(self.lineDive, "dive.ppm", gridPosition)
#.........这里部分代码省略.........