Python Tkinter.EW Examples

The following are 13 code examples of Tkinter.EW(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module Tkinter , or try the search function .
Example #1
Source File: gui_widgets.py    From SVPV with MIT License 6 votes vote down vote up
def __init__(self, parent):
        tk.LabelFrame.__init__(self, parent)
        self.title = tk.Label(self, text='SV Length')

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

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

        self.title.grid(row=0, column=0, sticky=tk.EW, columnspan=4)
        self.len_GT_On_CB.grid(row=1, column=0, sticky=tk.EW)
        self.len_GT_val.grid(row=2, column=0, sticky=tk.EW)
        self.len_GT_Units.grid(row=2, column=1, sticky=tk.EW)
        self.len_LT_On_CB.grid(row=1, column=2, sticky=tk.EW)
        self.len_LT_val.grid(row=2, column=2, sticky=tk.EW)
        self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW) 
Example #2
Source File: stats.py    From EDMarketConnector with GNU General Public License v2.0 5 votes vote down vote up
def addpageheader(self, parent, header, align=None):
        self.addpagerow(parent, header, align=align)
        ttk.Separator(parent, orient=tk.HORIZONTAL).grid(columnspan=len(header), padx=10, pady=2, sticky=tk.EW) 
Example #3
Source File: inara.py    From EDMarketConnector with GNU General Public License v2.0 5 votes vote down vote up
def plugin_prefs(parent, cmdr, is_beta):

    PADX = 10
    BUTTONX = 12	# indent Checkbuttons and Radiobuttons
    PADY = 2		# close spacing

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame, text='Inara', background=nb.Label().cget('background'), url='https://inara.cz/', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W)	# Don't translate
    this.log = tk.IntVar(value = config.getint('inara_out') and 1)
    this.log_button = nb.Checkbutton(frame, text=_('Send flight log and Cmdr status to Inara'), variable=this.log, command=prefsvarchanged)
    this.log_button.grid(columnspan=2, padx=BUTTONX, pady=(5,0), sticky=tk.W)

    nb.Label(frame).grid(sticky=tk.W)	# big spacer
    this.label = HyperlinkLabel(frame, text=_('Inara credentials'), background=nb.Label().cget('background'), url='https://inara.cz/settings-api', underline=True)	# Section heading in settings
    this.label.grid(columnspan=2, padx=PADX, sticky=tk.W)

    this.apikey_label = nb.Label(frame, text=_('API Key'))	# EDSM setting
    this.apikey_label.grid(row=12, padx=PADX, sticky=tk.W)
    this.apikey = nb.Entry(frame)
    this.apikey.grid(row=12, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    prefs_cmdr_changed(cmdr, is_beta)

    return frame 
Example #4
Source File: edsm.py    From EDMarketConnector with GNU General Public License v2.0 5 votes vote down vote up
def plugin_prefs(parent, cmdr, is_beta):

    PADX = 10
    BUTTONX = 12	# indent Checkbuttons and Radiobuttons
    PADY = 2		# close spacing

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame, text='Elite Dangerous Star Map', background=nb.Label().cget('background'), url='https://www.edsm.net/', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W)	# Don't translate
    this.log = tk.IntVar(value = config.getint('edsm_out') and 1)
    this.log_button = nb.Checkbutton(frame, text=_('Send flight log and Cmdr status to EDSM'), variable=this.log, command=prefsvarchanged)
    this.log_button.grid(columnspan=2, padx=BUTTONX, pady=(5,0), sticky=tk.W)

    nb.Label(frame).grid(sticky=tk.W)	# big spacer
    this.label = HyperlinkLabel(frame, text=_('Elite Dangerous Star Map credentials'), background=nb.Label().cget('background'), url='https://www.edsm.net/settings/api', underline=True)	# Section heading in settings
    this.label.grid(columnspan=2, padx=PADX, sticky=tk.W)

    this.cmdr_label = nb.Label(frame, text=_('Cmdr'))	# Main window
    this.cmdr_label.grid(row=10, padx=PADX, sticky=tk.W)
    this.cmdr_text = nb.Label(frame)
    this.cmdr_text.grid(row=10, column=1, padx=PADX, pady=PADY, sticky=tk.W)

    this.user_label = nb.Label(frame, text=_('Commander Name'))	# EDSM setting
    this.user_label.grid(row=11, padx=PADX, sticky=tk.W)
    this.user = nb.Entry(frame)
    this.user.grid(row=11, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    this.apikey_label = nb.Label(frame, text=_('API Key'))	# EDSM setting
    this.apikey_label.grid(row=12, padx=PADX, sticky=tk.W)
    this.apikey = nb.Entry(frame)
    this.apikey.grid(row=12, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    prefs_cmdr_changed(cmdr, is_beta)

    return frame 
Example #5
Source File: gui_widgets.py    From SVPV with MIT License 5 votes vote down vote up
def __init__(self, parent, samples):
        tk.LabelFrame.__init__(self, parent, text="Sample Genotype Selection")
        self.parent = parent
        self.samples = samples
        self.max_row = 5
        if self.samples:
            self.GT_CBs = []
            self.c = 0
            self.r = 0
            self.set_samples()
        else:
            self.GT_CBs = None
            self.lab = tk.Label(self,text="-- No samples Selected --")
            self.lab.grid(row=0, sticky = tk.EW) 
Example #6
Source File: gui_widgets.py    From SVPV with MIT License 5 votes vote down vote up
def set_samples(self):
        for s in self.samples:
            self.GT_CBs.append(GenotypeSelector(self, s))
            self.GT_CBs[-1].grid(column=self.c, row=self.r, sticky = tk.EW)
            self.r += 1
            if self.r == self.max_row:
                self.r = 0
                self.c +=1 
Example #7
Source File: gui_widgets.py    From SVPV with MIT License 5 votes vote down vote up
def set_check_boxes(self):
        for gt in self.gts:
            self.checkVars.append(tk.IntVar(value=0))
            self.CBs.append(tk.Checkbutton(self, text=gt, variable=self.checkVars[-1], onvalue=1, offvalue=0))
            self.CBs[-1].grid(row = self.r, column=self.c, sticky=tk.EW)
            self.c += 1 
Example #8
Source File: gui_widgets.py    From SVPV with MIT License 5 votes vote down vote up
def reset(self):
        self.len_GT_On.set(0)
        self.len_LT_On.set(0)
        self.len_GT_val.destroy()
        self.len_GT_Units.destroy()
        self.len_LT_val.destroy()
        self.len_LT_Units.destroy()
        self.len_GT_val = tk.Spinbox(self, values=(1, 5, 10, 50, 100, 500), width=3)
        self.len_GT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
        self.len_LT_val = tk.Spinbox(self, values=(1, 5, 10, 50, 100, 500), width=3)
        self.len_LT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
        self.len_GT_val.grid(row=2, column=0, sticky=tk.EW)
        self.len_GT_Units.grid(row=2, column=1, sticky=tk.EW)
        self.len_LT_val.grid(row=2, column=2, sticky=tk.EW)
        self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW) 
Example #9
Source File: gui_widgets.py    From SVPV with MIT License 5 votes vote down vote up
def __init__(self, parent, svs, sv_count):
        tk.LabelFrame.__init__(self, parent, text="Structural Variant Call Selection")
        self.sv_fl = None
        if not svs:
            self.lab = tk.Label(self,text="-- No matches --")
            self.lab.grid(row=0, column=0, sticky = tk.EW)
            self.num_svs_lab = tk.Label(self, text='-- of %d SVs' % sv_count)
        else:
            self.sv_fl = FieldedListbox(self, ("SV Type", "Chr A", "Pos A", "Chr B", "Pos B", "Length (bp)", "AF"))
            for sv in svs:
                self.sv_fl.push_entry(sv.string_tuple())
            self.num_svs_lab = tk.Label(self, text='%d of %d SVs' % (len(svs), sv_count))
            self.sv_fl.grid(row=0, sticky = tk.NSEW)
        self.num_svs_lab.grid(row=1, column=0, sticky=tk.EW) 
Example #10
Source File: gui.py    From SVPV with MIT License 5 votes vote down vote up
def setup_static_features(self):
        self.wm_title("SVPV - Structural Variant Prediction Viewer")
        self.window_size()

        if self.buttons_1:
            self.buttons_1.destroy()
        self.buttons_1 = tk.LabelFrame(self)
        if self.reset:
            self.reset.destroy()
        self.reset = tk.Button(self.buttons_1, text="Reset Filters", command=self.reset_filters)
        self.reset.grid(row=0, column=0, padx=40, sticky=tk.W)
        if self.list:
            self.list.destroy()
        self.list = tk.Button(self.buttons_1, text="Apply Filters", command=self.apply_filters)
        self.list.grid(row=0, column=1, padx=40, sticky=tk.E)
        self.buttons_1.grid(row=4, column=0, columnspan=2, sticky=tk.EW, padx=10)

        if self.buttons_2:
            self.buttons_2.destroy()
        self.buttons_2 = tk.LabelFrame(self)
        if self.viewGTs:
            self.viewGTs.destroy()
        self.viewGTs = tk.Button(self.buttons_2, text="Get Genotypes", command=self.view_gts)
        self.viewGTs.grid(row=0, column=0, padx=25, sticky=tk.W)
        if self.viewSV:
            self.viewSV.destroy()
        self.viewSV = tk.Button(self.buttons_2, text="Plot Selected SV", command=self.plot_sv)
        self.viewSV.grid(row=0, column=1, padx=25, sticky=tk.W)
        if self.plotAll:
            self.plotAll.destroy()
        self.plotAll = tk.Button(self.buttons_2, text="Plot All SVs", command=self.plot_all)
        self.plotAll.grid(row=0, column=2, padx=25, sticky=tk.E)
        if self.display_cb:
            self.display_cb.destroy()
        self.display_var = tk.IntVar(value=1)
        self.display_cb = tk.Checkbutton(self.buttons_2, text='display plot on creation', variable=self.display_var,
                                         onvalue=1, offvalue=0)
        self.display_cb.grid(row=1, column=1, padx=25, sticky=tk.E)
        self.buttons_2.grid(row=6, column=0, columnspan=2, sticky=tk.EW, padx=10) 
Example #11
Source File: edrclient.py    From edr with Apache License 2.0 4 votes vote down vote up
def prefs_ui(self, parent):
        frame = notebook.Frame(parent)
        frame.columnconfigure(1, weight=1)

        # Translators: this is shown in the preferences panel
        ttkHyperlinkLabel.HyperlinkLabel(frame, text=_(u"EDR website"), background=notebook.Label().cget('background'), url="https://edrecon.com", underline=True).grid(padx=10, sticky=tk.W)       
        ttkHyperlinkLabel.HyperlinkLabel(frame, text=_(u"EDR community"), background=notebook.Label().cget('background'), url="https://edrecon.com/discord", underline=True).grid(padx=10, sticky=tk.W)       

        # Translators: this is shown in the preferences panel
        notebook.Label(frame, text=_(u'Credentials')).grid(padx=10, sticky=tk.W)
        ttk.Separator(frame, orient=tk.HORIZONTAL).grid(columnspan=2, padx=10, pady=2, sticky=tk.EW)
        # Translators: this is shown in the preferences panel
        cred_label = notebook.Label(frame, text=_(u'Log in with your EDR account for full access (https://edrecon.com/account)'))
        cred_label.grid(padx=10, columnspan=2, sticky=tk.W)

        notebook.Label(frame, text=_(u"Email")).grid(padx=10, row=11, sticky=tk.W)
        notebook.Entry(frame, textvariable=self._email).grid(padx=10, row=11,
                                                             column=1, sticky=tk.EW)

        notebook.Label(frame, text=_(u"Password")).grid(padx=10, row=12, sticky=tk.W)
        notebook.Entry(frame, textvariable=self._password,
                       show=u'*').grid(padx=10, row=12, column=1, sticky=tk.EW)

        notebook.Label(frame, text=_(u'Sitrep Broadcasts')).grid(padx=10, row=14, sticky=tk.W)
        ttk.Separator(frame, orient=tk.HORIZONTAL).grid(columnspan=2, padx=10, pady=2, sticky=tk.EW)
        notebook.Label(frame, text=_("Redact my info")).grid(padx=10, row = 16, sticky=tk.W)
        choices = { _(u'Auto'),_(u'Always'),_(u'Never')}
        popupMenu = notebook.OptionMenu(frame, self._anonymous_reports, self.anonymous_reports, *choices)
        popupMenu.grid(padx=10, row=16, column=1, sticky=tk.EW)
        popupMenu["menu"].configure(background="white", foreground="black")

        if self.server.is_authenticated():
            if self.is_anonymous():
                self.status = _(u"authenticated (guest).")
            else:
                self.status = _(u"authenticated.")
        else:
            self.status = _(u"not authenticated.")

        # Translators: this is shown in the preferences panel as a heading for feedback options (e.g. overlay, audio cues)
        notebook.Label(frame, text=_(u"EDR Feedback:")).grid(padx=10, row=17, sticky=tk.W)
        ttk.Separator(frame, orient=tk.HORIZONTAL).grid(columnspan=2, padx=10, pady=2, sticky=tk.EW)
        
        notebook.Checkbutton(frame, text=_(u"Overlay"),
                             variable=self._visual_feedback).grid(padx=10, row=19,
                                                                  sticky=tk.W)
        notebook.Checkbutton(frame, text=_(u"Sound"),
                             variable=self._audio_feedback).grid(padx=10, row=20, sticky=tk.W)


        return frame 
Example #12
Source File: gui_widgets.py    From SVPV with MIT License 4 votes vote down vote up
def __init__(self, parent, header, width=10, selectmode=tk.BROWSE):
        tk.Frame.__init__(self, parent)
        self.parent = parent
        self.num_f = len(header)
        self.headers = []
        self.lbs = []
        self.c = 0
        self.sel_idxs = []

        self.scroll = tk.Scrollbar(self, orient=tk.VERTICAL)
        for i in range(0, self.num_f):
            self.headers.append(tk.Label(self, text=header[i]))
            self.headers[-1].grid(row=0, column=self.c, sticky=tk.EW)
            self.lbs.append(tk.Listbox(self, width=width, selectmode=selectmode, yscrollcommand=self.yscroll, bg='white'))
            self.lbs[-1].grid(row=1, column=self.c, sticky=tk.EW)
            self.lbs[-1].bind("<<ListboxSelect>>", self.select)
            self.c += 1

        self.scroll.config(command=self.lbs[0].yview)
        self.scroll.grid(row=1, column=self.c, sticky=tk.NS) 
Example #13
Source File: tkgui.py    From ATX with Apache License 2.0 4 votes vote down vote up
def _init_items(self):
        """
        .---------------.
        | Ctrl | Screen |
        |------|        |
        | Code |        |
        |      |        |
        """
        root = self._root
        root.resizable(0, 0)

        frm_control = tk.Frame(root, bg='#bbb')
        frm_control.grid(column=0, row=0, padx=5, sticky=tk.NW)
        frm_screen = tk.Frame(root, bg='#aaa')
        frm_screen.grid(column=1, row=0)

        frm_screenshot = tk.Frame(frm_control)
        frm_screenshot.grid(column=0, row=0, sticky=tk.W)
        tk.Label(frm_control, text='-'*30).grid(column=0, row=1, sticky=tk.EW)
        frm_code = tk.Frame(frm_control)
        frm_code.grid(column=0, row=2, sticky=tk.EW)

        self._btn_refresh = tk.Button(frm_screenshot, textvariable=self._refresh_text, command=self._refresh_screen)
        self._btn_refresh.grid(column=0, row=0, sticky=tk.W)
        # tk.Button(frm_screenshot, text="Wakeup", command=self._device.wakeup).grid(column=0, row=1, sticky=tk.W)
        tk.Button(frm_screenshot, text=u"保存选中区域", command=self._save_crop).grid(column=0, row=1, sticky=tk.W)
        
        # tk.Button(frm_screenshot, text="保存截屏", command=self._save_screenshot).grid(column=0, row=2, sticky=tk.W)
        frm_checkbtns = tk.Frame(frm_screenshot)
        frm_checkbtns.grid(column=0, row=3, sticky=(tk.W, tk.E))
        tk.Checkbutton(frm_checkbtns, text="Auto refresh", variable=self._auto_refresh_var, command=self._run_check_refresh).grid(column=0, row=0, sticky=tk.W)
        tk.Checkbutton(frm_checkbtns, text="UI detect", variable=self._uiauto_detect_var).grid(column=1, row=0, sticky=tk.W)

        frm_code_editor = tk.Frame(frm_code)
        frm_code_editor.grid(column=0, row=0, sticky=(tk.W, tk.E))
        tk.Label(frm_code_editor, text='Generated code').grid(column=0, row=0, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._gencode_text, width=30).grid(column=0, row=1, sticky=tk.W)
        tk.Label(frm_code_editor, text='Save file name').grid(column=0, row=2, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._genfile_name, width=30).grid(column=0, row=3, sticky=tk.W)
        tk.Label(frm_code_editor, text='Extention name').grid(column=0, row=4, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._fileext_text, width=30).grid(column=0, row=5, sticky=tk.W)
        
        frm_code_btns = tk.Frame(frm_code)
        frm_code_btns.grid(column=0, row=2, sticky=(tk.W, tk.E))
        tk.Button(frm_code_btns, text='Run', command=self._run_code).grid(column=0, row=0, sticky=tk.W)
        self._btn_runedit = tk.Button(frm_code_btns, state=tk.DISABLED, text='Insert and Run', command=self._run_and_insert)
        self._btn_runedit.grid(column=1, row=0, sticky=tk.W)
        tk.Button(frm_code, text='Select File', command=self._run_selectfile).grid(column=0, row=4, sticky=tk.W)
        tk.Label(frm_code, textvariable=self._attachfile_text).grid(column=0, row=5, sticky=tk.W)
        tk.Button(frm_code, text='Reset', command=self._reset).grid(column=0, row=6, sticky=tk.W)

        self.canvas = tk.Canvas(frm_screen, bg="blue", bd=0, highlightthickness=0, relief='ridge')
        self.canvas.grid(column=0, row=0, padx=10, pady=10)
        self.canvas.bind("<Button-1>", self._stroke_start)
        self.canvas.bind("<B1-Motion>", self._stroke_move)
        self.canvas.bind("<B1-ButtonRelease>", self._stroke_done)
        self.canvas.bind("<Motion>", self._mouse_move)