def Choices(self): self.blast_string = tk.StringVar() self.blast_string.set('blastn') self.cf = ttk.Frame(self.toplevel) self.cf.pack(side='top', expand=1, fill='x') self.dbs_frame = ttk.LabelFrame(self.cf, text='Databases') self.dbs_frame.pack(side='left', padx=5, pady=5, expand=1, fill='x') nin_values = self.database_readable(self.nin) pin_values = self.database_readable(self.pin) self.dbs = ttk.Combobox(self.dbs_frame, exportselection=0, values=nin_values + pin_values) self.dbs.current(0) self.blast_frame = ttk.LabelFrame(self.cf, text='BLAST programs') self.blast_frame.pack(side='left', padx=5, pady=5, expand=1, fill='x') self.blasts = ttk.Combobox(self.blast_frame, exportselection=0, textvariable=self.blast_string, values=['blastn', 'blastp', 'blastx', 'tblastn', 'tblastx']) self.dbs.pack(side='left', padx=5, pady=5, expand=1, fill='x') self.blasts.pack(side='left', padx=5, pady=5, expand=1, fill='x') self.option_f = ttk.LabelFrame(self.cf, text='Command line options') self.option_f.pack(side='left', padx=5, pady=5, expand=1, fill='x') self.option = ttk.Entry(self.option_f) self.option.pack(side='left', padx=5, pady=5, fill='x', expand=1) self.ok = ttk.Button(self.cf, text='Run', command=self._Run, state='disabled') self.ok.pack(side='right') self.Validate()
def __init__(self): self.top = Toplevel(parent, takefocus=True) self.top.resizable(0, 0) self.top.title("Add To Cart") self.customer = None self.frame = ttk.Frame(self.top) self.frame.pack(side=tk.TOP, fill=tk.BOTH, expand=True) self.labelframe1 = ttk.LabelFrame(self.frame) self.labelframe1.pack(fill='both', expand='yes', padx=5, pady=5) self.customer_name_label = Label(self.labelframe1, text='Name of customer:') self.customer_name_label.grid(row=0, column=0, padx=5, pady=5) self.customer_name_field = Entry(self.labelframe1) self.customer_name_field.focus_set() self.customer_name_field.grid(row=0, column=1, padx=5, pady=5) self.labelframe2 = ttk.LabelFrame(self.frame) self.labelframe2.pack(fill='both', expand='yes', padx=5, pady=5) self.add_label = ttk.Label(self.labelframe2, text='Add order to cart?') self.add_label.pack(side=TOP, padx=5, pady=5) self.yes_btn = Button(self.labelframe2, text='Yes', command=self.do) self.no_btn = Button(self.labelframe2, text='No', command=self.no) self.yes_btn.pack(side=RIGHT, padx=5, pady=5) self.no_btn.pack(side=LEFT, padx=5, pady=5) self.yes_btn.focus_set() self.top.bind("<Return>", self.do) self.top.grab_set()
def __init__(self, parent, *args, **kwargs): """ Initializes the window and creates basic GUI elements. @param parent: Tk window object @param args: not used @param kwargs: not used """ Tk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent self.grid(column=0, row=0, sticky=(Tk.N, Tk.W, Tk.E, Tk.S)) self.columnconfigure(0, weight=0) self.rowconfigure(0, weight=1) self.columnconfigure(1, weight=1) self.text = Tk.Text(self) sys.stdout = StdRedirect(self.text) self.left_frame = Tk.Frame(self) self.calls_frame = ttk.LabelFrame(self.left_frame, text="System calls") self.tests_frame = ttk.LabelFrame(self.left_frame, text="Test suites") self.checkbuttons = [] self.checkbuttons_suite = [] # For some strange reason we have to keep reference on checkbutton variables, # otherwise they will show the third state self.checkbutton_vars = [] self.checkbutton_suite_vars = [] self.create_checkbuttons() self.select_all = ttk.Button(self.calls_frame, text='Select all', command=lambda: self.selection(1)) self.deselect_all = ttk.Button(self.calls_frame, text='Deselect all', command=lambda: self.selection(0)) self.start = ttk.Button(self.left_frame, text='Start testing', command=self.start_testing) self.grid_widgets()
def __init__(self, dialog, parent, app, player, gameid): ttk.Frame.__init__(self, parent) self.app = app self.dialog = dialog left_label = ttk.Label(self, image=app.gimages.logos[5]) left_label.pack(side='left', expand=True, fill='both') frame = ttk.LabelFrame(self, text=_('Current game'), padding=(10, 5, 10, 10)) frame.pack(side='top', expand=True, fill='x', padx=10, pady=10) ##frame.columnconfigure(0, weight=1) if not self.createTopFrame(frame, player, gameid): ttk.Label(frame, text=_('No TOP for this game')).pack(padx=10, pady=10) frame = ttk.LabelFrame(self, text=_('All games'), padding=(10, 5, 10, 10)) frame.pack(side='top', expand=True, fill='x', padx=10, pady=10) ##frame.columnconfigure(0, weight=1) if not self.createTopFrame(frame, player, 'all'): ttk.Label(frame, text=_('No TOP for all games')).pack(padx=10, pady=10)
def __init_cart_container__(self): self.labelframe_orderDetails = ttk.LabelFrame(self, text="Cart Details") self.labelframe_orderDetails.pack(side=LEFT, expand=True, fill=BOTH, padx=10, pady=10) self.items = ttk.LabelFrame(self.labelframe_orderDetails, text="Items") self.items.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5) self.order_listbox = Listbox(self.items) self.order_listbox.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5) self.total_label = ttk.Label(self.labelframe_orderDetails, text="Total Amount: P0.00") self.total_label.pack(side=TOP, fill=Y, pady=10) self.delete_btn = ttk.Button(self.labelframe_orderDetails, text='Cancel Order', command=self.cancel_order) self.delete_btn.pack(side=TOP, fill=BOTH, expand=TRUE, padx=10, pady=10) self.checkout_btn = ttk.Button(self.labelframe_orderDetails, text='Checkout Order', command=self.checkout) self.checkout_btn.pack(side=TOP, fill=BOTH, expand=TRUE, padx=10, pady=10)
def CreateWidgets(self): self.s1 = StringVar() self.s2 = StringVar() self.v1 = IntVar() self.v2 = IntVar() self.v3 = IntVar() self.v4 = IntVar() self.v5 = IntVar() self.lf1 = ttk.LabelFrame(self, text="Filename:") self.lf1.pack(fill=Tkconstants.BOTH) self.lf2 = ttk.LabelFrame(self, text="Processing choices: pick at least one") # self.lf2.config(label="Processing choices: pick at least one") self.lf2.pack(fill=Tkconstants.BOTH) self.lf3 = ttk.LabelFrame(self, text="Logging") # self.lf3.config(label="Logging") self.lf3.pack(fill=Tkconstants.BOTH) self.b1 = Button(self, text="Run", command=self.b1_callback, default=Tkconstants.ACTIVE) self.b1.pack(side="bottom") self.e1 = Entry(self.lf1, textvariable=self.s1) self.e1.pack(fill=Tkconstants.BOTH) self.e1.bind("<Button-1>", self.e1_callback) self.e2 = Entry(self.lf3, textvariable=self.s2) self.e2.pack(fill=Tkconstants.BOTH) self.c1 = Checkbutton(self.lf2, text="ET - generate Excel .csv output", variable=self.v1) self.c1.pack(anchor=Tkconstants.W) self.c2 = Checkbutton(self.lf2, text="HTML - include HTML output from et.py", variable=self.v2) self.c2.pack(anchor=Tkconstants.W) self.c3 = Checkbutton(self.lf2, text="KML - output for Google Earth", variable=self.v3) self.c3.pack(anchor=Tkconstants.W) self.c4 = Checkbutton(self.lf2, text="MR - generate a .gpx route file", variable=self.v4) self.c4.pack(anchor=Tkconstants.W) self.c5 = Checkbutton(self.lf2, text="ROOTER - generate a Rooter file", variable=self.v5) self.c5.pack(anchor=Tkconstants.W)
def init_paned_window(self): # account labelframe self.labelframe_account = ttk.LabelFrame(self, text="Account Details") self.labelframe_account.pack(side=TOP, fill=X, padx=10, pady=10) self.logo = ttk.Label(self.labelframe_account, text="YOLOTEA LOGO", width=20) self.employee_name = ttk.Label(self.labelframe_account, text="Employee Name: EMPLOYEE NAME", width=100) self.employee_id = ttk.Label(self.labelframe_account, text="ID Number: ID NUMBER", width=100) self.logo.grid(row=0, column=0, columnspan=3, rowspan=3, padx=10, pady=10) self.employee_name.grid(row=0, column=4, padx=10, pady=5) self.employee_id.grid(row=1, column=4, padx=10, pady=5) # main notebook self.notebook = ttk.Notebook(self) self.frame_milktea() self.frame_fruittea() self.frame_hottea() self.frame_snacks() self.frame_combos() self.notebook.pack(side=LEFT, fill=BOTH, expand=True, padx=10, pady=10) # cart details labelframe self.labelframe_orderDetails = ttk.LabelFrame(self, text="Cart Details") self.labelframe_orderDetails.pack(side=LEFT, expand=True, fill=BOTH, padx=10, pady=10) # self.order_listbox = tk.Label(self.labelframe_orderDetails, height=28, width=60, bg="white") # self.order_listbox.pack(side=TOP, padx=5, pady=5) self.order_label = ttk.Label(self.labelframe_orderDetails) self.order_label.pack(side=TOP, fill=BOTH, expand=True, padx=5, pady=5) self.total_label = ttk.Label(self.labelframe_orderDetails, text="Total Amount: P0.00") self.total_label.pack(side=TOP, fill=Y, pady=10) self.checkout_btn = ttk.Button(self.labelframe_orderDetails, text='Checkout Order', command=self.checkout) self.checkout_btn.pack(side=BOTTOM, fill=BOTH, expand=TRUE, padx=10, pady=10)
def __init_hottea_details__(self): labelframe = ttk.LabelFrame(self.hf, text="Order Details") labelframe.pack(side=LEFT, fill=BOTH, expand=TRUE, padx=10, pady=10) f1 = ttk.Frame(labelframe) # order details frame f2 = ttk.Frame(labelframe) # add to cart button frame f3 = ttk.Frame(f1) # size frame f4 = ttk.Frame(f1) # quantity frame f5 = ttk.Frame(f1) f5.pack(side=TOP, fill=BOTH) f1.pack(side=TOP, fill=BOTH) f2.pack(side=TOP, fill=BOTH) f3.pack(side=LEFT, fill=BOTH, expand=TRUE) f4.pack(side=LEFT, fill=BOTH, expand=TRUE) labelframe_chosenflavor = ttk.LabelFrame(f5, text="Chosen Flavor") labelframe_size = ttk.LabelFrame(f3, text="Size") labelframe_numdrink = ttk.LabelFrame(f4, text="Number of Drinks") btn_addtocart = ttk.Button(f2, text="Add Order to Cart", command=lambda: self.add_to_cart('h')) labelframe_chosenflavor.pack(side=TOP, fill=BOTH, expand=TRUE, padx=5, pady=5) labelframe_size.pack(side=TOP, fill=BOTH, padx=10, pady=10) labelframe_numdrink.pack(side=TOP, fill=BOTH, padx=10, pady=10) btn_addtocart.pack(side=TOP, fill=BOTH, expand=TRUE, padx=10, pady=10, ipady=20) label_chosenflavor = ttk.Label(labelframe_chosenflavor, textvariable=self.h_str) label_chosenflavor.pack(side=LEFT, fill=BOTH, padx=10, pady=10) radiobutton_l = ttk.Radiobutton(labelframe_size, text="Large (L)", command=lambda: self.set_size('Large')) radiobutton_xl = ttk.Radiobutton( labelframe_size, text="Extra Large (XL)", command=lambda: self.set_size('Extra LArge')) radiobutton_l.pack(side=LEFT, fill=BOTH, padx=10, pady=10) radiobutton_xl.pack(side=LEFT, fill=BOTH, padx=10, pady=10) label_quantity = ttk.Label(labelframe_numdrink, text="Quantity", anchor=tk.E) self.entry_quantity_h = ttk.Entry(labelframe_numdrink) label_quantity.pack(side=LEFT, fill=BOTH, padx=10, pady=10) self.entry_quantity_h.pack(side=LEFT, fill=BOTH, padx=10, pady=10)
def labelframe_order_details_hottea(self, f): labelframe = ttk.LabelFrame(f, text="Order Details") labelframe.pack(side=LEFT, fill=BOTH, expand=TRUE, padx=10, pady=10) f1 = ttk.Frame(labelframe) # order details frame f2 = ttk.Frame(labelframe) # add to cart button frame f3 = ttk.Frame(f1) # size frame f4 = ttk.Frame(f1) # quantity frame f5 = ttk.Frame(f1) f5.pack(side=TOP, fill=BOTH) f1.pack(side=TOP, fill=BOTH) f2.pack(side=TOP, fill=BOTH) f3.pack(side=LEFT, fill=BOTH, expand=TRUE) f4.pack(side=LEFT, fill=BOTH, expand=TRUE) labelframe_chosenflavor = ttk.LabelFrame(f5, text="Chosen Flavor") labelframe_size = ttk.LabelFrame(f3, text="Size") labelframe_numdrink = ttk.LabelFrame(f4, text="Number of Drinks") btn_addtocart = ttk.Button(f2, text="Add Order to Cart", command=None) labelframe_chosenflavor.pack(side=TOP, fill=BOTH, expand=TRUE, padx=5, pady=5) labelframe_size.pack(side=TOP, fill=BOTH, padx=10, pady=10) labelframe_numdrink.pack(side=TOP, fill=BOTH, padx=10, pady=10) btn_addtocart.pack(side=TOP, fill=BOTH, expand=TRUE, padx=10, pady=10, ipady=20) label_chosenflavor = ttk.Label(labelframe_chosenflavor) label_chosenflavor.pack(side=LEFT, fill=BOTH, padx=10, pady=10) radiobox_L = ttk.Radiobutton(labelframe_size, text="Large (L)", value=0, command=None) radiobox_XL = ttk.Radiobutton(labelframe_size, text="Extra Large (XL)", value=1, command=None) radiobox_L.pack(side=LEFT, fill=BOTH, padx=10, pady=10) radiobox_XL.pack(side=LEFT, fill=BOTH, padx=10, pady=10) label_quantity = ttk.Label(labelframe_numdrink, text="Quantity", anchor=tk.E) entry_quantity = ttk.Entry(labelframe_numdrink) label_quantity.pack(side=LEFT, fill=BOTH, padx=10, pady=10) entry_quantity.pack(side=LEFT, fill=BOTH, padx=10, pady=10) return label_chosenflavor
def drawUI(self): ''' frame 1''' self.frame_a = Frame(self.parent) self.frame_a.grid(row=0, column=0, padx=1, pady=1, sticky='NSWE') Grid.columnconfigure(self.frame_a, 0, weight=1) self.new_url = StringVar() #self.new_url.set('https://v.qq.com/x/page/v0029l41udq.html') self.entry_url = Entry( self.frame_a, textvariable=self.new_url) self.entry_url.grid(row=0, column=0, padx=5, pady=5, columnspan=2, sticky='NWSE') self.btn_start = Button(self.frame_a, text=u"下载", command=self.start_click) self.btn_start.grid(row=0, column=1, padx=5, pady=5, sticky='NWSE') '''frame 2''' self.frame_b = Frame(self.parent) self.frame_b.grid(row=1, column=0, padx=1, pady=1, sticky='NSWE') self.frame_c = Frame(self.parent) self.frame_c.grid(row=2, column=0, padx=1, pady=1, sticky='NSWE') Grid.columnconfigure(self.frame_b, 0, weight=1) self.info_panel = ttk.LabelFrame(self.frame_b, text=u"正在下载") self.info_panel.grid(column=0, row=1, padx=5, pady=0, sticky='NWSE') Grid.columnconfigure(self.info_panel, 0, weight=1) Grid.rowconfigure(self.frame_c, 0, weight=1) Grid.columnconfigure(self.frame_c, 0, weight=1) self.txt_per = StringVar() self.lb_per = Label(self.info_panel, textvariable=self.txt_per) self.lb_per.grid(row=0, column=0, pady=0, columnspan=2, sticky='W') '''frame 3''' self.done_panel = ttk.LabelFrame(self.frame_c, text=u"完成列表") self.done_panel.grid(column=0, row=0, padx=5, pady=0, sticky='NWSE') Grid.columnconfigure(self.done_panel, 0, weight=1) Grid.rowconfigure(self.done_panel, 0, weight=1) self.download_list = Listbox(self.done_panel, selectmode=EXTENDED, bg='#FFFFFF') self.download_list.grid(row=0, column=0, padx=1, pady=1, sticky='NSWE') self.btn_clear = Button(self.frame_c, text=u"清空列表", command=self.clear_click) self.btn_clear.grid(row=1, column=0, padx=5, pady=5) # ----vertical scrollbar------------ self.vbar = ttk.Scrollbar( self.done_panel, orient=VERTICAL, command=self.download_list.yview) self.download_list.configure(yscrollcommand=self.vbar.set) self.vbar.grid(row=0, column=1, sticky='NS')
def __init__(self, parent, *args, **kwargs): self.lookup_command = kwargs.pop('lookupcommand', lambda *args, **kwargs: None) ttk.Frame.__init__(self, parent, *args, **kwargs) common_args = {} ## ## Upper Spacer: ## lblSpacerActiveTop = ttk.Label(self, text="", **common_args) lblSpacerActiveTop.pack(expand=True, fill="y") ## ## Lists: ## frameListGroup = ttk.Frame(self, **common_args) frameListGroup.pack(padx=10, pady=5, fill="x") frameOwnerKeys = ttk.LabelFrame(frameListGroup, text="Owner:") frameOwnerKeys.pack(expand=True, fill="both", side="left") frameActiveKeys = ttk.LabelFrame(frameListGroup, text="Active:") frameActiveKeys.pack(expand=True, fill="both", side="left", padx=8) frameMemoKeys = ttk.LabelFrame(frameListGroup, text="Memo:") frameMemoKeys.pack(expand=True, fill="both", side="left") self.listOwnerKeys = tk.Listbox(frameOwnerKeys) self.listOwnerKeys.pack(expand=True, fill="both") self.listActiveKeys = tk.Listbox(frameActiveKeys) self.listActiveKeys.pack(expand=True, fill="both") self.listMemoKeys = tk.Listbox(frameMemoKeys) self.listMemoKeys.pack(expand=True, fill="both") ## ## Buttons: ## self.button_get_addrs = ttk.Button( self, text="Query Addresses", command=lambda: self.lookup_handler()) self.button_get_addrs.pack(pady=(10, 15))
def __init__(self, main_window): self.master = Toplevel() self.main_window = main_window self.master.geometry('1100x550') self.master.resizable(width=False, height=False) self.master.title("Ban Management") self.FILES_FRAME = ttk.LabelFrame(self.master, text='Files', height=460, width=890) self.FILES_FRAME.place(relx=0, rely=0.001) self.COLUMNS = ('Category', 'File', 'Size', 'Uploader', 'Date') self.FILES = ttk.Treeview(self.FILES_FRAME, columns=self.COLUMNS, show='headings', height=21) FILES_ysb = ttk.Scrollbar(orient=VERTICAL, command=self.FILES.yview) xsb = ttk.Scrollbar(orient=HORIZONTAL, command=self.FILES.xview) self.FILES['yscroll'] = FILES_ysb.set self.FILES['xscroll'] = xsb.set self.FILES.grid(row=0, column=0) FILES_ysb.grid(in_=self.FILES_FRAME, row=0, column=1, sticky=NS)
def _create_widgets(self): self.my_button_text = tk.StringVar(value='Start') self.my_button = ttk.Button(self, textvariable=self.my_button_text, command=self._start) self.my_button.pack() self.my_label_frame = ttk.LabelFrame(self, text='Work Items') self.my_label_frame.pack(fill='x') self.my_label_text = tk.StringVar() self.my_label = ttk.Label(self.my_label_frame, anchor='w', textvariable=self.my_label_text) self.my_label.pack(fill='x') self.my_progress_bar = ttk.Progressbar( self, orient='horizontal', length=self.master.winfo_screenwidth() / 5, mode='determinate', maximum=self.work_count) self.my_progress_bar.pack(fill='both') self.my_status_label_text = tk.Stringvar( value='0 / {}'.format(self.work_count)) self.my_status_label = ttk.Label( self, anchor='w', textvariable=self.my_status_label_text) self.my_status_label.pack(fill='x')
def __init__(self): self.top = Toplevel(parent, takefocus=True) self.top.resizable(0, 0) self.top.title("Yolotea Login") self.value = None self.frame = ttk.Frame(self.top) self.frame.pack(side=tk.TOP, fill=tk.BOTH, expand=True) self.labelframe1 = ttk.LabelFrame(self.frame, text='Login form') self.labelframe1.pack(fill="both", expand="yes", padx=10, pady=10) self.username_label = ttk.Label(self.labelframe1, text="Username") self.username_label.grid(row=0, column=0, padx=3, pady=5) self.username_field = ttk.Entry(self.labelframe1) self.username_field.focus_set() self.username_field.grid(row=0, column=1, padx=3, pady=5) self.password_label = ttk.Label(self.labelframe1, text="Password") self.password_label.grid(row=1, column=0, padx=3, pady=5) self.password_field = ttk.Entry(self.labelframe1, show="*") self.password_field.grid(row=1, column=1, padx=3, pady=5) self.login_btn = ttk.Button(self.frame, text='Login', command=self.do) self.login_btn.pack(fill=X, padx=10, pady=10) self.top.bind("<Return>", self.do) self.top.grab_set()
def __init__(self, parent, controller, **kwargs): tk.Frame.__init__(self, parent, **kwargs) self.controller = controller self.chopper_controls_LF = ttk.LabelFrame(self, text="Chopper Frequency") self.frequency_Label = ttk.Label(self.chopper_controls_LF, text="Frequency") self.frequency_Combobox = ttk.Combobox( self.chopper_controls_LF, width=10, state="disabled", ) # Stick to grid self.chopper_controls_LF.grid( column=0, row=0, ) self.frequency_Label.grid(column=0, row=0) self.frequency_Combobox.grid(column=1, row=0, padx=5, pady=5) self.frequency_Combobox["values"] = ChopperFrequencyPreset self.frequency_Combobox.bind("<<ComboboxSelected>>", self.change_frequency)
def main(): """Load the gui""" top = Tkinter.Tk() frame = ttk.Frame(top) frame.grid() command = Tkinter.StringVar(top, 'buy') group = ttk.LabelFrame(frame, text='Listing type') group.grid(row=0, column=0) for opt in 'buy', 'rent', 'sold': ttk.Radiobutton(group, text=opt, variable=command, value=opt).grid() search = ttk.Entry(frame) search.grid(row=0, column=1) def export(): """Run the real estate program""" types = 'CSV {.csv}', 'Text {.txt}', 'All *' filehandle = tkFileDialog.asksaveasfile(filetypes=types) if filehandle: realestate.realestate(command.get(), search.get(), filehandle) filehandle.close() button = ttk.Button(frame, text='Fetch', command=export) button.grid(row=0, column=2) for child in frame.winfo_children(): child.grid_configure(padx=5, pady=5) top.mainloop()
def _build_sku_frame(self): self.sku_frame = ttk.LabelFrame(self, text="SKU Information") self.sku_frame.grid(row=1, column=1, sticky="wne", padx=15) self.sku_frame.columnconfigure(0, weight=0) self.sku_frame.columnconfigure(1, weight=0) self.sku_frame.columnconfigure(2, weight=0) self.sku_frame.columnconfigure(3, weight=1) self.barcodes_col_label = ttk.Label(self.sku_frame, text="Barcode") self.barcodes_col_label.grid(row=0, column=0, sticky="w") self.color_col_label = ttk.Label(self.sku_frame, text="Color") self.color_col_label.grid(row=0, column=1, sticky="w") self.size_col_label = ttk.Label(self.sku_frame, text="Size") self.size_col_label.grid(row=0, column=2, sticky="w") self.sku_image_label = ttk.Label(self.sku_frame, text="Default SKU URL") self.sku_image_label.grid(row=0, column=3, rowspan=10, sticky="e", padx=15)
def init_containers(self): self.root_container = ttk.Frame(self.master) self.root_container.place(relwidth=1, relheight=1, anchor="nw") self.root_container.grid_rowconfigure(0, weight=1) self.root_container.grid_columnconfigure(0, weight=1) self.footer_container = ttk.Frame(self.root_container, width=300, height=35) self.footer_container.grid(row=1, column=0, sticky="ew") self.main_container = ttk.Frame(self.root_container, width=300, height=300) self.main_container.grid(row=0, column=0, sticky="nsew") self.main_container.grid_rowconfigure(0, weight=1) self.main_container.grid_columnconfigure(1, weight=1) self.data_container = ttk.Frame(self.main_container, width=300, height=300) self.data_container.grid(row=0, column=0, padx=5, sticky="ns") self.data_container.grid_rowconfigure(1, weight=1) self.data_container.grid_columnconfigure(0, weight=1) self.canvas_container = ttk.LabelFrame(self.main_container, text="Traces", width=300, height=300) self.canvas_container.grid(row=0, column=1, padx=5, sticky="nsew")
def __init__(self, root): self.root = root # Input Frame self.Container = ttk.LabelFrame(root, text=" Select Directory ") self.Container.pack(side='top', anchor='n', fill='x', expand='yes', padx=5, pady=5) # Browse Entry self.fileVar = tk.StringVar() self.fileEntry = ttk.Entry(self.Container, width=30) self.fileEntry.pack(side='left', anchor='nw', fill='x', expand='yes', padx=5, pady=5) # Browse Button try: # Use the folder icon self.opengif = tk.PhotoImage(file=OPENFOLDER) self.browseBut = ttk.Button(self.Container, command=self._browse) self.browseBut.config(image=self.opengif) except: # Use an elipse self.browseBut = ttk.Button(self.Container, text=" ... ", command=self._browse) self.browseBut.pack(side='right', anchor='ne', padx=5, pady=5)
def __init__(self, parent, controller, **kwargs): tk.Frame.__init__(self, parent, **kwargs) self.controller = controller self.parameters_LF = ttk.LabelFrame(self, text="LIA Parameters") self.time_const_Label = ttk.Label(self.parameters_LF, text="Time constant") self.time_const_Combobox = ttk.Combobox(self.parameters_LF, state="disabled", width=10) self.sens_Label = ttk.Label(self.parameters_LF, text="Sensitivity") self.sens_Combobox = ttk.Combobox(self.parameters_LF, state="disabled", width=10) self.time_const_Combobox["values"] = LIATconstVisual self.sens_Combobox["values"] = LIASensVisual self.sens_Combobox.bind("<<ComboboxSelected>>", self.change_sens) self.time_const_Combobox.bind("<<ComboboxSelected>>", self.change_tconst) # Stick to Grid self.parameters_LF.grid( column=0, row=0, ) self.time_const_Label.grid(column=0, row=0) self.time_const_Combobox.grid(column=1, row=0, padx=5, pady=5) self.sens_Label.grid(column=0, row=1) self.sens_Combobox.grid(column=1, row=1, padx=5, pady=5)
def _createControls(self, frame): self.freqFrame = ttk.LabelFrame(frame, text="Frequencies", padding="5 5 5 5") self.freqFrame.grid(row=0, column=0) self.lfSlider = self.addFreqSlider('Low freq', self.lf, col=0) self.hfSlider = self.addFreqSlider('High freq', self.hf, col=1)
def addPreviewTab(self, parent): mainFrame = ttk.Frame(parent) parent.add(mainFrame, text="Preview") previewTab = ttk.LabelFrame(mainFrame, name='preview', text='Sample passwords') previewTab.pack(fill=tk.BOTH, pady=self.LABEL_FRAME_PADDING_Y, padx=self.LABEL_FRAME_PADDING_X) #include characters label and entry ttk.Label(previewTab, text="Select one of the generated passwords:").pack( anchor=tk.W, side=tk.TOP) #add text area for passwords self.ent = tk.Text( previewTab, height=Config.AUTO_PASSWORD_GENERATION_SAMPLE_NUMBER, width=35) ysb = tk.Scrollbar(previewTab, orient='vertical', command=self.ent.yview) self.ent.configure(yscroll=ysb.set) self.__widgetsRef[self.TEXT_PASSWORD_PREVIEW_KEY] = self.ent self.ent.config(state=tk.DISABLED) ysb.pack(fill=tk.Y, side=tk.RIGHT, anchor=tk.E) self.ent.pack(fill=tk.X) self.__addOkCancelButtons(mainFrame, ok=self.getSelectedPasswordPress, cancel=self.cancel)
def frame_hottea(self): f = ttk.Frame(self.notebook) # hottea flavors labelframe = ttk.LabelFrame(f, text="Flavors") labelframe.pack(side=LEFT, fill=Y, padx=5, pady=5) for x in range(0, 2): Grid.grid_columnconfigure(labelframe, x, weight=1) Grid.grid_rowconfigure(labelframe, x, weight=1) btn = ttk.Button(labelframe, text='Assam/Jasmine', command=lambda: self.flavor_cmd("Assam/Jasmine", val)) btn2 = ttk.Button( labelframe, text='Stash Tea Bag', command=lambda: self.flavor_cmd("Stash Tea Bag", val)) btn.grid(row=0, column=0, padx=5, pady=5, ipadx=52, sticky=N + S + E + W) btn2.grid(row=1, column=0, padx=5, pady=5, sticky=N + S + E + W) val = self.labelframe_order_details_hottea(f) self.notebook.add(f, text='HotTea')
def __init__(self, root, var_type, labelframe_text, box_side, box_anchor, box_fill, box_expand, r_alignment='horizontal'): # Container self.Container = ttk.LabelFrame(root, text=labelframe_text) self.Container.pack(fill=box_fill, expand=box_expand, side=box_side, anchor=box_anchor, padx=5, pady=5) # Default radiobutton value if var_type == "string" or var_type == "str": self.radio_value = tk.StringVar() else: self.radio_value = tk.IntVar() # Alignment method for radio buttons ('horizontal' or 'vertical') # What if the user wants a grid of radio buttons? # N x N or max_row / max_col? # alignment_methods = {0: 'horizontal', 1: 'vertical'} self.button_alignment = r_alignment self.r_column = 0 self.r_row = 0
def __init_hottea_flavors__(self): self.hf = ttk.Frame(self.notebook) labelframe = ttk.LabelFrame(self.hf, text="Flavors") labelframe.pack(side=LEFT, fill=Y, padx=5, pady=5) for x in range(0, 2): Grid.grid_columnconfigure(labelframe, x, weight=1) Grid.grid_rowconfigure(labelframe, x, weight=1) btn = ttk.Button( labelframe, text='Assam/Jasmine', command=lambda: self.set_flavor('Assam/Jasmine', self.h_str)) btn2 = ttk.Button( labelframe, text='Stash Tea Bag', command=lambda: self.set_flavor('Stash Tea Bag', self.h_str)) btn.grid(row=0, column=0, padx=5, pady=5, ipadx=52, sticky=N + S + E + W) btn2.grid(row=1, column=0, padx=5, pady=5, sticky=N + S + E + W) self.notebook.add(self.hf, text='HotTea')
def run(self): self.maxSentries = 15 if len(Connector.getPorts()) == 0: tkMessageBox.showerror(Local('Error'), Local('Serial port not found')) os._exit(0) self.reload = False self.protScanTask = None self.tempWindow = None self.histWindow = None #window root = self.root = Tkinter.Tk() root.resizable(False, False) root.title('GSMguard Configuration v.' + appVersion) root.iconbitmap(resource_path('./gg-icon.ico')) fleft = ttk.Frame(root) fleft.pack(side='left', anchor='n') fright = ttk.LabelFrame(root, text=Local('Schedule')) fright.pack(side='right', anchor='n', padx=3, pady=3, fill='y') self.makeLocaleSettings(fleft) self.makePortSettings(fleft) self.makeMainSettings(fleft) self.makeScheduleSettings(fright) self.updPortList() root.mainloop() return self.reload
def _make_label_frame_buttons(self, column_in, row_in): self.label_frame_buttons = ttk.LabelFrame(self.mainframe) self.label_frame_buttons.grid(column=column_in, row=row_in, sticky='NEW') self.result_button_frame_spacer_upper = tk.Label( self.label_frame_buttons, height=5, background=self.background_color) self.result_button_frame_spacer_upper.grid(column=0, row=0) self.get_lshape_a_plus_b_button = ttk.Button( self.label_frame_buttons, width=15, text='A + B', command=self.get_lshape_a_plus_b) self.get_lshape_a_plus_b_button.grid(column=0, row=1) self.get_lshape_a_minus_b_button = ttk.Button( self.label_frame_buttons, width=15, text='A - B', command=self.get_lshape_a_minus_b) self.get_lshape_a_minus_b_button.grid(column=0, row=2) self.get_lshape_a_sub_lshape_b_button = ttk.Button( self.label_frame_buttons, width=15, text='A <= B', command=self.get_lshape_a_sub_lshape_b) self.get_lshape_a_sub_lshape_b_button.grid(column=0, row=3) self.result_button_frame_spacer_lower = tk.Label( self.label_frame_buttons, height=17, background=self.background_color) self.result_button_frame_spacer_lower.grid(column=0, row=4)
def __init__(self): self.root = tk.Tk() self.account_logged_in = dict(id=None, password=None, name=None, type=None) frame = ttk.Frame(self.root) style = ttk.Style() style.theme_use('clam') frame.pack() self.root.title('Login') self.welcome = ttk.Label(frame, text='Welcome to Yolotea!') self.welcome.grid(row=0, column=0, columnspan=2, padx=10, pady=10) labelframe = ttk.LabelFrame(frame, text='Login Details') labelframe.grid(row=1, column=0, columnspan=2, padx=10, pady=5) self.user_label = ttk.Label(labelframe, text='Account ID:') self.user_label.grid(row=0, column=0, padx=10, pady=5) self.user_entry = ttk.Entry(labelframe) self.user_entry.grid(row=0, column=1, padx=10, pady=5) self.user_entry.focus_set() self.password_label = ttk.Label(labelframe, text='Password:'******'Login', command=self.btn_command) self.btn.grid(row=2, column=0, padx=10, pady=10, columnspan=2) self.root.bind('<Return>', self.btn_command) self.root.mainloop()
def containers(self): #Chat box frame that holds the chat window self.chatBoxFrame = ttk.LabelFrame(self.rootFrame,width=550, height=450, text="Chat Box") self.chatBoxFrame.grid(column=1, row=1, padx=10, pady=0, ipadx=0, ipady=0, sticky=W) #input Box frame that holds the user input entry widget self.inputBox = ttk.LabelFrame(self.rootFrame,width=550, height=150, text="Input Box") self.inputBox.grid(column=1, row=2, padx=10, pady=0, ipadx=0, ipady=0) #Agent box to hold picture of the Agent self.agentBox = ttk.LabelFrame(self.rootFrame,width=100, height=100, text="Agent") self.agentBox.grid(column=2, row=1, padx=10, pady=0, sticky=N) #User button box to hold an enter button for the user self.userButBox = ttk.LabelFrame(self.rootFrame,width=100, height=100, text="") self.userButBox.grid(column=2, row=2, padx=10, pady=0, sticky=N)
def _make_label_frame_c_prime(self, column_in, row_in): self.label_frame_c_prime = ttk.LabelFrame(self.mainframe) self.label_frame_c_prime.grid(column=column_in, row=row_in, sticky='EW') self.canvas_c_prime = self._make_canvas(self.label_frame_c_prime, 0, 0) self.spacer_c_prime = tk.Label(self.label_frame_c_prime, width=6, background=self.background_color, text="C'") self.spacer_c_prime.grid(column=0, row=1) # self.get_lshape_c_button = ttk.Button( # self.label_frame_c_prime, # width=self.button_width, # text='Get C', # command=(self._get_lshape_c)) ## # self.get_lshape_c_button.grid( # column=0, # row=2) self.label_c_prime = tk.Label( self.label_frame_c_prime, width=self.label_width, height=self.label_height, textvariable=self.text_vars['c_prime'], ## anchor=tk.NW, justify=tk.LEFT, font=self.label_font) self.label_c_prime.grid(column=0, row=3)