def _create_statusbar(self): self.statusbar = ttk.Frame(self) grip = ttk.Sizegrip(self.statusbar) grip.pack(side="right") self.status_label = tk.Label(self.statusbar, text="", anchor="w") self.status_label.pack(side="left", fill="both", expand="true", padx=8) self.statusbar.pack(side="bottom", fill="x")
def _setup_right_frame(self): """ Setup the right part of the interface. """ right_frame = TT.Frame(self._root) right_frame.grid(row=0, column=1, sticky=T.W+T.E+T.N+T.S) right_frame.grid_columnconfigure(0, weight=1) right_frame.grid_rowconfigure(0, weight=0) # Button box is resizable right_frame.grid_rowconfigure(1, weight=1) right_frame.grid_rowconfigure(2, weight=0) # Button box buttonbox = TT.Frame(right_frame) buttonbox.grid(row=1, column=0, sticky=T.W+T.E+T.N+T.S) buttonbox.grid_columnconfigure(0, weight=1) buttonbox.grid_rowconfigure(0, weight=1) buttonbox.grid_rowconfigure(1, weight=1) # Next problem button image_next = None if self._has_pil: img = I.open('images/next.gif') image_next = IT.PhotoImage(img) # Tk bug workaround: images are garbage-collected if the only # reference belongs to a widget self._images.append(image_next) next_button = TT.Button(buttonbox, image=image_next, text='Next problem', compound=T.BOTTOM, takefocus=False, command=self._controller.next_problem) next_button.grid(row=1, column=0, sticky=T.S) # A nice widget to indicate the place to change window size resizer = TT.Sizegrip(right_frame) resizer.grid(row=2, column=0, sticky=T.S+T.E)
def _init_ui(self): self._init_menu() self._frame = ttk.Frame(self.window) self._btnChangeDir = ttk.Button(self._frame, text="CD", command=self._select_dir) self._entCurrentDir = ttk.Entry(self._frame, textvariable=self._varCurrentDir) self._entCurrentDir.configure(state='readonly') self._lstFiles = Listbox(self._frame, listvariable=self._varFileList) self._scrFiles = ttk.Scrollbar(self._frame, orient=VERTICAL, command=self._lstFiles.yview) self._lstFiles['yscrollcommand'] = self._scrFiles.set self._lstFiles.bind('<<ListboxSelect>>', self._lstFiles_onselect) self._lblDataView = ttk.Label(self._frame, text='Data View:') self._frmPlot = ttk.Frame(self._frame) self._pltCanvas = PlotCanvas(self._frmPlot) self._pltCanvas.ylabel = 'Amplitude [V]' self._pltCanvas.xlabel = 'Time [us]' self._pltCanvas.pack(side=TOP, fill=BOTH, expand=1) self.window.rowconfigure(0, weight=100) self.window.columnconfigure(0, weight=100) self._frame.columnconfigure(1, weight=17) self._frame.columnconfigure(3, weight=83) self._frame.rowconfigure(1, weight=99) self._frame.grid(row=0, column=0, sticky=(N, W, E, S)) self._btnChangeDir.grid(column=0, row=0, padx=5, pady=10, sticky=N) self._btnChangeDir.config(width=3) self._entCurrentDir.grid(column=1, row=0, columnspan=2, padx=0, pady=10, sticky=(N, W, E, S)) self._lblDataView.grid(column=3, row=0, pady=5, padx=5, sticky=(N, W, S, E)) self._lstFiles.grid(column=0, columnspan=2, row=1, padx=5, pady=5, sticky=(N, W, E, S)) self._scrFiles.grid(column=2, row=1, pady=5, sticky=(N, S)) self._frmPlot.grid(column=3, row=1, pady=5, padx=5, sticky=(N, W, S, E)) self._szGrip = ttk.Sizegrip(self._frame).grid(column=999, row=999, sticky=(S, E))
def __init__(self, parent, *args, **kwargs): ttk.Frame.__init__(self, parent, *args, **kwargs) # create a vertical scrollbar vscrollbar = ttk.Scrollbar(self, orient=tk.VERTICAL) vscrollbar.pack(fill=tk.Y, side=tk.RIGHT, expand=False) # create a horizontal scrollbar hscrollbar = ttk.Scrollbar(self, orient=tk.HORIZONTAL) hscrollbar.pack(fill=tk.X, side=tk.BOTTOM, expand=False) # add a size grip sizegrip = ttk.Sizegrip(self) sizegrip.pack(in_=vscrollbar, side=tk.BOTTOM) #Create a canvas object and associate the scrollbars with it self.canvas = tk.Canvas(self, bd=0, highlightthickness=0, yscrollcommand=vscrollbar.set, xscrollcommand=hscrollbar.set) self.canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) #Associate scrollbars with canvas view vscrollbar.config(command=self.canvas.yview) hscrollbar.config(command=self.canvas.xview) # set the view to 0,0 at initialization self.canvas.xview_moveto(0) self.canvas.yview_moveto(0) # bind mousepad scroll events to window scrolling self.canvas.bind('<MouseWheel>', self.scroll_vertical) self.canvas.bind('<Shift-MouseWheel>', self.scroll_horizontal) # create an interior frame to be created inside the canvas self.interior = ttk.Frame(self.canvas) interior = self.interior interior_id = self.canvas.create_window(0, 0, window=interior, anchor=tk.NW) # track changes to the canvas and frame width and sync them, # also updating the scrollbar def _configure_interior(event): # update the scrollbars to match the size of the inner frame size = (max(925, interior.winfo_reqwidth()), max(760, interior.winfo_reqheight())) self.canvas.config(scrollregion='0 0 %s %s' % size) if interior.winfo_reqwidth() != self.canvas.winfo_width(): # update the canvas's width to fit the inner frame self.canvas.config(width=interior.winfo_reqwidth()) interior.bind('<Configure>', _configure_interior)
def __init__(self, master, initial=None, grip=True, **kwargs): """ Initializes the status bar widget. """ # call the parent constructor apply(ttk.Frame.__init__, (self, master), kwargs) # check for an unspecified list of fields if initial is None: initial = ('', ) # initialize some internal state self.fields = [] self.values = [] # set the current column in the grid grid_column = 0 # build the status bar label fields num_fields = len(initial) for index in range(num_fields): # insert separators between label fields if index > 0: ttk.Separator(self, orient=tk.VERTICAL).grid(row=0, column=grid_column, padx=0, pady=2, sticky=(tk.N + tk.S)) grid_column += 1 # create a modifiable text variable for this label tvar = tk.StringVar() tvar.set(initial[index]) self.values.append(tvar) # create a standard label to display the status label = ttk.Label(self, textvariable=tvar) label.grid(row=0, column=grid_column, padx=4, pady=2, sticky=(tk.N + tk.E + tk.S + tk.W)) self.columnconfigure(grid_column, weight=1) self.fields.append(label) grid_column += 1 # add a size grip area to the corner if grip == True: ttk.Sizegrip(self).grid(row=0, column=(grid_column - 1), sticky=tk.SE)
def __init__(self, master, cnf={}, **kw): self.searchable = kw.pop("searchable") for k,v in self._Toplevel_kw.iteritems(): if(not k in kw): kw[k] = v Tkinter.Toplevel.__init__(self, master, cnf=cnf, **kw) self.title(self._title) self.geometry(self._geometry) self.notebook = Notebook(self) self.notebook.grid(row=0, column=0, sticky="news") ttk.Sizegrip(self).grid(row=1, column=1, sticky=("S","E"))
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font1 = "-family helvetica -size 12 -weight normal -slant " \ "roman -underline 0 -overstrike 0" font11 = "-family {DejaVu Sans} -size 12 -weight normal -slant" \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("498x433+951+323") top.title("CPU Information") top.configure(background="wheat") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.Button1 = Button(top) self.Button1.place(relx=0.44, rely=0.88, height=31, width=59) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background="wheat") self.Button1.configure(command=cpu_info_support.quit) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font11) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Quit''') self.Scrolledtext1 = ScrolledText(top) self.Scrolledtext1.place(relx=0.04, rely=0.05, relheight=0.77, relwidth=0.92) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font1) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#ddc8a1") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap=NONE) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0)
def __init__(self, *args, **kwargs): tk.Toplevel.__init__(self, *args, **kwargs) self.overrideredirect(True) self.wm_geometry("400x400+100+100") self.label = tk.Label(self, text="Grab the lower-right corner to resize") self.label.pack(side="top", fill="both", expand=True) self.grip = ttk.Sizegrip(self) self.grip.place(relx=0.8, rely=0.8, anchor="se") self.grip.lift(self.label) self.grip.bind("<B1-Motion>", self.OnMotion)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font11 = "-family {DejaVu Sans} -size 12 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font12 = "-family {DejaVu Sans} -size 13 -weight normal -slant" \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("609x626+171+285") top.title("Vrex Help") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.TScrolledtext1 = ScrolledText(top) self.TScrolledtext1.place(relx=0.033, rely=0.016, relheight=0.896, relwidth=0.954) self.TScrolledtext1.configure(background="white") self.TScrolledtext1.configure(font=font12) self.TScrolledtext1.configure(insertborderwidth="3") self.TScrolledtext1.configure(selectbackground="#c4c4c4") self.TScrolledtext1.configure(width=10) self.TScrolledtext1.configure(wrap='word') self.Button1 = tk.Button(top) self.Button1.place(relx=0.443, rely=0.927, height=31, width=69) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(command=vrex_help_support.close) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font11) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Close''') self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0)
def nxvforward_main(): global config_use_textarea_log guilog.set_log_stderr() gettext_init() root = tk.Tk() root.title(str_progname + " - " + str_version) app = MyTkAppFrame(root) app.pack(fill="both", expand=True) ttk.Sizegrip(root).pack(side="right") if config_use_textarea_log: guilog.set_log_textarea (app.get_log_text()) root.mainloop()
def __init__(self, master=None): _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" font11 = "-family {DejaVu Sans Mono} -size 14 -weight normal " + \ "-slant roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font10) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) master.configure(background=_bgcolor) master.configure(highlightbackground="wheat") master.configure(highlightcolor="black") self.Button1 = Button(master) self.Button1.place(relx=0.44, rely=0.88, height=33, width=63) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background=_bgcolor) self.Button1.configure(command=cpu_info_support.quit) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font10) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Quit''') self.Scrolledtext1 = ScrolledText(master) self.Scrolledtext1.place(relx=0.04, rely=0.05, relheight=0.77, relwidth=0.92) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font11) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#ddc8a1") self.Scrolledtext1.configure(width=10) self.TSizegrip1 = ttk.Sizegrip(master) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0)
def __init__(self, master=None): _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" font12 = "-family {DejaVu Sans} -size 14 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font10) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) master.configure(highlightbackground="wheat") master.configure(highlightcolor="black") self.TScrolledtext1 = ScrolledText(master) self.TScrolledtext1.place(relx=0.02, rely=0.02, relheight=0.9, relwidth=0.95) self.TScrolledtext1.configure(background="white") self.TScrolledtext1.configure(font=font10) self.TScrolledtext1.configure(insertborderwidth="3") self.TScrolledtext1.configure(selectbackground="#c4c4c4") self.TScrolledtext1.configure(width=10) self.TScrolledtext1.configure(wrap=WORD) self.Button1 = Button(master) self.Button1.place(relx=0.45, rely=0.93, height=30, width=69) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(command=vrex_help_support.close) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font12) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Close''') self.TSizegrip1 = ttk.Sizegrip(master) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0)
def __init__(self, master, **kwargs): """ Initialize. - horizontal scrollbar - vertical scrollbar - text widget """ tk.Frame.__init__(self, master) self.master = master self.textbox = tk.Text(self.master, **kwargs) self.sizegrip = ttk.Sizegrip(self.master) self.hs = ttk.Scrollbar(self.master, orient="horizontal", command=self.on_scrollbar_x) self.vs = ttk.Scrollbar(self.master, orient="vertical", command=self.on_scrollbar_y) self.textbox.configure(yscrollcommand=self.on_textscroll, xscrollcommand=self.hs.set)
def createScrollableFigure(self, figure, master, *args, **kwargs): # create a canvas within the popup window self.popup_canvas = tk.Canvas(master, *args, **kwargs) self.popup_canvas.grid(row=0, column=0, sticky=tk.NSEW) # set up scrollbars xScrollbar = tk.Scrollbar(master, orient=tk.HORIZONTAL) yScrollbar = tk.Scrollbar(master, orient=tk.VERTICAL) xScrollbar.grid(row=1, column=0, sticky=tk.EW) yScrollbar.grid(row=0, column=1, sticky=tk.NS) self.popup_canvas.config(xscrollcommand=xScrollbar.set) xScrollbar.config(command=self.popup_canvas.xview) self.popup_canvas.config(yscrollcommand=yScrollbar.set) yScrollbar.config(command=self.popup_canvas.yview) # add a size grip sizegrip = ttk.Sizegrip(master) sizegrip.grid(row=1, column=1, sticky=tk.SE) # plug in the figure figure_agg = FigureCanvasTkAgg(figure, self.popup_canvas) figure_canvas = figure_agg.get_tk_widget() figure_canvas.grid(sticky=tk.NSEW) self.popup_canvas.bind( '<MouseWheel>', self.scroll_vertical_pop ) # probably just the figure-canvas needs to be bound self.popup_canvas.bind('<Shift-MouseWheel>', self.scroll_horizontal_pop) figure_canvas.bind('<MouseWheel>', self.scroll_vertical_pop) figure_canvas.bind('<Shift-MouseWheel>', self.scroll_horizontal_pop) # lastly, connect figure with scrolling region self.popup_canvas.create_window(0, 0, window=figure_canvas) self.popup_canvas.config(scrollregion=self.popup_canvas.bbox(tk.ALL))
def __init__(self, parent): tk.Frame.__init__(self, parent) self.bg = self.winfo_toplevel().cget("background") self.configure(background=self.bg) sep = ttk.Separator(self, orient="horizontal") sep.pack(side="top", fill="x", padx=4) grip = ttk.Sizegrip(self) grip.pack(side="right") # Why a canvas? I guess I'm trying to be clever and support # text that fades away instead of blinking away. self.canvas = self.CustomCanvas(self, borderwidth=0, highlightthickness=0, background=self.bg) self.canvas.pack(side="left", fill="both", expand=True, padx=(4, 0)) self.canvas.create_text((0, 0), text="X") bbox = self.canvas.bbox("all") (x0, y0, x1, y1) = bbox if bbox is not None else (0, 0, 0, 0) self.canvas.delete("all") border = 2 height = (y1 - y0) + (2 * border) self.canvas.configure(height=height) self.messages = [] self.section = {}
def __init__(self, master=None): _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font10) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) master.configure(highlightbackground="wheat") master.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(master, orient="vertical") self.TPanedwindow1.place(relx=0.03, rely=0.02, relheight=0.83, relwidth=0.96) self.TPanedwindow1.configure(width=585) self.TPanedwindow1_f1 = ttk.Labelframe(height=75, text='Regular Expression') self.TPanedwindow1.add(self.TPanedwindow1_f1) self.TPanedwindow1_f2 = ttk.Labelframe(height=75, text='Sample') self.TPanedwindow1.add(self.TPanedwindow1_f2) self.TPanedwindow1_f3 = ttk.Labelframe(text='Matches') self.TPanedwindow1.add(self.TPanedwindow1_f3) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.Expression = ScrolledText(self.TPanedwindow1_f1) self.Expression.place(relx=0.02, rely=0.2, relheight=0.75, relwidth=0.96) self.Expression.configure(background="white") self.Expression.configure(font="TkTextFont") self.Expression.configure(highlightbackground="wheat") self.Expression.configure(insertborderwidth="3") self.Expression.configure(selectbackground="#c4c4c4") self.Expression.configure(width=10) self.Expression.configure(wrap=NONE) self.Sample = ScrolledText(self.TPanedwindow1_f2) self.Sample.place(relx=0.02, rely=0.2, relheight=0.67, relwidth=0.96) self.Sample.configure(background="white") self.Sample.configure(font="TkTextFont") self.Sample.configure(insertborderwidth="3") self.Sample.configure(selectbackground="#c4c4c4") self.Sample.configure(width=10) self.Sample.configure(wrap=NONE) self.Sample.bind('<Button-1>', vrex_support.sync_matches) self.Matches = ScrolledText(self.TPanedwindow1_f3) self.Matches.place(relx=0.02, rely=0.04, relheight=0.93, relwidth=0.96) self.Matches.configure(background="white") self.Matches.configure(font="TkTextFont") self.Matches.configure(insertborderwidth="3") self.Matches.configure(selectbackground="#c4c4c4") self.Matches.configure(width=10) self.Matches.configure(wrap=NONE) self.Matches.bind('<Button-1>', vrex_support.sync_sample) self.menubar = Menu(master, font=font10, bg=_bgcolor, fg=_fgcolor) master.configure(menu=self.menubar) self.file = Menu(master, tearoff=0) self.menubar.add_cascade(menu=self.file, background="#d9d9d9", font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="File") self.file.add_command(background="#d9d9d9", command=vrex_support.load_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load regular expression") self.file.add_command(background="#d9d9d9", command=vrex_support.save_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save regular expression") self.file.add_separator(background="#d9d9d9") self.file.add_command(background="#d9d9d9", command=vrex_support.load_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load sample") self.file.add_command(background="#d9d9d9", command=vrex_support.save_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save sample") self.file.add_separator(background="#d9d9d9") self.file.add_command(background="#d9d9d9", command=vrex_support.quit, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Quit") self.menubar.add_command(background="#d9d9d9", command=vrex_support.help, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Help") self.Quit = Button(master) self.Quit.place(relx=0.9, rely=0.91, height=25, width=49) self.Quit.configure(activebackground="#f9f9f9") self.Quit.configure(command=vrex_support.quit) self.Quit.configure(disabledforeground="#b8a786") self.Quit.configure(highlightbackground="wheat") self.Quit.configure(text='''Quit''') self.Match = Button(master) self.Match.place(relx=0.16, rely=0.91, height=25, width=61) self.Match.configure(activebackground="#f9f9f9") self.Match.configure(command=lambda: vrex_support.display(0)) self.Match.configure(disabledforeground="#b8a786") self.Match.configure(highlightbackground="wheat") self.Match.configure(text='''Match''') self.Button1 = Button(master) self.Button1.place(relx=0.28, rely=0.91, height=25, width=32) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(background="#ffffff") self.Button1.configure(command=lambda: vrex_support.display(1)) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(foreground="blue") self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''1''') self.Button2 = Button(master) self.Button2.place(relx=0.34, rely=0.91, height=25, width=32) self.Button2.configure(activebackground="#f9f9f9") self.Button2.configure(background="#ffffff") self.Button2.configure(command=lambda: vrex_support.display(2)) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(foreground="darkgreen") self.Button2.configure(highlightbackground="wheat") self.Button2.configure(text='''2''') self.Button3 = Button(master) self.Button3.place(relx=0.41, rely=0.91, height=25, width=32) self.Button3.configure(activebackground="#f9f9f9") self.Button3.configure(background="#ffffff") self.Button3.configure(command=lambda: vrex_support.display(3)) self.Button3.configure(disabledforeground="#b8a786") self.Button3.configure(foreground="magenta") self.Button3.configure(highlightbackground="wheat") self.Button3.configure(text='''3''') self.Button4 = Button(master) self.Button4.place(relx=0.48, rely=0.91, height=25, width=32) self.Button4.configure(activebackground="#f9f9f9") self.Button4.configure(background="#ffffff") self.Button4.configure(command=lambda: vrex_support.display(4)) self.Button4.configure(disabledforeground="#b8a786") self.Button4.configure(foreground="sienna") self.Button4.configure(highlightbackground="wheat") self.Button4.configure(text='''4''') self.Button5 = Button(master) self.Button5.place(relx=0.54, rely=0.91, height=25, width=32) self.Button5.configure(activebackground="#f9f9f9") self.Button5.configure(background="#ffffff") self.Button5.configure(command=lambda: vrex_support.display(5)) self.Button5.configure(disabledforeground="#b8a786") self.Button5.configure(foreground="purple") self.Button5.configure(highlightbackground="wheat") self.Button5.configure(text='''5''') self.Button6 = Button(master) self.Button6.place(relx=0.61, rely=0.91, height=25, width=32) self.Button6.configure(activebackground="#f9f9f9") self.Button6.configure(background="#ffffff") self.Button6.configure(command=lambda: vrex_support.display(6)) self.Button6.configure(disabledforeground="#b8a786") self.Button6.configure(foreground="firebrick") self.Button6.configure(highlightbackground="wheat") self.Button6.configure(text='''6''') self.Button7 = Button(master) self.Button7.place(relx=0.67, rely=0.91, height=25, width=32) self.Button7.configure(activebackground="#f9f9f9") self.Button7.configure(background="#ffffff") self.Button7.configure(command=lambda: vrex_support.display(7)) self.Button7.configure(disabledforeground="#b8a786") self.Button7.configure(foreground="deeppink") self.Button7.configure(highlightbackground="wheat") self.Button7.configure(text='''7''') self.Button8 = Button(master) self.Button8.place(relx=0.74, rely=0.91, height=25, width=32) self.Button8.configure(activebackground="#f9f9f9") self.Button8.configure(background="#ffffff") self.Button8.configure(command=lambda: vrex_support.display(8)) self.Button8.configure(disabledforeground="#b8a786") self.Button8.configure(foreground="green4") self.Button8.configure(highlightbackground="wheat") self.Button8.configure(text='''8''') self.Button9 = Button(master) self.Button9.place(relx=0.8, rely=0.91, height=25, width=32) self.Button9.configure(activebackground="#f9f9f9") self.Button9.configure(background="#ffffff") self.Button9.configure(command=lambda: vrex_support.display(9)) self.Button9.configure(disabledforeground="#b8a786") self.Button9.configure(foreground="deepskyblue1") self.Button9.configure(highlightbackground="wheat") self.Button9.configure(text='''9''') self.Go = Button(master) self.Go.place(relx=0.05, rely=0.91, height=25, width=40) self.Go.configure(activebackground="#f9f9f9") self.Go.configure(command=vrex_support.go) self.Go.configure(disabledforeground="#b8a786") self.Go.configure(highlightbackground="wheat") self.Go.configure(text='''Go''') self.TSizegrip1 = ttk.Sizegrip(master) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" font11 = "TkDefaultFont" font9 = "-family {DejaVu Sans} -size 14 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font=font9) self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("600x881+650+150") top.title("New Toplevel 1") top.configure(background="wheat") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.TButton1 = ttk.Button(top) self.TButton1.place(relx=0.02, rely=0.02, height=32, width=92) self.TButton1.configure(takefocus="") self.TButton1.configure(text='''Tbutton''') self.style.map('TCheckbutton',background= [('selected', _bgcolor), ('active',"_ana2color")]) self.TCheckbutton1 = ttk.Checkbutton(top) self.TCheckbutton1.place(relx=0.03, rely=0.08, relwidth=0.12 , relheight=0.0, height=25) self.TCheckbutton1.configure(variable=themed_support.tch36) self.TCheckbutton1.configure(takefocus="") self.TCheckbutton1.configure(text='''Tcheck''') self.TCombobox1 = ttk.Combobox(top) self.TCombobox1.place(relx=0.03, rely=0.14, relheight=0.02, relwidth=0.3) self.TCombobox1.configure(textvariable=themed_support.combobox) self.TCombobox1.configure(takefocus="") self.TEntry1 = ttk.Entry(top) self.TEntry1.place(relx=0.05, rely=0.19, relheight=0.02, relwidth=0.27) self.TEntry1.configure(takefocus="") self.TEntry1.configure(cursor="xterm") self.TFrame1 = ttk.Frame(top) self.TFrame1.place(relx=0.05, rely=0.24, relheight=0.09, relwidth=0.21) self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(borderwidth="2") self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(width=125) self.TLabelframe1 = ttk.Labelframe(top) self.TLabelframe1.place(relx=0.05, rely=0.39, relheight=0.09 , relwidth=0.25) self.TLabelframe1.configure(text='''Tlabelframe''') self.TLabelframe1.configure(width=150) self.TProgressbar1 = ttk.Progressbar(top) self.TProgressbar1.place(relx=0.45, rely=0.64, relwidth=0.17 , relheight=0.0, height=19) self.style.map('TRadiobutton',background= [('selected', _bgcolor), ('active',"_ana2color")]) self.TRadiobutton1 = ttk.Radiobutton(top) self.TRadiobutton1.place(relx=0.73, rely=0.64, relwidth=0.16 , relheight=0.0, height=23) self.TRadiobutton1.configure(takefocus="") self.TRadiobutton1.configure(text='''TRadio''') self.TScale1 = ttk.Scale(top) self.TScale1.place(relx=0.85, rely=0.41, relwidth=0.0, relheight=0.11 , width=17) self.TScale1.configure(orient="vertical") self.TScale1.configure(takefocus="") self.TScale2 = ttk.Scale(top) self.TScale2.place(relx=0.45, rely=0.68, relwidth=0.17, relheight=0.0 , height=17) self.TScale2.configure(takefocus="") self.Scrolledlistbox1 = ScrolledListBox(top) self.Scrolledlistbox1.place(relx=0.05, rely=0.76, relheight=0.07 , relwidth=0.19) self.Scrolledlistbox1.configure(background="white") self.Scrolledlistbox1.configure(disabledforeground="#b8a786") self.Scrolledlistbox1.configure(font=font11) self.Scrolledlistbox1.configure(highlightbackground="wheat") self.Scrolledlistbox1.configure(highlightcolor="wheat") self.Scrolledlistbox1.configure(selectbackground="#c4c4c4") self.Scrolledlistbox1.configure(width=10) self.Scrolledtext1 = ScrolledText(top) self.Scrolledtext1.place(relx=0.37, rely=0.76, relheight=0.09 , relwidth=0.21) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font10) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#c4c4c4") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap=NONE) self.style.configure('Treeview.Heading', font=font9) self.Scrolledtreeview1 = ScrolledTreeView(top) self.Scrolledtreeview1.place(relx=0.13, rely=0.86, relheight=0.12 , relwidth=0.7) self.Scrolledtreeview1.configure(columns="Col1") self.Scrolledtreeview1.heading("#0",text="Tree") self.Scrolledtreeview1.heading("#0",anchor="center") self.Scrolledtreeview1.column("#0",width="209") self.Scrolledtreeview1.column("#0",minwidth="20") self.Scrolledtreeview1.column("#0",stretch="1") self.Scrolledtreeview1.column("#0",anchor="w") self.Scrolledtreeview1.heading("Col1",text="Col1") self.Scrolledtreeview1.heading("Col1",anchor="center") self.Scrolledtreeview1.column("Col1",width="209") self.Scrolledtreeview1.column("Col1",minwidth="20") self.Scrolledtreeview1.column("Col1",stretch="1") self.Scrolledtreeview1.column("Col1",anchor="w") self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.TLabel1 = ttk.Label(top) self.TLabel1.place(relx=0.05, rely=0.34, height=17, width=37) self.TLabel1.configure(background="wheat") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(relief=FLAT) self.TLabel1.configure(text='''Tlabel''') self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background= [('selected', _compcolor), ('active',_ana2color)]) self.TNotebook1 = ttk.Notebook(top) self.TNotebook1.place(relx=0.43, rely=0.05, relheight=0.26, relwidth=0.5) self.TNotebook1.configure(width=300) self.TNotebook1.configure(takefocus="") self.TNotebook1_t1 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t1, padding=3) self.TNotebook1.tab(0, text="Page 1",underline="-1",) self.TNotebook1_t2 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t2, padding=3) self.TNotebook1.tab(1, text="Page 2",underline="-1",) self.TPanedwindow2 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow2.place(relx=0.03, rely=0.49, relheight=0.23 , relwidth=0.33) self.TPanedwindow2.configure(width=200) self.TPanedwindow2_p1 = ttk.Labelframe(height=75, text='Pane 1') self.TPanedwindow2.add(self.TPanedwindow2_p1) self.TPanedwindow2_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow2.add(self.TPanedwindow2_p2) self.__funcid0 = self.TPanedwindow2.bind('<Map>', self.__adjust_sash0) self.TPanedwindow1 = ttk.Panedwindow(top, orient="horizontal") self.TPanedwindow1.place(relx=0.42, rely=0.34, relheight=0.23 , relwidth=0.33) self.TPanedwindow1.configure(width=200) self.TPanedwindow1_p1 = ttk.Labelframe(width=75, text='Pane 1') self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid1 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash1)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 14 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font11 = "-family {DejaVu Sans} -size 12 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font13 = "-family {DejaVu Sans Mono} -size 11 -weight normal " \ "-slant roman -underline 0 -overstrike 0" font9 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1097x789+235+112") top.title("Two Custom Widgets") top.configure(highlightbackground="#f5deb3") top.configure(highlightcolor="black") self.menubar = Menu(top, font=font10, bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.zoom = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.zoom, activebackground="#f4bcb2", activeforeground="#111111", background="#d9d9d9", font=font11, foreground="#000000", label="Zoom") self.zoom.add_command(activebackground="#f4bcb2", activeforeground="#000000", background="#d9d9d9", command=lambda: dual_support.zoom('in'), font=font11, foreground="#000000", label="Zoom In") self.zoom.add_command(activebackground="#f4bcb2", activeforeground="#000000", background="#d9d9d9", command=lambda: dual_support.zoom('out'), font=font11, foreground="#000000", label="Zoom Out") self.zoom.add_command(activebackground="#f4bcb2", activeforeground="#000000", background="#d9d9d9", command=lambda: dual_support.zoom('default'), font=font11, foreground="#000000", label="Default Size") self.menubar.add_command(activebackground="#f4bcb2", activeforeground="#000000", background="#d9d9d9", command=dual_support.refresh, font=font11, foreground="#000000", label="Refresh") self.menubar.add_command(activebackground="#f4bcb2", activeforeground="#000000", background="#d9d9d9", command=dual_support.quit, font=font11, foreground="#000000", label="Quit") self.Frame1 = Frame(top) self.Frame1.place(relx=0.073, rely=0.101, relheight=0.475, relwidth=0.242) self.Frame1.configure(relief=GROOVE) self.Frame1.configure(borderwidth="2") self.Frame1.configure(relief=GROOVE) self.Frame1.configure(highlightbackground="#f5deb3") self.Frame1.configure(width=265) self.Custom1_4 = dual_support.Custom_g(self.Frame1) self.Custom1_4.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.btnGetChecks = Button(top) self.btnGetChecks.place(relx=0.119, rely=0.621, height=30, width=160) self.btnGetChecks.configure(activebackground="#d9d9d9") self.btnGetChecks.configure(command=dual_support.on_btnGetChecks) self.btnGetChecks.configure(disabledforeground="#b8a786") self.btnGetChecks.configure(font=font9) self.btnGetChecks.configure(highlightbackground="#f5deb3") self.btnGetChecks.configure(text='''Get Checks''') self.btnClearChecks = Button(top) self.btnClearChecks.place(relx=0.119, rely=0.71, height=30, width=160) self.btnClearChecks.configure(activebackground="#d9d9d9") self.btnClearChecks.configure(command=dual_support.on_btnClearChecks) self.btnClearChecks.configure(disabledforeground="#b8a786") self.btnClearChecks.configure(font=font9) self.btnClearChecks.configure(highlightbackground="#f5deb3") self.btnClearChecks.configure(text='''Clear Checks''') self.btnExit = Button(top) self.btnExit.place(relx=0.146, rely=0.824, height=30, width=110) self.btnExit.configure(activebackground="#d9d9d9") self.btnExit.configure(command=dual_support.on_btnExit) self.btnExit.configure(disabledforeground="#b8a786") self.btnExit.configure(font=font9) self.btnExit.configure(highlightbackground="#f5deb3") self.btnExit.configure(text='''Exit''') self.Message1 = Message(top) self.Message1.place(relx=0.009, rely=0.013, relheight=0.08, relwidth=0.384) self.Message1.configure(font=font13) self.Message1.configure(highlightbackground="#f5deb3") self.Message1.configure(relief=SUNKEN) self.Message1.configure(text='''Message''') self.Message1.configure(width=421) self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.TSizegrip1.bind('<ButtonRelease-1>', lambda e: dual_support.refresh()) self.Frame2 = Frame(top) self.Frame2.place(relx=0.428, rely=0.101, relheight=0.639, relwidth=0.506) self.Frame2.configure(relief=GROOVE) self.Frame2.configure(borderwidth="2") self.Frame2.configure(relief=GROOVE) self.Frame2.configure(highlightbackground="#f5deb3") self.Frame2.configure(width=555) self.Custom1 = dual_support.Custom_d(self.Frame2) self.Custom1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
yscrollcommand=output_scroller.set) output_scroller.config(command=output_text.yview) # Buttons apply_button = ttk.Button(seq_panel, text='Apply') clear_button = ttk.Button(seq_panel, text='Clear') close_button = ttk.Button(seq_panel, text='Close', command=main_window.destroy) # Statusbar statustext = tk.StringVar() statusbar = ttk.Label(main_window, textvariable=statustext, relief=tk.GROOVE, padding=5) statustext.set('This is the statusbar') sizegrip = ttk.Sizegrip(statusbar) # Event methods def clear_output(): """Clear the output window.""" input_text.delete(1.0, tk.END) output_text.delete(1.0, tk.END) return def apply_operation(): """Do the selected operation.""" codon_table = codon_list.get(codon_list.curselection()) print('Code: {}'.format(codon_table))
def __init__(self, master=None): _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" font11 = "-family {DejaVu Sans Mono} -size 14 -weight normal " + \ "-slant roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font10) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) master.configure(background=_bgcolor) master.configure(highlightbackground="wheat") master.configure(highlightcolor="black") self.Scrolledtext1 = ScrolledText(master) self.Scrolledtext1.place(relx=0.01, rely=0.28, relheight=0.6, relwidth=0.97) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font11) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#ddc8a1") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap=NONE) self.TSizegrip1 = ttk.Sizegrip(master) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.Button1 = Button(master) self.Button1.place(relx=0.44, rely=0.92, height=33, width=63) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background=_bgcolor) self.Button1.configure(command=WCPE_support.quit) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font10) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Quit''') self.Label1 = Label(master) self.Label1.place(relx=0.05, rely=0.02, height=27, width=185) self.Label1.configure(activebackground="#ffffcd") self.Label1.configure(background=_bgcolor) self.Label1.configure(disabledforeground="#b8a786") self.Label1.configure(font=font10) self.Label1.configure(highlightbackground="wheat") self.Label1.configure(text='''Current Local Time:''') self.Label2 = Label(master) self.Label2.place(relx=0.05, rely=0.06, height=27, width=104) self.Label2.configure(activebackground="#ffffcd") self.Label2.configure(background=_bgcolor) self.Label2.configure(disabledforeground="#b8a786") self.Label2.configure(font=font10) self.Label2.configure(highlightbackground="wheat") self.Label2.configure(text='''Composer:''') self.Label3 = Label(master) self.Label3.place(relx=0.05, rely=0.16, height=27, width=113) self.Label3.configure(activebackground="#ffffcd") self.Label3.configure(background=_bgcolor) self.Label3.configure(disabledforeground="#b8a786") self.Label3.configure(font=font10) self.Label3.configure(highlightbackground="wheat") self.Label3.configure(text='''Performers:''') self.Label4 = Label(master) self.Label4.place(relx=0.05, rely=0.11, height=27, width=49) self.Label4.configure(activebackground="#ffffcd") self.Label4.configure(background=_bgcolor) self.Label4.configure(disabledforeground="#b8a786") self.Label4.configure(font=font10) self.Label4.configure(highlightbackground="wheat") self.Label4.configure(text='''Title:''') self.Label5 = Label(master) self.Label5.place(relx=0.05, rely=0.21, height=27, width=106) self.Label5.configure(activebackground="#ffffcd") self.Label5.configure(background=_bgcolor) self.Label5.configure(disabledforeground="#b8a786") self.Label5.configure(font=font10) self.Label5.configure(highlightbackground="wheat") self.Label5.configure(text='''Start Time:''') self.Label6 = Label(master) self.Label6.place(relx=0.32, rely=0.02, height=27, width=223) self.Label6.configure(activebackground="#ffffcd") self.Label6.configure(anchor=W) self.Label6.configure(background=_bgcolor) self.Label6.configure(disabledforeground="#b8a786") self.Label6.configure(font=font10) self.Label6.configure(highlightbackground="wheat") self.Label6.configure(justify=LEFT) self.Label6.configure(text='''Label''') self.Label6.configure(textvariable=WCPE_support.time_current) self.Label7 = Label(master) self.Label7.place(relx=0.32, rely=0.06, height=27, width=233) self.Label7.configure(activebackground="#ffffcd") self.Label7.configure(anchor=W) self.Label7.configure(background=_bgcolor) self.Label7.configure(disabledforeground="#b8a786") self.Label7.configure(font=font10) self.Label7.configure(highlightbackground="wheat") self.Label7.configure(justify=LEFT) self.Label7.configure(text='''Label''') self.Label7.configure(textvariable=WCPE_support.composer) self.Label8 = Label(master) self.Label8.place(relx=0.32, rely=0.11, height=27, width=483) self.Label8.configure(activebackground="#ffffcd") self.Label8.configure(anchor=W) self.Label8.configure(background=_bgcolor) self.Label8.configure(disabledforeground="#b8a786") self.Label8.configure(font=font10) self.Label8.configure(highlightbackground="wheat") self.Label8.configure(justify=LEFT) self.Label8.configure(text='''Label''') self.Label8.configure(textvariable=WCPE_support.title) self.Label9 = Label(master) self.Label9.place(relx=0.32, rely=0.16, height=27, width=483) self.Label9.configure(activebackground="#ffffcd") self.Label9.configure(anchor=W) self.Label9.configure(background=_bgcolor) self.Label9.configure(disabledforeground="#b8a786") self.Label9.configure(font=font10) self.Label9.configure(highlightbackground="wheat") self.Label9.configure(justify=LEFT) self.Label9.configure(text='''Label''') self.Label9.configure(textvariable=WCPE_support.performers) self.Label10 = Label(master) self.Label10.place(relx=0.32, rely=0.21, height=27, width=483) self.Label10.configure(activebackground="#ffffcd") self.Label10.configure(anchor=W) self.Label10.configure(background=_bgcolor) self.Label10.configure(disabledforeground="#b8a786") self.Label10.configure(font=font10) self.Label10.configure(highlightbackground="wheat") self.Label10.configure(justify=LEFT) self.Label10.configure(text='''Label''') self.Label10.configure(textvariable=WCPE_support.start_time)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 14 -weight normal -slant" \ " roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("811x685+195+72") top.title("Now Playing") top.configure(background="wheat") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") top.bind('<Control-Key-q>', lambda e: rplay_support.c_quit(e)) self.Scrolledtext1 = ScrolledText(top) self.Scrolledtext1.place(relx=0.012, rely=0.19, relheight=0.485, relwidth=0.969) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font10) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#ddc8a1") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap='none') self.Scrolledtext1.bind('<ButtonRelease-1>', lambda e: rplay_support.selection(e)) self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0) self.Button1 = tk.Button(top) self.Button1.place(relx=0.419, rely=0.715, height=51, width=165) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background="wheat") self.Button1.configure(command=rplay_support.previous) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font10) self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''Previous CD's''') self.Label4 = tk.Label(top) self.Label4.place(relx=0.049, rely=0.044, height=26, width=51) self.Label4.configure(activebackground="#ffffcd") self.Label4.configure(background="wheat") self.Label4.configure(disabledforeground="#b8a786") self.Label4.configure(font=font10) self.Label4.configure(highlightbackground="wheat") self.Label4.configure(text='''Title:''') self.Label5 = tk.Label(top) self.Label5.place(relx=0.049, rely=0.131, height=26, width=110) self.Label5.configure(activebackground="#ffffcd") self.Label5.configure(background="wheat") self.Label5.configure(disabledforeground="#b8a786") self.Label5.configure(font=font10) self.Label5.configure(highlightbackground="wheat") self.Label5.configure(text='''Start Time:''') self.Label10 = tk.Label(top) self.Label10.place(relx=0.321, rely=0.131, height=27, width=483) self.Label10.configure(activebackground="#ffffcd") self.Label10.configure(anchor='w') self.Label10.configure(background="wheat") self.Label10.configure(disabledforeground="#b8a786") self.Label10.configure(font=font10) self.Label10.configure(highlightbackground="wheat") self.Label10.configure(justify='left') self.Label10.configure(text='''Label''') self.Label10.configure(textvariable=rplay_support.start_time) self.Button2 = tk.Button(top) self.Button2.place(relx=0.074, rely=0.818, height=51, width=165) self.Button2.configure(activebackground="#f4bcb2") self.Button2.configure(background="wheat") self.Button2.configure(command=rplay_support.new_album) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(font=font10) self.Button2.configure(highlightbackground="wheat") self.Button2.configure(text='''New Album''') self.Button3 = tk.Button(top) self.Button3.place(relx=0.74, rely=0.818, height=51, width=165) self.Button3.configure(activebackground="#f4bcb2") self.Button3.configure(background="wheat") self.Button3.configure(command=rplay_support.quit) self.Button3.configure(disabledforeground="#b8a786") self.Button3.configure(font=font10) self.Button3.configure(highlightbackground="wheat") self.Button3.configure(text='''Quit''') self.Button4 = tk.Button(top) self.Button4.place(relx=0.074, rely=0.715, height=51, width=165) self.Button4.configure(activebackground="#f4bcb2") self.Button4.configure(background="wheat") self.Button4.configure(command=rplay_support.repeat_cd) self.Button4.configure(disabledforeground="#b8a786") self.Button4.configure(font=font10) self.Button4.configure(highlightbackground="wheat") self.Button4.configure(text='''Repeat CD''') self.Button5 = tk.Button(top) self.Button5.place(relx=0.419, rely=0.818, height=51, width=165) self.Button5.configure(activebackground="#f4bcb2") self.Button5.configure(background="wheat") self.Button5.configure(command=rplay_support.cont) self.Button5.configure(disabledforeground="#b8a786") self.Button5.configure(font=font10) self.Button5.configure(highlightbackground="wheat") self.Button5.configure(text='''Continue''') self.Button6 = tk.Button(top) self.Button6.place(relx=0.74, rely=0.715, height=51, width=165) self.Button6.configure(activebackground="#f4bcb2") self.Button6.configure(background="wheat") self.Button6.configure(command=rplay_support.stop) self.Button6.configure(disabledforeground="#b8a786") self.Button6.configure(font=font10) self.Button6.configure(highlightbackground="wheat") self.Button6.configure(text='''Stop''') self.Scrolledtext2 = ScrolledText(top) self.Scrolledtext2.place(relx=0.197, rely=0.015, relheight=0.08, relwidth=0.663) self.Scrolledtext2.configure(background="white") self.Scrolledtext2.configure(font=font10) self.Scrolledtext2.configure(highlightbackground="wheat") self.Scrolledtext2.configure(insertborderwidth="3") self.Scrolledtext2.configure(selectbackground="#ddc8a1") self.Scrolledtext2.configure(width=10) self.Scrolledtext2.configure(wrap='word') self.Button7 = tk.Button(top) self.Button7.place(relx=0.21, rely=0.92, height=34, width=92) self.Button7.configure(activebackground="#f4bcb2") self.Button7.configure(background="wheat") self.Button7.configure(command=rplay_support.search) self.Button7.configure(disabledforeground="#b8a786") self.Button7.configure(font=font10) self.Button7.configure(highlightbackground="wheat") self.Button7.configure(text='''Search''') self.Entry1 = tk.Entry(top) self.Entry1.place(relx=0.444, rely=0.92, height=28, relwidth=0.303) self.Entry1.configure(background="white") self.Entry1.configure(disabledforeground="#b8a786") self.Entry1.configure(font=font10) self.Entry1.configure(highlightbackground="#f5deb3") self.Entry1.configure(selectbackground="#ddc8a1") self.Entry1.configure(textvariable=rplay_support.criteria) self.Entry1.bind('<Key-Return>', lambda e: rplay_support.search())
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 14 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font4 = "-family helvetica -size 12 -weight bold -slant roman " \ "-underline 0 -overstrike 0" font9 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("609x642+617+155") top.title("Vrex for Python") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.016, rely=0.016, relheight=0.826, relwidth=0.961) self.TPanedwindow1.configure(width=585) self.TPanedwindow1_f1 = ttk.Labelframe(height=85, text='Regular Expression') self.TPanedwindow1.add(self.TPanedwindow1_f1) self.TPanedwindow1_f2 = ttk.Labelframe(height=91.0, text='Sample') self.TPanedwindow1.add(self.TPanedwindow1_f2) self.TPanedwindow1_f3 = ttk.Labelframe(text='Matches') self.TPanedwindow1.add(self.TPanedwindow1_f3) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.Expression = ScrolledText(self.TPanedwindow1_f1) self.Expression.place(relx=0.017, rely=0.353, relheight=0.541, relwidth=0.959, bordermode='ignore') self.Expression.configure(background="white") self.Expression.configure(font=font4) self.Expression.configure(highlightbackground="wheat") self.Expression.configure(insertborderwidth="3") self.Expression.configure(selectbackground="#c4c4c4") self.Expression.configure(width=10) self.Expression.configure(wrap='none') self.Sample = ScrolledText(self.TPanedwindow1_f2) self.Sample.place(relx=0.017, rely=0.33, relheight=0.549, relwidth=0.959, bordermode='ignore') self.Sample.configure(background="white") self.Sample.configure(font=font4) self.Sample.configure(insertborderwidth="3") self.Sample.configure(selectbackground="#c4c4c4") self.Sample.configure(width=10) self.Sample.configure(wrap='none') self.Sample.bind('<Button-1>', vrex_support.sync_matches) self.Matches = ScrolledText(self.TPanedwindow1_f3) self.Matches.place(relx=0.017, rely=0.087, relheight=0.887, relwidth=0.959, bordermode='ignore') self.Matches.configure(background="white") self.Matches.configure(font=font4) self.Matches.configure(insertborderwidth="3") self.Matches.configure(selectbackground="#c4c4c4") self.Matches.configure(width=10) self.Matches.configure(wrap='none') self.Matches.bind('<Button-1>', vrex_support.sync_sample) self.menubar = tk.Menu(top, font=font10, bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.sub_menu = tk.Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.sub_menu, background="#d9d9d9", font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="File") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.load_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load regular expression") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.save_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save regular expression") self.sub_menu.add_separator(background="#d9d9d9") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.load_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load sample") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.save_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save sample") self.sub_menu.add_separator(background="#d9d9d9") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.quit, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Quit") self.menubar.add_command(background="#d9d9d9", command=vrex_support.help, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Help") self.Quit = tk.Button(top) self.Quit.place(relx=0.895, rely=0.857, height=26, width=51) self.Quit.configure(activebackground="#f9f9f9") self.Quit.configure(command=vrex_support.quit) self.Quit.configure(disabledforeground="#b8a786") self.Quit.configure(highlightbackground="wheat") self.Quit.configure(text='''Quit''') self.Match = tk.Button(top) self.Match.place(relx=0.123, rely=0.857, height=26, width=63) self.Match.configure(activebackground="#f9f9f9") self.Match.configure(command=lambda: vrex_support.display(0)) self.Match.configure(disabledforeground="#b8a786") self.Match.configure(highlightbackground="wheat") self.Match.configure(text='''Match''') self.Button1 = tk.Button(top) self.Button1.place(relx=0.279, rely=0.857, height=26, width=34) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(background="#ffffff") self.Button1.configure(command=lambda: vrex_support.display(1)) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(foreground="blue") self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''1''') self.Button2 = tk.Button(top) self.Button2.place(relx=0.345, rely=0.857, height=26, width=34) self.Button2.configure(activebackground="#f9f9f9") self.Button2.configure(background="#ffffff") self.Button2.configure(command=lambda: vrex_support.display(2)) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(foreground="darkgreen") self.Button2.configure(highlightbackground="wheat") self.Button2.configure(text='''2''') self.Button3 = tk.Button(top) self.Button3.place(relx=0.411, rely=0.857, height=26, width=34) self.Button3.configure(activebackground="#f9f9f9") self.Button3.configure(background="#ffffff") self.Button3.configure(command=lambda: vrex_support.display(3)) self.Button3.configure(disabledforeground="#b8a786") self.Button3.configure(foreground="magenta") self.Button3.configure(highlightbackground="wheat") self.Button3.configure(text='''3''') self.Button4 = tk.Button(top) self.Button4.place(relx=0.476, rely=0.857, height=26, width=34) self.Button4.configure(activebackground="#f9f9f9") self.Button4.configure(background="#ffffff") self.Button4.configure(command=lambda: vrex_support.display(4)) self.Button4.configure(disabledforeground="#b8a786") self.Button4.configure(foreground="sienna") self.Button4.configure(highlightbackground="wheat") self.Button4.configure(text='''4''') self.Button5 = tk.Button(top) self.Button5.place(relx=0.542, rely=0.857, height=26, width=34) self.Button5.configure(activebackground="#f9f9f9") self.Button5.configure(background="#ffffff") self.Button5.configure(command=lambda: vrex_support.display(5)) self.Button5.configure(disabledforeground="#b8a786") self.Button5.configure(foreground="purple") self.Button5.configure(highlightbackground="wheat") self.Button5.configure(text='''5''') self.Button6 = tk.Button(top) self.Button6.place(relx=0.608, rely=0.857, height=26, width=34) self.Button6.configure(activebackground="#f9f9f9") self.Button6.configure(background="#ffffff") self.Button6.configure(command=lambda: vrex_support.display(6)) self.Button6.configure(disabledforeground="#b8a786") self.Button6.configure(foreground="firebrick") self.Button6.configure(highlightbackground="wheat") self.Button6.configure(text='''6''') self.Button7 = tk.Button(top) self.Button7.place(relx=0.673, rely=0.857, height=26, width=34) self.Button7.configure(activebackground="#f9f9f9") self.Button7.configure(background="#ffffff") self.Button7.configure(command=lambda: vrex_support.display(7)) self.Button7.configure(disabledforeground="#b8a786") self.Button7.configure(foreground="deeppink") self.Button7.configure(highlightbackground="wheat") self.Button7.configure(text='''7''') self.Button8 = tk.Button(top) self.Button8.place(relx=0.739, rely=0.857, height=26, width=34) self.Button8.configure(activebackground="#f9f9f9") self.Button8.configure(background="#ffffff") self.Button8.configure(command=lambda: vrex_support.display(8)) self.Button8.configure(disabledforeground="#b8a786") self.Button8.configure(foreground="green4") self.Button8.configure(highlightbackground="wheat") self.Button8.configure(text='''8''') self.Button9 = tk.Button(top) self.Button9.place(relx=0.805, rely=0.857, height=26, width=34) self.Button9.configure(activebackground="#f9f9f9") self.Button9.configure(background="#ffffff") self.Button9.configure(command=lambda: vrex_support.display(9)) self.Button9.configure(disabledforeground="#b8a786") self.Button9.configure(foreground="deepskyblue1") self.Button9.configure(highlightbackground="wheat") self.Button9.configure(text='''9''') self.Go = tk.Button(top) self.Go.place(relx=0.016, rely=0.857, height=26, width=42) self.Go.configure(activebackground="#f9f9f9") self.Go.configure(command=vrex_support.go) self.Go.configure(disabledforeground="#b8a786") self.Go.configure(highlightbackground="wheat") self.Go.configure(text='''Go''') self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' font10 = "-family {Courier New} -size 10 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font11 = "-family {Segoe UI} -size 22 -weight normal -slant " \ "roman -underline 0 -overstrike 0" font9 = "-family {Segoe UI} -size 9 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("1448x904+102+71") top.title("Showcase GUI") top.configure(background="#ffffff") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.menubar = Menu(top, font=font9, bg='wheat', fg=_fgcolor) top.configure(menu=self.menubar) self.file = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.file, activebackground="#d8d8d8", activeforeground="#111111", background="wheat", font="TkMenuFont", foreground="#000000", label="File") self.file.add_command(activebackground="#d8d8d8", activeforeground="#000000", background="wheat", command=gui_support.Save, font="TkMenuFont", foreground="#000000", label="Save") self.file.add_separator(background="wheat") self.file.add_command(activebackground="#d8d8d8", activeforeground="#000000", background="wheat", command=gui_support.Quit, font="TkMenuFont", foreground="#000000", label="Quit") self.edit = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.edit, activebackground="#d8d8d8", activeforeground="#111111", background="wheat", font="TkMenuFont", foreground="#000000", label="Edit") self.TFrame1 = ttk.Frame(top) self.TFrame1.place(relx=0.0, rely=0.11, relheight=0.92, relwidth=0.99) self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(borderwidth="2") self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(width=1435) self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background=[('selected', _compcolor), ('active', _ana2color)]) self.tFr39_tNo40 = ttk.Notebook(self.TFrame1) self.tFr39_tNo40.place(relx=0.01, rely=0.01, relheight=0.96, relwidth=0.98) self.TNotebook1_t1 = ttk.Frame(self.tFr39_tNo40) self.tFr39_tNo40.add(self.TNotebook1_t1, padding=3) self.tFr39_tNo40.tab( 0, text="Error Detection", underline="-1", ) self.TNotebook1_t2 = ttk.Frame(self.tFr39_tNo40) self.tFr39_tNo40.add(self.TNotebook1_t2, padding=3) self.tFr39_tNo40.tab( 1, text="Spectral Scan", underline="-1", ) self.TNotebook1_t3 = ttk.Frame(self.tFr39_tNo40) self.tFr39_tNo40.add(self.TNotebook1_t3, padding=3) self.tFr39_tNo40.tab( 2, text="USRP Conf", underline="-1", ) self.TNotebook1_t4 = ttk.Frame(self.tFr39_tNo40) self.tFr39_tNo40.add(self.TNotebook1_t4, padding=3) self.tFr39_tNo40.tab( 3, text="Gateway Conf", underline="-1", ) self.LabelframeTopology = LabelFrame(self.TNotebook1_t1) self.LabelframeTopology.place(relx=0.02, rely=0.01, relheight=0.42, relwidth=0.36) self.LabelframeTopology.configure(relief=GROOVE) self.LabelframeTopology.configure(foreground="black") self.LabelframeTopology.configure(text='''Topology''') self.LabelframeTopology.configure(background="#d9d9d9") self.LabelframeTopology.configure(highlightbackground="#d9d9d9") self.LabelframeTopology.configure(highlightcolor="black") self.LabelframeTopology.configure(width=500) self.LabelTopologyImage = Label(self.LabelframeTopology) self.LabelTopologyImage.place(relx=0.01, rely=0.06, height=271, width=464) self.LabelTopologyImage.configure(activebackground="#f9f9f9") self.LabelTopologyImage.configure(activeforeground="black") self.LabelTopologyImage.configure(background="#d9d9d9") self.LabelTopologyImage.configure(disabledforeground="#a3a3a3") self.LabelTopologyImage.configure(foreground="#000000") self.LabelTopologyImage.configure(highlightbackground="#d9d9d9") self.LabelTopologyImage.configure(highlightcolor="black") self._img1 = PhotoImage(file="./topology_final.png") self.LabelTopologyImage.configure(image=self._img1) self.LabelframeMonitor = LabelFrame(self.TNotebook1_t1) self.LabelframeMonitor.place(relx=0.02, rely=0.67, relheight=0.32, relwidth=0.97) self.LabelframeMonitor.configure(relief=GROOVE) self.LabelframeMonitor.configure(foreground="black") self.LabelframeMonitor.configure(text='''Channel Time''') self.LabelframeMonitor.configure(background="#d9d9d9") self.LabelframeMonitor.configure(highlightbackground="#d9d9d9") self.LabelframeMonitor.configure(highlightcolor="black") self.LabelframeMonitor.configure(width=1360) self.LabelframeDetection1 = LabelFrame(self.TNotebook1_t1) self.LabelframeDetection1.place(relx=0.55, rely=0.01, relheight=0.42, relwidth=0.44) self.LabelframeDetection1.configure(relief=GROOVE) self.LabelframeDetection1.configure(foreground="black") self.LabelframeDetection1.configure(text='''Technology Detection''') self.LabelframeDetection1.configure(background="#d9d9d9") self.LabelframeDetection1.configure(highlightbackground="#d9d9d9") self.LabelframeDetection1.configure(highlightcolor="black") self.LabelframeDetection1.configure(width=620) self.LabelframeController = LabelFrame(self.TNotebook1_t1) self.LabelframeController.place(relx=0.39, rely=0.01, relheight=0.42, relwidth=0.16) self.LabelframeController.configure(relief=GROOVE) self.LabelframeController.configure(foreground="black") self.LabelframeController.configure(text='''Controller''') self.LabelframeController.configure(background="#d9d9d9") self.LabelframeController.configure(highlightbackground="#d9d9d9") self.LabelframeController.configure(highlightcolor="black") self.LabelframeController.configure(width=220) self.RadiobuttonRadiobuttonWifiOn = Radiobutton( self.LabelframeController) self.RadiobuttonRadiobuttonWifiOn.place(relx=0.68, rely=0.09, relheight=0.08, relwidth=0.25) self.RadiobuttonRadiobuttonWifiOn.configure(activebackground="#f4bcb2") self.RadiobuttonRadiobuttonWifiOn.configure(activeforeground="black") self.RadiobuttonRadiobuttonWifiOn.configure(background="#d9d9d9") self.RadiobuttonRadiobuttonWifiOn.configure( disabledforeground="#a3a3a3") self.RadiobuttonRadiobuttonWifiOn.configure(foreground="#000000") self.RadiobuttonRadiobuttonWifiOn.configure( highlightbackground="#d9d9d9") self.RadiobuttonRadiobuttonWifiOn.configure(highlightcolor="black") self.RadiobuttonRadiobuttonWifiOn.configure(indicatoron="0") self.RadiobuttonRadiobuttonWifiOn.configure(justify=LEFT) self.RadiobuttonRadiobuttonWifiOn.configure(text='''On''') self.RadiobuttonRadiobuttonWifiOn.configure(value="1") self.RadiobuttonRadiobuttonWifiOn.configure( variable=gui_support.wifiActivation) self.RadiobuttonWifiOff = Radiobutton(self.LabelframeController) self.RadiobuttonWifiOff.place(relx=0.39, rely=0.09, relheight=0.08, relwidth=0.26) self.RadiobuttonWifiOff.configure(activebackground="#f4bcb2") self.RadiobuttonWifiOff.configure(activeforeground="black") self.RadiobuttonWifiOff.configure(background="#d9d9d9") self.RadiobuttonWifiOff.configure(disabledforeground="#a3a3a3") self.RadiobuttonWifiOff.configure(foreground="#000000") self.RadiobuttonWifiOff.configure(highlightbackground="#d9d9d9") self.RadiobuttonWifiOff.configure(highlightcolor="black") self.RadiobuttonWifiOff.configure(indicatoron="0") self.RadiobuttonWifiOff.configure(justify=LEFT) self.RadiobuttonWifiOff.configure(text='''Off''') self.RadiobuttonWifiOff.configure(value="0") self.RadiobuttonWifiOff.configure(variable=gui_support.wifiActivation) self.LabelWiFi = Label(self.LabelframeController) self.LabelWiFi.place(relx=0.14, rely=0.09, height=21, width=29) self.LabelWiFi.configure(activebackground="#f9f9f9") self.LabelWiFi.configure(activeforeground="black") self.LabelWiFi.configure(background="#d9d9d9") self.LabelWiFi.configure(disabledforeground="#a3a3a3") self.LabelWiFi.configure(foreground="#000000") self.LabelWiFi.configure(highlightbackground="#d9d9d9") self.LabelWiFi.configure(highlightcolor="black") self.LabelWiFi.configure(text='''WiFi''') self.LabelLte = Label(self.LabelframeController) self.LabelLte.place(relx=0.14, rely=0.28, height=21, width=29) self.LabelLte.configure(activebackground="#f9f9f9") self.LabelLte.configure(activeforeground="black") self.LabelLte.configure(background="#d9d9d9") self.LabelLte.configure(disabledforeground="#a3a3a3") self.LabelLte.configure(foreground="#000000") self.LabelLte.configure(highlightbackground="#d9d9d9") self.LabelLte.configure(highlightcolor="black") self.LabelLte.configure(text='''LTE''') self.RadiobuttonLteOff = Radiobutton(self.LabelframeController) self.RadiobuttonLteOff.place(relx=0.39, rely=0.28, relheight=0.08, relwidth=0.26) self.RadiobuttonLteOff.configure(activebackground="#f4bcb2") self.RadiobuttonLteOff.configure(activeforeground="black") self.RadiobuttonLteOff.configure(background="#d9d9d9") self.RadiobuttonLteOff.configure(disabledforeground="#a3a3a3") self.RadiobuttonLteOff.configure(foreground="#000000") self.RadiobuttonLteOff.configure(highlightbackground="#d9d9d9") self.RadiobuttonLteOff.configure(highlightcolor="black") self.RadiobuttonLteOff.configure(indicatoron="0") self.RadiobuttonLteOff.configure(justify=LEFT) self.RadiobuttonLteOff.configure(text='''Off''') self.RadiobuttonLteOff.configure(value="0") self.RadiobuttonLteOff.configure(variable=gui_support.lteActivation) self.RadiobuttonLteOn = Radiobutton(self.LabelframeController) self.RadiobuttonLteOn.place(relx=0.68, rely=0.28, relheight=0.08, relwidth=0.25) self.RadiobuttonLteOn.configure(activebackground="#f4bcb2") self.RadiobuttonLteOn.configure(activeforeground="black") self.RadiobuttonLteOn.configure(background="#d9d9d9") self.RadiobuttonLteOn.configure(disabledforeground="#a3a3a3") self.RadiobuttonLteOn.configure(foreground="#000000") self.RadiobuttonLteOn.configure(highlightbackground="#d9d9d9") self.RadiobuttonLteOn.configure(highlightcolor="black") self.RadiobuttonLteOn.configure(indicatoron="0") self.RadiobuttonLteOn.configure(justify=LEFT) self.RadiobuttonLteOn.configure(text='''On''') self.RadiobuttonLteOn.configure(value="1") self.RadiobuttonLteOn.configure(variable=gui_support.lteActivation) self.Label3 = Label(self.LabelframeController) self.Label3.place(relx=0.14, rely=0.46, height=21, width=40) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''TDMA''') self.RadiobuttonTdmaOff = Radiobutton(self.LabelframeController) self.RadiobuttonTdmaOff.place(relx=0.36, rely=0.45, relheight=0.08, relwidth=0.26) self.RadiobuttonTdmaOff.configure(activebackground="#f4bcb2") self.RadiobuttonTdmaOff.configure(activeforeground="#000000") self.RadiobuttonTdmaOff.configure(background="#d9d9d9") self.RadiobuttonTdmaOff.configure(disabledforeground="#a3a3a3") self.RadiobuttonTdmaOff.configure(foreground="#000000") self.RadiobuttonTdmaOff.configure(highlightbackground="#d9d9d9") self.RadiobuttonTdmaOff.configure(highlightcolor="black") self.RadiobuttonTdmaOff.configure(indicatoron="0") self.RadiobuttonTdmaOff.configure(justify=LEFT) self.RadiobuttonTdmaOff.configure(text='''Off''') self.RadiobuttonTdmaOff.configure(value="0") self.RadiobuttonTdmaOff.configure(variable=gui_support.tdmaActivation) self.RadiobuttonTdmaOn = Radiobutton(self.LabelframeController) self.RadiobuttonTdmaOn.place(relx=0.68, rely=0.45, relheight=0.08, relwidth=0.26) self.RadiobuttonTdmaOn.configure(activebackground="#f4bcb2") self.RadiobuttonTdmaOn.configure(activeforeground="#000000") self.RadiobuttonTdmaOn.configure(background="#d9d9d9") self.RadiobuttonTdmaOn.configure(disabledforeground="#a3a3a3") self.RadiobuttonTdmaOn.configure(foreground="#000000") self.RadiobuttonTdmaOn.configure(highlightbackground="#d9d9d9") self.RadiobuttonTdmaOn.configure(highlightcolor="black") self.RadiobuttonTdmaOn.configure(indicatoron="0") self.RadiobuttonTdmaOn.configure(justify=LEFT) self.RadiobuttonTdmaOn.configure(text='''On''') self.RadiobuttonTdmaOn.configure(value="1") self.RadiobuttonTdmaOn.configure(variable=gui_support.tdmaActivation) self.LabelframeLog = LabelFrame(self.TNotebook1_t1) self.LabelframeLog.place(relx=0.02, rely=0.44, relheight=0.23, relwidth=0.97) self.LabelframeLog.configure(relief=GROOVE) self.LabelframeLog.configure(foreground="black") self.LabelframeLog.configure(text='''Solution Global Controller LOG''') self.LabelframeLog.configure(background="#d9d9d9") self.LabelframeLog.configure(highlightbackground="#d9d9d9") self.LabelframeLog.configure(highlightcolor="black") self.LabelframeLog.configure(width=1360) self.ListboxLog = Listbox(self.LabelframeLog) self.ListboxLog.place(relx=0.01, rely=0.11, relheight=0.81, relwidth=0.97) self.ListboxLog.configure(background="white") self.ListboxLog.configure(disabledforeground="#a3a3a3") self.ListboxLog.configure(font=font10) self.ListboxLog.configure(foreground="#000000") self.ListboxLog.configure(highlightbackground="#d9d9d9") self.ListboxLog.configure(highlightcolor="black") self.ListboxLog.configure(selectbackground="#c4c4c4") self.ListboxLog.configure(selectforeground="black") self.ListboxLog.configure(width=1324) self.LabelframeWaterFall = LabelFrame(self.TNotebook1_t2) self.LabelframeWaterFall.place(relx=0.01, rely=0.01, relheight=0.83, relwidth=0.99) self.LabelframeWaterFall.configure(relief=GROOVE) self.LabelframeWaterFall.configure(foreground="black") self.LabelframeWaterFall.configure(text='''Spectral''') self.LabelframeWaterFall.configure(background="#d9d9d9") self.LabelframeWaterFall.configure(highlightbackground="#d9d9d9") self.LabelframeWaterFall.configure(highlightcolor="black") self.LabelframeWaterFall.configure(width=1380) self.GatewayConfFrame = LabelFrame(self.TNotebook1_t4) self.GatewayConfFrame.place(relx=0.01, rely=0.01, relheight=0.41, relwidth=0.66) self.GatewayConfFrame.configure(relief=GROOVE) self.GatewayConfFrame.configure(foreground="black") self.GatewayConfFrame.configure(text='''Gateway Conf''') self.GatewayConfFrame.configure(background="#d9d9d9") self.GatewayConfFrame.configure(highlightbackground="#d9d9d9") self.GatewayConfFrame.configure(highlightcolor="black") self.GatewayConfFrame.configure(width=920) self.FileDialogButton = Button(self.GatewayConfFrame) self.FileDialogButton.place(relx=0.6, rely=0.16, height=24, width=51) self.FileDialogButton.configure(activebackground="#f4bcb2") self.FileDialogButton.configure(activeforeground="black") self.FileDialogButton.configure(background="#d9d9d9") self.FileDialogButton.configure(command=gui_support.OpenFileDialog) self.FileDialogButton.configure(disabledforeground="#a3a3a3") self.FileDialogButton.configure(foreground="#000000") self.FileDialogButton.configure(highlightbackground="#d9d9d9") self.FileDialogButton.configure(highlightcolor="black") self.FileDialogButton.configure(pady="0") self.FileDialogButton.configure(text='''Select...''') self.SelectGatewayFileLabel = Label(self.GatewayConfFrame) self.SelectGatewayFileLabel.place(relx=0.03, rely=0.16, height=21, width=124) self.SelectGatewayFileLabel.configure(activebackground="#f9f9f9") self.SelectGatewayFileLabel.configure(activeforeground="black") self.SelectGatewayFileLabel.configure(background="#d9d9d9") self.SelectGatewayFileLabel.configure(disabledforeground="#a3a3a3") self.SelectGatewayFileLabel.configure(foreground="#000000") self.SelectGatewayFileLabel.configure(highlightbackground="#d9d9d9") self.SelectGatewayFileLabel.configure(highlightcolor="black") self.SelectGatewayFileLabel.configure(text='''Select Gateway File''') self.StartGatewayButton = Button(self.GatewayConfFrame) self.StartGatewayButton.place(relx=0.04, rely=0.29, height=24, width=167) self.StartGatewayButton.configure(activebackground="#f4bcb2") self.StartGatewayButton.configure(activeforeground="black") self.StartGatewayButton.configure(background="#d9d9d9") self.StartGatewayButton.configure( command=gui_support.StartGatewayCommand) self.StartGatewayButton.configure(disabledforeground="#a3a3a3") self.StartGatewayButton.configure(foreground="#000000") self.StartGatewayButton.configure(highlightbackground="#d9d9d9") self.StartGatewayButton.configure(highlightcolor="black") self.StartGatewayButton.configure(pady="0") self.StartGatewayButton.configure(text='''Start Gateway''') self.StopGatewayButton = Button(self.GatewayConfFrame) self.StopGatewayButton.place(relx=0.26, rely=0.29, height=24, width=167) self.StopGatewayButton.configure(activebackground="#f4bcb2") self.StopGatewayButton.configure(activeforeground="black") self.StopGatewayButton.configure(background="#d9d9d9") self.StopGatewayButton.configure( command=gui_support.StopGatewayCommand) self.StopGatewayButton.configure(disabledforeground="#a3a3a3") self.StopGatewayButton.configure(foreground="#000000") self.StopGatewayButton.configure(highlightbackground="#d9d9d9") self.StopGatewayButton.configure(highlightcolor="black") self.StopGatewayButton.configure(pady="0") self.StopGatewayButton.configure(text='''Stop Gateway''') self.GatewayFilePathEntry = Entry(self.GatewayConfFrame) self.GatewayFilePathEntry.place(relx=0.17, rely=0.16, relheight=0.06, relwidth=0.41) self.GatewayFilePathEntry.configure(background="white") self.GatewayFilePathEntry.configure(disabledforeground="#a3a3a3") self.GatewayFilePathEntry.configure(font="TkFixedFont") self.GatewayFilePathEntry.configure(foreground="#000000") self.GatewayFilePathEntry.configure(highlightbackground="#d9d9d9") self.GatewayFilePathEntry.configure(highlightcolor="black") self.GatewayFilePathEntry.configure(insertbackground="black") self.GatewayFilePathEntry.configure(selectbackground="#c4c4c4") self.GatewayFilePathEntry.configure(selectforeground="black") self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.LabelDemoTitle = Label(top) self.LabelDemoTitle.place(relx=0.36, rely=0.04, height=31, width=434) self.LabelDemoTitle.configure(activebackground="#ffffff") self.LabelDemoTitle.configure(activeforeground="black") self.LabelDemoTitle.configure(background="#ffffff") self.LabelDemoTitle.configure(disabledforeground="#a3a3a3") self.LabelDemoTitle.configure(font=font11) self.LabelDemoTitle.configure(foreground="#000000") self.LabelDemoTitle.configure(highlightbackground="#d9d9d9") self.LabelDemoTitle.configure(highlightcolor="black") self.LabelDemoTitle.configure(text='''Interference Recognition''') self.Label1 = Label(top) self.Label1.place(relx=0.06, rely=-0.01, height=109, width=386) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#ffffff") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self._img2 = PhotoImage(file="./logo_wishful.png") self.Label1.configure(image=self._img2) self.Label1.configure(text='''Label''') self.Label2 = Label(top) self.Label2.place(relx=0.65, rely=0.0, height=82, width=392) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(activeforeground="black") self.Label2.configure(background="#ffffff") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(highlightbackground="#d9d9d9") self.Label2.configure(highlightcolor="black") self._img3 = PhotoImage(file="./logo_cnit2.png") self.Label2.configure(image=self._img3) self.Label2.configure(text='''Label''')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#f5deb3' # X11 color: 'wheat' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font9 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("565x513+650+150") top.title("Complex Example") top.configure(background="#f5deb3") top.configure(highlightbackground="#f5deb3") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.05, rely=0.06, relheight=0.8, relwidth=0.88) self.TPanedwindow1.configure(width=200) self.TPanedwindow1_p1 = ttk.Labelframe(height=75, text='Pane 1') self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.TPanedwindow2 = ttk.Panedwindow(self.TPanedwindow1_p2, orient="horizontal") self.TPanedwindow2.place(relx=0.08, rely=0.09, relheight=0.85, relwidth=0.86) self.TPanedwindow2.configure(width=200) self.TPanedwindow2_p1 = ttk.Labelframe(width=85, text='Pane 1') self.TPanedwindow2.add(self.TPanedwindow2_p1) self.TPanedwindow2_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow2.add(self.TPanedwindow2_p2) self.__funcid1 = self.TPanedwindow2.bind('<Map>', self.__adjust_sash1) self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background=[('selected', _compcolor), ('active', _ana2color)]) self.TNotebook1 = ttk.Notebook(self.TPanedwindow2_p2) self.TNotebook1.place(relx=0.06, rely=0.11, relheight=0.83, relwidth=0.89) self.TNotebook1.configure(width=300) self.TNotebook1.configure(takefocus="") self.TNotebook1_t1 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t1, padding=3) self.TNotebook1.tab( 0, text="Page 1", underline="-1", ) self.TNotebook1_t2 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t2, padding=3) self.TNotebook1.tab( 1, text="Page 2", underline="-1", ) self.Label1 = Label(self.TNotebook1_t1) self.Label1.place(relx=0.13, rely=0.2, height=27, width=114) self.Label1.configure(activebackground="#ffffcd") self.Label1.configure(background="#f5deb3") self.Label1.configure(disabledforeground="#b8a786") self.Label1.configure(font=font9) self.Label1.configure(highlightbackground="#f5deb3") self.Label1.configure(text='''First Page''') self.Button2 = Button(self.TNotebook1_t1) self.Button2.place(relx=0.37, rely=0.5, height=35, width=70) self.Button2.configure(activebackground="#f4bcb2") self.Button2.configure(background="#f5deb3") self.Button2.configure(command=complex_support.qqq) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(font=font9) self.Button2.configure(highlightbackground="#f5deb3") self.Button2.configure(text='''Redo''') self.Message1 = Message(self.TNotebook1_t2) self.Message1.place(relx=0.23, rely=0.3, relheight=0.17, relwidth=0.52) self.Message1.configure(background="#f5deb3") self.Message1.configure(font=font9) self.Message1.configure(highlightbackground="#f5deb3") self.Message1.configure(text='''Second Page''') self.Message1.configure(width=157) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.Button1 = Button(top) self.Button1.place(relx=0.44, rely=0.9, height=35, width=70) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background="#f5deb3") self.Button1.configure(command=complex_support.quit) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font9) self.Button1.configure(highlightbackground="#f5deb3") self.Button1.configure(text='''Quit''')
sfImg = imgtk.PhotoImage(sf) content = Label(tk, image=backImg) b = Button(tk, text="My Text", image=backImg, relief="flat", state="disabled") b.place(x =0, y =0) l = Text(tk, height = 20, width = 100) l.grid(column=0, row=0, sticky=(N,W,E,S)) s = Scrollbar(tk, orient=VERTICAL, command=l.yview) s.grid(column=1, row=0, sticky=(N,S)) l['yscrollcommand'] = s.set ttk.Sizegrip().grid(column=1, row=1, sticky=(S,E)) tk.grid_columnconfigure(0, weight=1) tk.grid_rowconfigure(0, weight=1) nick = Entry(tk,width = 15, textvariable=name) msg = Entry(tk, width = width,textvariable=text) msg.grid(sticky = (S,E)) nick.grid(sticky=(S)) isBusy = False class myButton(Button): id = ""
def __init__(self, parent, client): ''' :param parent: Tkinter object :param client: Client object ''' self.root = parent self.client = client # load initial setting self.text = ScrolledText(self.root, width=50, height=15) self.text.grid(row=0, column=2, columnspan=3) # Loading the list of files in menu self.files_list = Listbox(self.root, height=5) self.files_list.grid(column=0, row=0, sticky=(N, W, E, S)) # Attach scroll to list of files self.scrollbar = ttk.Scrollbar(self.root, orient=VERTICAL, command=self.files_list.yview) self.scrollbar.grid(column=1, row=0, sticky=(N, S)) self.files_list['yscrollcommand'] = self.scrollbar.set ttk.Sizegrip().grid(column=1, row=1, sticky=(S, E)) self.root.grid_columnconfigure(0, weight=1) self.root.grid_rowconfigure(0, weight=1) # Status self.status = StringVar() self.label = Label(self.root, textvariable=self.status) self.set_notification_status("-") # Radio button to choose "Access" self.label.grid(column=0, columnspan=2, sticky=(W)) self.access_button_val = StringVar() self.public_access = Radiobutton(self.root, text="Make file public", variable=self.access_button_val, value="0", state=DISABLED, command=self.onAccessChange) self.private_access = Radiobutton(self.root, text="Make file private", variable=self.access_button_val, value="1", state=DISABLED, command=self.onAccessChange) self.public_access.grid(column=2, row=2, sticky=(E)) self.private_access.grid(column=3, row=2, sticky=(E)) # Button check changes self.button_check_changes = Button(self.root, text="Check Changes", command=self.onCheckChanges) self.button_check_changes.grid(column=4, row=2, sticky=(E)) # Main menu in GUI ---------------------------------------------------------------------------- self.menu = Menu(self.root) self.root.config(menu=self.menu) self.menu.add_command(label="New file", command=self.onFileCreation) # self.menu.add_command(label="Open", command=self.onOpenFile) self.menu.add_command(label="Delete file", state=DISABLED, command=self.onFileDeletion) self.menu.add_command(label="Exit", command=self.onExit) # Update list of accessible files (request to server) self.upload_list_of_accessible_files_into_menu() # Start triggers for the first launch self.block_text_window() self.block_button_check_changes() # Add triggers # Recognize any press on the keyboard and"Enter" press self.text.bind("<Key>", self.onKeyPress) self.text.bind("<Return>", self.onEnterPress) self.root.protocol('WM_DELETE_WINDOW', self.onExit) self.files_list.bind('<<ListboxSelect>>', self.onFileSelection)
send = ttk.Button(c, text='Send Gift', command=sendGift, default='active') sentlbl = ttk.Label(c, textvariable=sentmsg, anchor='center') status = ttk.Label(c, textvariable=statusmsg, anchor=W) # Grid all the widgets lbox.grid(column=0, row=0, rowspan=6, sticky=(N, S, E, W)) lbl.grid(column=1, row=0, padx=10, pady=5) g1.grid(column=1, row=1, sticky=W, padx=20) g2.grid(column=1, row=2, sticky=W, padx=20) g3.grid(column=1, row=3, sticky=W, padx=20) send.grid(column=2, row=4, sticky=E) sentlbl.grid(column=1, row=5, columnspan=2, sticky=N, pady=5, padx=5) status.grid(column=0, row=6, columnspan=2, sticky=(W, E)) c.grid_columnconfigure(0, weight=1) c.grid_rowconfigure(5, weight=1) ttk.Sizegrip(root).grid(column=999, row=999, sticky=(S, E)) # Set event bindings for when the selection in the listbox changes, # when the user double clicks the list, and when they hit the Return key lbox.bind('<<ListboxSelect>>', showPopulation) lbox.bind('<Double-1>', sendGift) root.bind('<Return>', sendGift) # Colorize alternating lines of the listbox for i in range(0, len(countrynames), 2): lbox.itemconfigure(i, background='#f0f0ff') # Set the starting state of the interface, including selecting the # default gift to send, and clearing the messages. Select the first # country in the list; because the <<ListboxSelect>> event is only # generated when the user makes a change, we explicitly call showPopulation. gift.set('card')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' font9 = "-family {DejaVu Sans} -size 10 -weight normal -slant " \ "roman -underline 0 -overstrike 0" self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("529x522+296+123") top.title("Custom Widget Demo") self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.Message1 = Message(top) self.Message1.place(relx=0.04, rely=0.03, relheight=0.12, relwidth=0.93) self.Message1.configure(font=font9) self.Message1.configure(relief=SUNKEN) self.Message1.configure(text='''Message''') self.Message1.configure(width=491) self.Frame1 = Frame(top) self.Frame1.place(relx=0.06, rely=0.21, relheight=0.72, relwidth=0.5) self.Frame1.configure(relief=GROOVE) self.Frame1.configure(borderwidth="2") self.Frame1.configure(relief=GROOVE) self.Frame1.configure(width=265) self.Custom1 = customwidgetdemo_support.Custom(self.Frame1) self.Custom1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.btnGetChecks = Button(top) self.btnGetChecks.place(relx=0.68, rely=0.34, height=30, width=110) self.btnGetChecks.configure(activebackground="#d9d9d9") self.btnGetChecks.configure( command=customwidgetdemo_support.on_btnGetChecks) self.btnGetChecks.configure(font=font9) self.btnGetChecks.configure(text='''Get Checks''') self.btnGetChecks.configure(width=110) self.btnClearChecks = Button(top) self.btnClearChecks.place(relx=0.68, rely=0.53, height=30, width=110) self.btnClearChecks.configure(activebackground="#d9d9d9") self.btnClearChecks.configure( command=customwidgetdemo_support.on_btnClearChecks) self.btnClearChecks.configure(font=font9) self.btnClearChecks.configure(text='''Clear Checks''') self.btnExit = Button(top) self.btnExit.place(relx=0.68, rely=0.72, height=30, width=110) self.btnExit.configure(activebackground="#d9d9d9") self.btnExit.configure(command=customwidgetdemo_support.on_btnExit) self.btnExit.configure(font=font9) self.btnExit.configure(text='''Exit''') self.btnExit.configure(width=109)
def _init_ui(self): self._init_menu() self._frame = ttk.Frame(self.window) self._panes = ttk.Panedwindow(self._frame, orient=tk.HORIZONTAL) self._leftPaneFrame = ttk.Frame(self._panes, width=100) self._rightPaneFrame = ttk.Frame(self._panes, width=300) self._panes.add(self._leftPaneFrame) self._panes.add(self._rightPaneFrame) self._lblShowData = ttk.Label(self._leftPaneFrame, text='Data objects:') self._lstObjects = tk.Listbox(self._leftPaneFrame, listvariable=self._varObjects, selectmode=tk.EXTENDED) self._scrFiles = ttk.Scrollbar(self._leftPaneFrame, orient=tk.VERTICAL, command=self._lstObjects.yview) self._lstObjects['yscrollcommand'] = self._scrFiles.set self._lblDataView = ttk.Label(self._rightPaneFrame, text='Data View:') self._frmPlot = ttk.Frame(self._rightPaneFrame) self._mplFigure = Figure(figsize=(5, 4), dpi=100) self._pltCanvas = FigureCanvasTkAgg(self._mplFigure, master=self._frmPlot) self._pltCanvas.show() self._pltCanvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1) self._mplToolbar = NavigationToolbar2TkAgg(self._pltCanvas, self._frmPlot) self._mplToolbar.update() self._pltCanvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1) self._leftPaneFrame.columnconfigure(0, weight=33) self._leftPaneFrame.columnconfigure(1, weight=33) self._leftPaneFrame.columnconfigure(2, weight=33) self._leftPaneFrame.rowconfigure(1, weight=99) self._lblShowData.grid(column=0, row=0, padx=5, pady=10, sticky=(tk.N, tk.W, tk.S)) self._lstObjects.grid(column=0, columnspan=3, row=1, padx=5, pady=5, sticky=(tk.N, tk.W, tk.E, tk.S)) self._scrFiles.grid(column=50, row=1, pady=5, sticky=(tk.N, tk.S)) self._rightPaneFrame.rowconfigure(1, weight=99) self._rightPaneFrame.columnconfigure(0, weight=99) self._lblDataView.grid(column=0, row=0, padx=5, pady=10, sticky=(tk.W, tk.E)) self._frmPlot.grid(column=0, row=1, sticky=(tk.N, tk.W, tk.S, tk.E)) self._frame.columnconfigure(0, weight=100) self._frame.rowconfigure(0, weight=99) self._panes.grid(column=0, row=0, sticky=(tk.N, tk.W, tk.E, tk.S)) self._szGrip = ttk.Sizegrip(self._frame).grid(column=0, row=999, sticky=(tk.W, tk.E)) self._frame.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("600x450+451+169") top.title("New Toplevel") top.configure(background="#d9d9d9") self.TCombobox1 = ttk.Combobox(top) self.TCombobox1.place(relx=0.2, rely=0.089, relheight=0.047, relwidth=0.238) self.value_list = [ 10, 20, 30, 40, ] self.TCombobox1.configure(values=self.value_list) self.TCombobox1.configure(textvariable=ak_support.combobox) self.TCombobox1.configure(takefocus="") self.rmale = tk.Radiobutton(top) self.rmale.place(relx=0.3, rely=0.244, relheight=0.056, relwidth=0.09) self.rmale.configure(activebackground="#ececec") self.rmale.configure(activeforeground="#000000") self.rmale.configure(background="#d9d9d9") self.rmale.configure(disabledforeground="#a3a3a3") self.rmale.configure(foreground="#000000") self.rmale.configure(highlightbackground="#d9d9d9") self.rmale.configure(highlightcolor="black") self.rmale.configure(justify='left') self.rmale.configure(text='''Male''') self.rmale.configure(value="Male") self.rfemale = tk.Radiobutton(top) self.rfemale.place(relx=0.467, rely=0.244, relheight=0.056, relwidth=0.11) self.rfemale.configure(activebackground="#ececec") self.rfemale.configure(activeforeground="#000000") self.rfemale.configure(background="#d9d9d9") self.rfemale.configure(disabledforeground="#a3a3a3") self.rfemale.configure(foreground="#000000") self.rfemale.configure(highlightbackground="#d9d9d9") self.rfemale.configure(highlightcolor="black") self.rfemale.configure(justify='left') self.rfemale.configure(text='''Female''') self.rfemale.configure(value="Female") self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0)