当前位置: 首页>>代码示例>>Python>>正文


Python Tkinter.Spinbox方法代码示例

本文整理汇总了Python中Tkinter.Spinbox方法的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.Spinbox方法的具体用法?Python Tkinter.Spinbox怎么用?Python Tkinter.Spinbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tkinter的用法示例。


在下文中一共展示了Tkinter.Spinbox方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _make_slider

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Spinbox [as 别名]
def _make_slider(self, parent, rowidx, label, inival, maxval, res=0.5):
        # Create shared variable and set initial value.
        tkvar = tk.DoubleVar()
        tkvar.set(inival)
        # Set a callback for whenever tkvar is changed.
        # (The 'command' callback on the SpinBox only applies to the buttons.)
        tkvar.trace('w', self._update_callback)
        # Create the Label, SpinBox, and Scale objects.
        label = tk.Label(parent, text=label)
        spbox = tk.Spinbox(parent,
            textvariable=tkvar,
            from_=0, to=maxval, increment=res)
        slide = tk.Scale(parent,
            orient=tk.HORIZONTAL,
            showvalue=0,
            variable=tkvar,
            from_=0, to=maxval, resolution=res)
        label.grid(row=rowidx, column=0)
        spbox.grid(row=rowidx, column=1)
        slide.grid(row=rowidx, column=2)
        return tkvar

    # Find the largest output size that fits within the given bounds and
    # matches the aspect ratio of the original source image. 
开发者ID:ooterness,项目名称:DualFisheye,代码行数:26,代码来源:fisheye.py

示例2: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Spinbox [as 别名]
def __init__(self, parent):
        tk.LabelFrame.__init__(self, parent)
        self.title = tk.Label(self, text='SV Length')

        self.len_GT_On = tk.IntVar(value=0)
        self.len_GT_On_CB = tk.Checkbutton(self, text=">", justify=tk.LEFT, variable=self.len_GT_On)
        self.len_GT_val = tk.Spinbox(self, values=(1,5,10,50,100,500), width=3)
        self.len_GT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)

        self.len_LT_On = tk.IntVar(value=0)
        self.len_LT_On_CB = tk.Checkbutton(self, text="<", justify=tk.LEFT, variable=self.len_LT_On)
        self.len_LT_val = tk.Spinbox(self, values=(1,5,10,50,100,500), width=3)
        self.len_LT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)

        self.title.grid(row=0, column=0, sticky=tk.EW, columnspan=4)
        self.len_GT_On_CB.grid(row=1, column=0, sticky=tk.EW)
        self.len_GT_val.grid(row=2, column=0, sticky=tk.EW)
        self.len_GT_Units.grid(row=2, column=1, sticky=tk.EW)
        self.len_LT_On_CB.grid(row=1, column=2, sticky=tk.EW)
        self.len_LT_val.grid(row=2, column=2, sticky=tk.EW)
        self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW) 
开发者ID:VCCRI,项目名称:SVPV,代码行数:23,代码来源:gui_widgets.py

示例3: create

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Spinbox [as 别名]
def create(self, **kwargs):
        return tkinter.Spinbox(self.root, **kwargs) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:4,代码来源:test_widgets.py

示例4: reset

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Spinbox [as 别名]
def reset(self):
        self.len_GT_On.set(0)
        self.len_LT_On.set(0)
        self.len_GT_val.destroy()
        self.len_GT_Units.destroy()
        self.len_LT_val.destroy()
        self.len_LT_Units.destroy()
        self.len_GT_val = tk.Spinbox(self, values=(1, 5, 10, 50, 100, 500), width=3)
        self.len_GT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
        self.len_LT_val = tk.Spinbox(self, values=(1, 5, 10, 50, 100, 500), width=3)
        self.len_LT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
        self.len_GT_val.grid(row=2, column=0, sticky=tk.EW)
        self.len_GT_Units.grid(row=2, column=1, sticky=tk.EW)
        self.len_LT_val.grid(row=2, column=2, sticky=tk.EW)
        self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW) 
开发者ID:VCCRI,项目名称:SVPV,代码行数:17,代码来源:gui_widgets.py

示例5: setUpClass

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Spinbox [as 别名]
def setUpClass(cls):
        requires('gui')
        cls.root = root = tk.Tk()
        PyShell.fix_x11_paste(root)
        cls.text = tk.Text(root)
        cls.entry = tk.Entry(root)
        cls.spin = tk.Spinbox(root)
        root.clipboard_clear()
        root.clipboard_append('two') 
开发者ID:mchristopher,项目名称:PokemonGo-DesktopMap,代码行数:11,代码来源:test_editmenu.py


注:本文中的Tkinter.Spinbox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。