Python tkinter.LabelFrame() Examples
The following are 30
code examples of tkinter.LabelFrame().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
tkinter
, or try the search function
.
Example #1
Source File: CInScan02.py From mcculw with MIT License | 6 votes |
def create_widgets(self): '''Create the tkinter UI''' if self.chan_num != -1: self.results_group = tk.LabelFrame( self, text="Results", padx=3, pady=3) self.results_group.pack( fill=tk.X, anchor=tk.NW, padx=3, pady=3) self.data_frame = tk.Frame(self.results_group) self.data_frame.grid() button_frame = tk.Frame(self) button_frame.pack(fill=tk.X, side=tk.RIGHT, anchor=tk.SE) self.start_button = tk.Button(button_frame) self.start_button["text"] = "Start" self.start_button["command"] = self.start self.start_button.grid(row=0, column=0, padx=3, pady=3) quit_button = tk.Button(button_frame) quit_button["text"] = "Quit" quit_button["command"] = self.master.destroy quit_button.grid(row=0, column=1, padx=3, pady=3) else: self.create_unsupported_widgets(self.board_num)
Example #2
Source File: chapter2_05.py From Tkinter-GUI-Application-Development-Cookbook with MIT License | 6 votes |
def __init__(self): super().__init__() group_1 = tk.LabelFrame(self, padx=15, pady=10, text="Personal Information") group_1.pack(padx=10, pady=5) tk.Label(group_1, text="First name").grid(row=0) tk.Label(group_1, text="Last name").grid(row=1) tk.Entry(group_1).grid(row=0, column=1, sticky=tk.W) tk.Entry(group_1).grid(row=1, column=1, sticky=tk.W) group_2 = tk.LabelFrame(self, padx=15, pady=10, text="Address") group_2.pack(padx=10, pady=5) tk.Label(group_2, text="Street").grid(row=0) tk.Label(group_2, text="City").grid(row=1) tk.Label(group_2, text="ZIP Code").grid(row=2) tk.Entry(group_2).grid(row=0, column=1, sticky=tk.W) tk.Entry(group_2).grid(row=1, column=1, sticky=tk.W) tk.Entry(group_2, width=8).grid(row=2, column=1, sticky=tk.W) self.btn_submit = tk.Button(self, text="Submit") self.btn_submit.pack(padx=10, pady=10, side=tk.RIGHT)
Example #3
Source File: chapter8_01.py From Tkinter-GUI-Application-Development-Cookbook with MIT License | 6 votes |
def __init__(self): super().__init__() self.title("Tk themed widgets") var = tk.StringVar() var.set(self.greetings[0]) label_frame = ttk.LabelFrame(self, text="Choose a greeting") for greeting in self.greetings: radio = ttk.Radiobutton(label_frame, text=greeting, variable=var, value=greeting) radio.pack() frame = ttk.Frame(self) label = ttk.Label(frame, text="Enter your name") entry = ttk.Entry(frame) command = lambda: print("{}, {}!".format(var.get(), entry.get())) button = ttk.Button(frame, text="Greet", command=command) label.grid(row=0, column=0, padx=5, pady=5) entry.grid(row=0, column=1, padx=5, pady=5) button.grid(row=1, column=0, columnspan=2, pady=5) label_frame.pack(side=tk.LEFT, padx=10, pady=10) frame.pack(side=tk.LEFT, padx=10, pady=10)
Example #4
Source File: tkXianYu.py From XianyuSdd with MIT License | 6 votes |
def create_page(self): User = tk.LabelFrame(self.window, text="关键字配置", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 User.place(x=50, y=80) tk.Label(User, text="关键字:").grid(column=0, row=0, sticky='w', pady=5, padx=5) # 添加用户账号 tk.Label(User, text="最低价格:").grid(column=0, row=1, sticky='w', pady=5, padx=5) # 添加用户密码 tk.Label(User, text="最高价格:").grid(column=0, row=2, sticky='w', pady=5, padx=5) # 添加用户密码 self.userEntry = tk.Entry(User, textvariable=self.username, width=23) self.userEntry.grid(column=1, row=0, pady=5) self.pwdEntry = tk.Entry(User, textvariable=self.password, width=23) self.pwdEntry.grid(column=1, row=1, pady=5) self.maxPEntry = tk.Entry(User, textvariable=self.maxPrice, width=23) self.maxPEntry.grid(column=1, row=2, pady=5) tk.Button(User, text="确认添加", command=self.add_user).grid(columnspan=2, row=3, pady=5, ipadx=10)
Example #5
Source File: gui_widgets.py From SVPV with MIT License | 6 votes |
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)
Example #6
Source File: gui.py From snn_toolbox with MIT License | 6 votes |
def select_layer_rb(self): """Select layer.""" if hasattr(self, 'layer_frame'): self.layer_frame.pack_forget() self.layer_frame.destroy() self.layer_frame = tk.LabelFrame(self.graph_frame, labelanchor='nw', text="Select layer", relief='raised', borderwidth='3', bg='white') self.layer_frame.pack(side='bottom', fill=None, expand=False) self.plots_dir = os.path.join(self.gui_log.get(), self.selected_plots_dir.get()) if os.path.isdir(self.plots_dir): layer_dirs = [d for d in sorted(os.listdir(self.plots_dir)) if d != 'normalization' and os.path.isdir(os.path.join(self.plots_dir, d))] [tk.Radiobutton(self.layer_frame, bg='white', text=name, value=name, command=self.display_graphs, variable=self.layer_to_plot).pack( fill='both', side='bottom', expand=True) for name in layer_dirs]
Example #7
Source File: recipe-577525.py From code with MIT License | 6 votes |
def __init__(self, master): # Initialize the Frame object. super().__init__(master) # Create every opening widget. self.intro = Label(self, text=self.PROMPT) self.group = LabelFrame(self, text='Filename') self.entry = Entry(self.group, width=35) self.click = Button(self.group, text='Browse ...', command=self.file) self.enter = Button(self, text='Continue', command=self.start) # Make Windows entry bindings. def select_all(event): event.widget.selection_range(0, tkinter.END) return 'break' self.entry.bind('<Control-Key-a>', select_all) self.entry.bind('<Control-Key-/>', lambda event: 'break') # Position them in this frame. options = {'sticky': tkinter.NSEW, 'padx': 5, 'pady': 5} self.intro.grid(row=0, column=0, **options) self.group.grid(row=1, column=0, **options) self.entry.grid(row=0, column=0, **options) self.click.grid(row=0, column=1, **options) self.enter.grid(row=2, column=0, **options)
Example #8
Source File: tkui.py From onmyoji_bot with GNU General Public License v3.0 | 6 votes |
def create_advance(self): ''' 高级菜单 ''' advance = tk.LabelFrame(self.main_frame1, text='高级选项') advance.pack(padx=5, pady=5, fill=tk.X, side=tk.BOTTOM) tk.Checkbutton(advance, text='调试模式', variable=self.debug_enable).pack(anchor=tk.W) tk.Checkbutton(advance, text='超时自动关闭阴阳师', variable=self.watchdog_enable).pack(anchor=tk.W) frame = tk.Frame(advance) frame.pack(anchor=tk.W) tk.Label(frame, text=' 画面超时时间(秒):').grid(row=0, column=0) tk.Entry(frame, textvariable=self.max_win_time, width=5).grid(row=0, column=1) tk.Label(frame, text=' 操作超时时间(秒):').grid(row=1, column=0) tk.Entry(frame, textvariable=self.max_op_time, width=5).grid(row=1, column=1)
Example #9
Source File: voyagerimb.py From voyagerimb with MIT License | 6 votes |
def view_init(self): self.frame = tk.LabelFrame(self.browser.workframe, text=" Image ") self.frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True, padx=7, pady=7) self.figure = plt.figure(figsize=(8, 12), dpi=70) self.ax1 = plt.subplot2grid((50,40), (0, 0), rowspan=40, colspan=40) self.ax2 = plt.subplot2grid((50,40), (42, 0), rowspan=8, colspan=40, sharex=self.ax1) plt.subplots_adjust(left=0.1, bottom=0.05, right=0.95, top=0.97, wspace=0.2, hspace=0.2) self.view_plot_image() self.canvas = FigureCanvasTkAgg(self.figure, self.frame) if self.mpltlib3: self.canvas.draw() toolbar = NavigationToolbar2Tk(self.canvas, self.frame).update() else: self.canvas.show() toolbar = NavigationToolbar2TkAgg(self.canvas, self.frame).update() self.canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True) self.canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, padx=2, pady=2, expand=True) self.frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True, padx=7, pady=7)
Example #10
Source File: tkXianYu.py From XianyuSdd with MIT License | 6 votes |
def keyword(self): # 钉钉机器人 Keyword = tk.LabelFrame(self.window, text="钉钉机器人", padx=10, pady=10) # 水平,垂直方向上的边距均为10 Keyword.place(x=1070, y=100) self.keywordListBox = Listbox(Keyword, width=35, height=8, ) self.keywordListBox.pack(side=LEFT) keywordScroBar = Scrollbar(Keyword) keywordScroBar.pack(side=RIGHT, fill=Y) self.keywordListBox['yscrollcommand'] = keywordScroBar.set keywords = self.dbconf.select_all() for key in keywords: keyword = key.get('webhook') self.keywordListBox.insert(END, '机器人:{};'.format(keyword)) keywordScroBar['command'] = self.keywordListBox.yview keywordoption = tk.LabelFrame(self.window, text="", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 keywordoption.place(x=1070, y=290) tk.Button(keywordoption, text="添加机器人", command=self.add_keyword).grid(column=0, row=1, padx=9, pady=5) tk.Button(keywordoption, text="删除机器人", command=self.delete_keyword).grid(column=1, row=1, padx=9, pady=5) tk.Button(keywordoption, text="测试机器人", command=self.testLogin).grid(column=2, row=1, padx=9, pady=5)
Example #11
Source File: tkXianYu.py From XianyuSdd with MIT License | 6 votes |
def user(self): # 用户信息 User = tk.LabelFrame(self.window, text="关键字任务", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 User.place(x=30, y=100) self.userListBox = Listbox(User, width=50, height=9, ) self.userListBox.pack(side=LEFT) userScroBar = Scrollbar(User) userScroBar.pack(side=RIGHT, fill=Y) self.userListBox['yscrollcommand'] = userScroBar.set self.insert_userListbox() userScroBar['command'] = self.userListBox.yview # userScrotext = scrolledtext.ScrolledText(User, width=30, height=6, padx=10, pady=10, wrap=tk.WORD) # userScrotext.grid(columnspan=2, pady=10) Useroption = tk.LabelFrame(self.window, text="", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 Useroption.place(x=30, y=300) tk.Button(Useroption, text="添加关键字", command=self.add_user).grid(column=0, row=1, padx=57, pady=5) tk.Button(Useroption, text="删除关键字", command=self.delete_use).grid(column=1, row=1, padx=57, pady=5) tk.Button(Useroption, text="一键开启", command=self.all_start).grid(column=0, row=3, padx=55, pady=5) tk.Button(Useroption, text="一键关闭", command=self.all_stop).grid(column=1, row=3, padx=55, pady=5) self.startBtn = tk.Button(Useroption, text="单项开启", command=self.start_spider) self.startBtn.grid(column=0, row=2, padx=55, pady=5) self.stopBtn = tk.Button(Useroption, text="单项关闭", command=self.stop_spider) self.stopBtn.grid(column=1, row=2, padx=55, pady=5)
Example #12
Source File: tkui.py From onmyoji_bot with GNU General Public License v3.0 | 5 votes |
def create_times(self): ''' 游戏次数 ''' times = tk.LabelFrame(self.main_frame1, text='次数设置') times.pack(padx=5, fill=tk.X, anchor=tk.W) timeframe1 = tk.Frame(times) timeframe1.pack(anchor=tk.W) tk.Label(timeframe1, text='游戏次数(0=无数次):').pack(side=tk.LEFT) tk.Entry(timeframe1, width=6, textvariable=self.max_times).pack() self.end_operation = ttk.Combobox(times) self.end_operation['value'] = ('结束后关闭脚本', '结束后关闭脚本和游戏') self.end_operation.pack(fill=tk.X, padx=2, pady=2) self.end_operation.current(0) self.end_operation.config(state='readonly')
Example #13
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def loading(self): # 进度条 Loading = tk.LabelFrame(self.window, text="进度条", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 Loading.place(x=350, y=20) canvas = tk.Canvas(Loading, width=665, height=22, bg="white") canvas.grid()
Example #14
Source File: load_train_test_2.py From Clash-Royale-AI-Card-Tracker with Apache License 2.0 | 5 votes |
def labelTrainingData2(): imagePaths = sorted(list(paths.list_images("generatedData/"))) currentNumOfLabeledData = len(sorted(list(paths.list_images("trainData2/")))) root = tkinter.Tk() myFrame = tkinter.LabelFrame(root, text="Unlabeled Data", labelanchor="n") myFrame.pack() labeledCount = 0 for i in range(len(imagePaths)): img = Image.open(imagePaths[i]) img.thumbnail((1500, 1500), Image.ANTIALIAS) img = ImageTk.PhotoImage(img) panel = tkinter.Label(myFrame, image = img) panel.image = img panel.grid(row=0, column=0) root.update() label = input() if (label != 'e'): copyfile(imagePaths[i], "trainData2/"+label+"input"+str(labeledCount+currentNumOfLabeledData)+".png") labeledCount += 1 os.remove(imagePaths[i])
Example #15
Source File: tkui.py From onmyoji_bot with GNU General Public License v3.0 | 5 votes |
def create_frame0(self): ''' 御魂参数 ''' # 游戏模式 mode = tk.LabelFrame(self.frame0, text='模式') mode.pack(padx=5, pady=5, fill=tk.BOTH) self.run_mode = tk.IntVar() self.run_mode.set(0) tk.Radiobutton(mode, text='单刷', variable=self.run_mode, value=0).grid(row=0, column=0, sticky=tk.W) tk.Radiobutton(mode, text='单人司机', variable=self.run_mode, value=1).grid(row=0, column=1, sticky=tk.W) tk.Radiobutton(mode, text='单人乘客', variable=self.run_mode, value=2).grid(row=1, column=0, sticky=tk.W) tk.Radiobutton(mode, text='双开', variable=self.run_mode, value=3).grid(row=1, column=1, sticky=tk.W) # 游戏副本 submode = tk.LabelFrame(self.frame0, text='副本(请锁定阵容)') submode.pack(padx=5, pady=5, fill=tk.BOTH, expand=True) tk.Radiobutton(submode, text='八岐大蛇', variable=self.run_submode, value=0).grid(row=0, column=0, sticky=tk.W) tk.Radiobutton(submode, text='业原火', variable=self.run_submode, value=1).grid(row=0, column=1, sticky=tk.W) tk.Radiobutton(submode, text='卑弥呼', variable=self.run_submode, value=2).grid(row=1, column=0, sticky=tk.W) # 标记式神 mitama_mark = tk.Frame(self.frame0, padx=5, pady=5) mitama_mark.pack(fill=tk.X, expand=True) tk.Label(mitama_mark, text='标记己方式神:').pack(side=tk.LEFT) self.mitama_team_mark = ttk.Combobox(mitama_mark, width=10) self.mitama_team_mark['value'] = ( '不标记', '第1个式神', '第2个式神', '第3个式神', '第4个式神', '第5个式神') self.mitama_team_mark.pack(fill=tk.X, expand=True, padx=2) self.mitama_team_mark.current(0) self.mitama_team_mark.config(state='readonly')
Example #16
Source File: Clash_Royale_Helper.py From Clash-Royale-AI-Card-Tracker with Apache License 2.0 | 5 votes |
def testingGUI(): root = tkinter.Tk() myFrame = tkinter.LabelFrame(root, text="Opponent's Cards", labelanchor="n") myFrame.pack() for r in range(1): for c in range(4): img = Image.open("trainData/GoblinHutCard.png") img.thumbnail((128, 128), Image.ANTIALIAS) img = ImageTk.PhotoImage(img) panel = tkinter.Label(myFrame, image = img, borderwidth=10) panel.image = img panel.grid(row=r, column=c) root.update() st = time.time() while(True): if(time.time() - st > 1): img = Image.open("trainData/TheLogCard.png") img.thumbnail((128, 128), Image.ANTIALIAS) img = ImageTk.PhotoImage(img) panel = tkinter.Label(myFrame, image = img, borderwidth=10) panel.image = img panel.grid(row=0, column=2) root.update() st = time.time()
Example #17
Source File: test_widgets.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def create(self, **kwargs): return tkinter.LabelFrame(self.root, **kwargs)
Example #18
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def log(self): # 日志 self.logMessage.put('欢迎使用【闲鱼信息采集器】') logInformation = tk.LabelFrame(self.window, text="日志", padx=10, pady=10) # 水平,垂直方向上的边距均为10 logInformation.place(x=450, y=100) self.logInformation_Window = scrolledtext.ScrolledText(logInformation, width=77, height=22, padx=10, pady=10, wrap=tk.WORD) self.logInformation_Window.grid()
Example #19
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def create_page(self): User = tk.LabelFrame(self.window, text="机器人", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 User.place(x=50, y=80) tk.Label(User, text="机器人:").grid(column=0, row=0, sticky='w', pady=5, padx=5) # 添加用户账号 self.keywordEntry = tk.Entry(User, textvariable=self.keyword, width=23) self.keywordEntry.grid(column=1, row=0, pady=5) tk.Button(User, text="确认添加", command=self.add_keyword).grid(columnspan=2, row=2, pady=5, ipadx=10)
Example #20
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def create_page(self): Dev = tk.LabelFrame(self.window, text="关于使用说明", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 Dev.place(x=50, y=50) text = "【使用前仔细阅读使用说明】 \n\n" \ "使用说明\n" \ "本项目采用异步爬取,对于闲鱼速度快,效率高。\n" \ "**注意事项**\n" \ "- 钉钉接口每个机器人每分钟只能发送20条信息。次数太多会被限制。一个群聊可以创建6个机\n器人的webhook。建议将次6条都加入到程序的机器人队列\n" \ "- 钉钉接口存在敏感字检测。当爬取的信息触发了阿里系的检测系统,信息不能发送。这里在\n日志面板给出已经提示。\n" \ "- 经过测试100多关键字的爬取效率在8-10s内完成。\n" \ "- 给出的关键字描述尽可能精确,避免大范围的搜索。如错误示例:关键字‘空调’ 范围广与\n‘空调’+品牌 或 ’空调‘+ 功能部件,缩小搜索范围。\n" \ "- 程序的爬取频率设定时间尽量多一些。否者爬取的发送信息很多,将导致钉钉接口失效。这里爬\n取频率代表一个全部爬虫结束到下一次爬虫开始的时间。建议设置为10s左右。将会\n10秒后进行下一次执行。\n" \ "- 发送方式 :1-单文本发送(若消息过多,钉钉接口限制),2-连接文本发送(手机端不支\n持跳转闲鱼app),3-markdown文本(推荐、将一次爬\n取的消息汇聚到个文本中,较少钉钉接口压力)\n" \ "- 添加关键字:关键字不为空,价格若不填则搜索时为全价。\n" \ "- 删除关键字:选中关键字任务,点击删除,确认删除。\n" \ "- 单项开启:选中关键字任务,点击开启,任务单独开启\n" \ "- 单项关闭:选中关键字任务,点击关闭,任务单独关闭\n" \ "- 一键开启:点击一键开启,默认开启全部任务\n" \ "- 一键关闭:点击一键关闭,默认关闭全部任务\n" \ "- 更新配置:实时更新爬取频率,发送方式\n" \ "- 清除缓存:清除缓存文件。软件长时间使用产生大量缓存文件,硬件运行效率下降\n" \ "- 清空配置:清除所有配置选项+缓存文件。一般不建议使用\n" \ "- 日志文件:输出日志信息\n" \ "- 系统日志:输入操作信息\n" \ "- 钉钉机器人-添加机器人:添加钉钉机器人的webhook完整链接\n" \ "- 钉钉机器人-删除机器人:选中机器人链接,点击删除,删除成功\n" \ "- 钉钉机器人-测试机器人:测试插入的webhook是否有效。将发送'欢迎测试闲鱼\n信息及时推送器-机器人验证'到钉钉群\n" \ tk.Label(Dev, text=text, justify='left').grid(column=0, row=0, sticky='w', pady=5, padx=5) # 添加用户账号 # 版本说明界面
Example #21
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def create_page(self): Dev = tk.LabelFrame(self.window, text="关于版本更新", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 Dev.place(x=50, y=50) text = " 2019年4月 26日 版本:V1.0\n " tk.Label(Dev, text=text).grid(column=0, row=0, sticky='w', pady=5, padx=5) # 添加用户账号 # 开发者说明界面
Example #22
Source File: tkXianYu.py From XianyuSdd with MIT License | 5 votes |
def create_page(self): Dev = tk.LabelFrame(self.window, text="关于开发者", padx=10, pady=5) # 水平,垂直方向上的边距均为 10 Dev.place(x=50, y=50) text = " 作者:AJay13\n" \ " 技能:熟悉各项爬虫与反爬虫,数据清洗,\n 网站搭建,软件编写\n" \ " 联系:BoeSKh5446sa23sadKJH84ads5\n" tk.Label(Dev, text=text, justify='left').grid(column=0, row=0, sticky='w', pady=5, padx=5) # 添加用户账号 # 版本测试时间
Example #23
Source File: voyagerimb.py From voyagerimb with MIT License | 5 votes |
def view_init(self): self.frame = tk.LabelFrame(self.controlwidgets.frame, text=" Offset ") ftop = tk.Frame(self.frame) fbottom = tk.Frame(self.frame) self.offset_entry = NumericalIntEntry(ftop) self.offset_entry.textvariable.set("0") self.offset_entry.textvariable.trace("w", self.model_sync_with_entry) self.offset_entry.Entry.pack(side=tk.LEFT, fill=tk.X, expand=True) tk.Button(ftop, text="sub", width=1, command=self.model_decrement_offset).pack(side=tk.LEFT) tk.Button(ftop, text="add", width=1, command=self.model_increment_offset).pack(side=tk.LEFT) _mm = tk.Frame(fbottom) for radiobutrow in [["1000", "100", "10", "1"], ["NoS x SLW", "100 x SLW", "10 x SLW", "1 x SLW"]]: _mmm = tk.Frame(_mm) for interval_value in radiobutrow: _m = tk.Radiobutton(_mmm, text="%s" % (interval_value), indicatoron=0, foreground="#940015", variable=self.interval_value_variable, value=interval_value, width=1 ) _m.pack(side=tk.TOP, fill=tk.X, expand=True) _mmm.pack(side=tk.LEFT, fill=tk.X, expand=True) None _mm.pack(side=tk.BOTTOM, fill=tk.X, expand=True) ftop.pack(side=tk.TOP, fill=tk.BOTH, padx=4, pady=4, expand=True) fbottom.pack(side=tk.TOP, fill=tk.BOTH, padx=4, pady=4, expand=True) self.frame.pack(side=tk.TOP, fill=tk.X, padx=7, pady=7, expand=False)
Example #24
Source File: voyagerimb.py From voyagerimb with MIT License | 5 votes |
def __init__(self, parent): self.parent = parent self.browser = parent.browser self.frame = tk.LabelFrame(self.parent.frame, text=" Scan line width (SLW)") self.scan_line_width_entry = NumericalIntEntry(self.frame) self.scan_line_width_entry.textvariable.set(3197) self.scan_line_width_entry.textvariable.trace("w", self.model_sync_with_entry) self.scan_line_width_entry.Entry.pack(side=tk.LEFT, fill=tk.X, padx=4, pady=4, expand=True) tk.Button(self.frame, text="-", command=self.model_decrease).pack(side=tk.LEFT) tk.Button(self.frame, text="+", command=self.model_increase).pack(side=tk.LEFT) self.frame.pack(side=tk.TOP, fill=tk.X, padx=7, pady=7, expand=False)
Example #25
Source File: voyagerimb.py From voyagerimb with MIT License | 5 votes |
def __init__(self, parent): self.parent = parent self.browser = parent.browser self.frame = tk.LabelFrame(self.parent.frame, text=" Number of scans (NoS) per image ") self.number_of_scans_entry = NumericalIntEntry(self.frame) self.number_of_scans_entry.textvariable.set(512) self.number_of_scans_entry.textvariable.trace("w", self.model_sync_with_entry) self.number_of_scans_entry.Entry.pack(side=tk.LEFT, fill=tk.X, padx=4, pady=4, expand=True) tk.Button(self.frame, text="-", command=self.model_decrease).pack(side=tk.LEFT) tk.Button(self.frame, text="+", command=self.model_increase).pack(side=tk.LEFT) self.frame.pack(side=tk.TOP, fill=tk.X, padx=7, pady=7, expand=False)
Example #26
Source File: voyagerimb.py From voyagerimb with MIT License | 5 votes |
def __init__(self, parent): self.parent = parent self.browser = parent.browser self.frame = tk.LabelFrame(self.parent.frame, text=" Offset Adjust ") self.adjust_control_entry = NumericalFloatEntry(self.frame) self.adjust_control_entry.textvariable.set(0) self.adjust_control_entry.textvariable.trace("w", self.model_sync_with_entry) self.adjust_control_entry.Entry.pack(side=tk.LEFT, fill=tk.X, padx=4, pady=4, expand=True) tk.Button(self.frame, text="-", command=self.model_decrease).pack(side=tk.LEFT) tk.Button(self.frame, text="+", command=self.model_increase).pack(side=tk.LEFT) self.frame.pack(side=tk.TOP, fill=tk.X, padx=7, pady=7, expand=False)
Example #27
Source File: app.py From QM-Simulator-1D with MIT License | 5 votes |
def set_widgets_after_potential_sliders(self) -> None: """ Set the widgets after the parameter sliders for the potential """ total_sliders_count = self.sliders2_count + self.sliders1_count # Animation speed slider if self.slider_speed_label is not None: self.slider_speed_label.destroy() self.slider_speed_label = tk.LabelFrame( self.window, text="Animation Speed") self.slider_speed_label.grid(row=17 + total_sliders_count, column=3, padx=(10, 10)) if self.slider_speed is not None: self.slider_speed.destroy() self.slider_speed = tk.Scale(self.slider_speed_label, from_=0, to=10, orient=tk.HORIZONTAL, length=200, command=self.change_animation_speed ) self.slider_speed.grid(row=18 + total_sliders_count, column=3, padx=(10, 10)) self.slider_speed.set(1) # Quit button if self.quit_button is not None: self.quit_button.destroy() self.quit_button = tk.Button( self.window, text='QUIT', command=self.quit) self.quit_button.grid(row=19 + total_sliders_count, column=3)
Example #28
Source File: example-frame-3.py From python-examples with MIT License | 5 votes |
def create_widgets(self): self.labelframe = tk.LabelFrame(self.parent, text="Question:") self.labelframe.pack(fill="both", expand=True) self.label = tk.Label(self.labelframe, text=self.question + ' ?') self.label.pack(expand=True, fill='both') self.entry = tk.Entry(self.labelframe) self.entry.pack() self.button = tk.Button(self.labelframe, text="Click", command=self.get_input) self.button.pack() # --- main ---
Example #29
Source File: Controls.py From Python-Media-Player with Apache License 2.0 | 5 votes |
def create_control_panel(self): frame=Tkinter.LabelFrame(self.root) frame.pack(expand='yes',fill='x',side='top') add_fileicon=Tkinter.PhotoImage(file="../Icons/add_file.gif") add_directoryicon=Tkinter.PhotoImage(file="../Icons/add_directory.gif") exiticon=Tkinter.PhotoImage(file="../Icons/exit.gif") playicon=Tkinter.PhotoImage(file="../Icons/play.gif") pauseicon=Tkinter.PhotoImage(file="../Icons/pause.gif") stopicon=Tkinter.PhotoImage(file="../Icons/stop.gif") rewindicon=Tkinter.PhotoImage(file="../Icons/rewind.gif") fast_forwardicon=Tkinter.PhotoImage(file="../Icons/fast_forward.gif") previous_trackicon=Tkinter.PhotoImage(file="../Icons/previous_track.gif") next_trackicon=Tkinter.PhotoImage(file="../Icons/next_track.gif") self.muteicon=Tkinter.PhotoImage(file="../Icons/mute.gif") self.unmuteicon=Tkinter.PhotoImage(file="../Icons/unmute.gif") delete_selectedicon=Tkinter.PhotoImage(file="../Icons/delete_selected.gif") list_file=[ (playicon,'self.play'), (pauseicon,'self.pause'), (stopicon,'self.stop'), (previous_trackicon,'self.previous'), (rewindicon,'self.rewind'), (fast_forwardicon,'self.fast'), (next_trackicon,'self.Next'),] for i,j in list_file: storeobj=ttk.Button(frame, image=i,command=eval(j)) storeobj.pack(side='left') storeobj.image=i self.volume_label=Tkinter.Button(frame,image=self.unmuteicon) self.volume_label.image=self.unmuteicon volume=ttk.Scale(frame,from_=Volume_lowest_value, to=Volume_highest_value ,variable=self.var, command=self.update_volume) volume.pack(side='right', padx=10, ) self.volume_label.pack(side='right') return
Example #30
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, samples): tk.LabelFrame.__init__(self, parent, text="Sample Genotype Selection") self.parent = parent self.samples = samples self.max_row = 5 if self.samples: self.GT_CBs = [] self.c = 0 self.r = 0 self.set_samples() else: self.GT_CBs = None self.lab = tk.Label(self,text="-- No samples Selected --") self.lab.grid(row=0, sticky = tk.EW)