Python tkinter.ttk.Entry() Examples

The following are 30 code examples of tkinter.ttk.Entry(). 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.ttk , or try the search function .
Example #1
Source File: annotation_gui.py    From SEM with MIT License 9 votes vote down vote up
def preferences(self, event=None):
        preferenceTop = tkinter.Toplevel()
        preferenceTop.focus_set()
        
        notebook = ttk.Notebook(preferenceTop)
        
        frame1 = ttk.Frame(notebook)
        notebook.add(frame1, text='general')
        frame2 = ttk.Frame(notebook)
        notebook.add(frame2, text='shortcuts')

        c = ttk.Checkbutton(frame1, text="Match whole word when broadcasting annotation", variable=self._whole_word)
        c.pack()
        
        shortcuts_vars = []
        shortcuts_gui = []
        cur_row = 0
        j = -1
        frame_list = []
        frame_list.append(ttk.LabelFrame(frame2, text="common shortcuts"))
        frame_list[-1].pack(fill="both", expand="yes")
        for i, shortcut in enumerate(self.shortcuts):
            j += 1
            key, cmd, bindings = shortcut
            name, command = cmd
            shortcuts_vars.append(tkinter.StringVar(frame_list[-1], value=key))
            tkinter.Label(frame_list[-1], text=name).grid(row=cur_row, column=0, sticky=tkinter.W)
            entry = tkinter.Entry(frame_list[-1], textvariable=shortcuts_vars[j])
            entry.grid(row=cur_row, column=1)
            cur_row += 1
        notebook.pack()
    
    #
    # ? menu methods
    # 
Example #2
Source File: friendslist.py    From Tkinter-GUI-Programming-by-Example with MIT License 7 votes vote down vote up
def show_login_screen(self):
        self.login_frame = ttk.Frame(self)

        username_label = ttk.Label(self.login_frame, text="Username")
        self.username_entry = ttk.Entry(self.login_frame)

        real_name_label = ttk.Label(self.login_frame, text="Real Name")
        self.real_name_entry = ttk.Entry(self.login_frame)

        login_button = ttk.Button(self.login_frame, text="Login", command=self.login)
        create_account_button = ttk.Button(self.login_frame, text="Create Account", command=self.create_account)

        username_label.grid(row=0, column=0, sticky='e')
        self.username_entry.grid(row=0, column=1)

        real_name_label.grid(row=1, column=0, sticky='e')
        self.real_name_entry.grid(row=1, column=1)

        login_button.grid(row=2, column=0, sticky='e')
        create_account_button.grid(row=2, column=1)

        for i in range(3):
            tk.Grid.rowconfigure(self.login_frame, i, weight=1)
            tk.Grid.columnconfigure(self.login_frame, i, weight=1)

        self.login_frame.pack(fill=tk.BOTH, expand=1) 
Example #3
Source File: friendslist.py    From Tkinter-GUI-Programming-by-Example with MIT License 6 votes vote down vote up
def show_login_screen(self):
        self.login_frame = ttk.Frame(self)

        username_label = ttk.Label(self.login_frame, text="Username")
        self.username_entry = ttk.Entry(self.login_frame)
        self.username_entry.focus_force()

        real_name_label = ttk.Label(self.login_frame, text="Real Name")
        self.real_name_entry = ttk.Entry(self.login_frame)

        login_button = ttk.Button(self.login_frame, text="Login", command=self.login)
        create_account_button = ttk.Button(self.login_frame, text="Create Account", command=self.create_account)

        username_label.grid(row=0, column=0, sticky='e')
        self.username_entry.grid(row=0, column=1)

        real_name_label.grid(row=1, column=0, sticky='e')
        self.real_name_entry.grid(row=1, column=1)

        login_button.grid(row=2, column=0, sticky='e')
        create_account_button.grid(row=2, column=1)

        for i in range(3):
            tk.Grid.rowconfigure(self.login_frame, i, weight=1)
            tk.Grid.columnconfigure(self.login_frame, i, weight=1)

        self.login_frame.pack(fill=tk.BOTH, expand=1)

        self.login_event = self.bind("<Return>", self.login) 
Example #4
Source File: gui.py    From skan with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def create_parameters_frame(self, parent):
        parameters = ttk.Frame(master=parent, padding=STANDARD_MARGIN)
        parameters.grid(sticky='nsew')

        heading = ttk.Label(parameters, text='Analysis parameters')
        heading.grid(column=0, row=0, sticky='n')

        for i, param in enumerate(self.parameters, start=1):
            param_label = ttk.Label(parameters, text=param._name)
            param_label.grid(row=i, column=0, sticky='nsew')
            if type(param) == tk.BooleanVar:
                param_entry = ttk.Checkbutton(parameters, variable=param)
            elif hasattr(param, '_choices'):
                param_entry = ttk.OptionMenu(parameters, param, param.get(),
                                             *param._choices.keys())
            else:
                param_entry = ttk.Entry(parameters, textvariable=param)
            param_entry.grid(row=i, column=1, sticky='nsew') 
Example #5
Source File: data_entry_app.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def __init__(self, parent, label='', input_class=ttk.Entry,
                 input_var=None, input_args=None, label_args=None,
                 **kwargs):
        super().__init__(parent, **kwargs)
        input_args = input_args or {}
        label_args = label_args or {}
        self.variable = input_var

        if input_class in (ttk.Checkbutton, ttk.Button, ttk.Radiobutton):
            input_args["text"] = label
            input_args["variable"] = input_var
        else:
            self.label = ttk.Label(self, text=label, **label_args)
            self.label.grid(row=0, column=0, sticky=(tk.W + tk.E))
            input_args["textvariable"] = input_var

        self.input = input_class(self, **input_args)
        self.input.grid(row=1, column=0, sticky=(tk.W + tk.E))
        self.columnconfigure(0, weight=1)
        self.error = getattr(self.input, 'error', tk.StringVar())
        self.error_label = ttk.Label(self, textvariable=self.error)
        self.error_label.grid(row=2, column=0, sticky=(tk.W + tk.E)) 
Example #6
Source File: data_entry_app.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.title("ABQ Data Entry Application")
        self.resizable(width=False, height=False)

        ttk.Label(
            self,
            text="ABQ Data Entry Application",
            font=("TkDefaultFont", 16)
        ).grid(row=0)


        self.recordform = DataRecordForm(self)
        self.recordform.grid(row=1, padx=10)

        self.savebutton = ttk.Button(self, text="Save", command=self.on_save)
        self.savebutton.grid(sticky="e", row=2, padx=10)

        # status bar
        self.status = tk.StringVar()
        self.statusbar = ttk.Label(self, textvariable=self.status)
        self.statusbar.grid(sticky="we", row=3, padx=10)

        self.records_saved = 0 
Example #7
Source File: views.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def body(self, parent):
        lf = tk.Frame(self)
        ttk.Label(lf, text='Login to ABQ',
                  font='TkHeadingFont').grid(row=0)

        ttk.Style().configure('err.TLabel',
                background='darkred', foreground='white')
        if self.error.get():
            ttk.Label(lf, textvariable=self.error,
                      style='err.TLabel').grid(row=1)
        ttk.Label(lf, text='User name:').grid(row=2)
        self.username_inp = ttk.Entry(lf, textvariable=self.user)
        self.username_inp.grid(row=3)
        ttk.Label(lf, text='Password:').grid(row=4)
        self.password_inp = ttk.Entry(lf, show='*', textvariable=self.pw)
        self.password_inp.grid(row=5)
        lf.pack()
        return self.username_inp 
Example #8
Source File: data_entry_app.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def __init__(self, parent, label='', input_class=ttk.Entry,
                 input_var=None, input_args=None, label_args=None,
                 **kwargs):
        super().__init__(parent, **kwargs)
        input_args = input_args or {}
        label_args = label_args or {}
        self.variable = input_var

        if input_class in (ttk.Checkbutton, ttk.Button, ttk.Radiobutton):
            input_args["text"] = label
            input_args["variable"] = input_var
        else:
            self.label = ttk.Label(self, text=label, **label_args)
            self.label.grid(row=0, column=0, sticky=(tk.W + tk.E))
            input_args["textvariable"] = input_var

        self.input = input_class(self, **input_args)
        self.input.grid(row=1, column=0, sticky=(tk.W + tk.E))
        self.columnconfigure(0, weight=1) 
Example #9
Source File: data_entry_app.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.title("ABQ Data Entry Application")
        self.resizable(width=False, height=False)

        ttk.Label(
            self,
            text="ABQ Data Entry Application",
            font=("TkDefaultFont", 16)
        ).grid(row=0)

        self.recordform = DataRecordForm(self)
        self.recordform.grid(row=1, padx=10)

        self.savebutton = ttk.Button(self, text="Save", command=self.on_save)
        self.savebutton.grid(sticky=tk.E, row=2, padx=10)

        # status bar
        self.status = tk.StringVar()
        self.statusbar = ttk.Label(self, textvariable=self.status)
        self.statusbar.grid(sticky=(tk.W + tk.E), row=3, padx=10)

        self.records_saved = 0 
Example #10
Source File: views.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def body(self, parent):
        lf = tk.Frame(self)
        ttk.Label(lf, text='Login to ABQ',
                  font='TkHeadingFont').grid(row=0)

        ttk.Style().configure('err.TLabel',
                background='darkred', foreground='white')
        if self.error.get():
            ttk.Label(lf, textvariable=self.error,
                      style='err.TLabel').grid(row=1)
        ttk.Label(lf, text='User name:').grid(row=2)
        self.username_inp = ttk.Entry(lf, textvariable=self.user)
        self.username_inp.grid(row=3)
        ttk.Label(lf, text='Password:').grid(row=4)
        self.password_inp = ttk.Entry(lf, show='*', textvariable=self.pw)
        self.password_inp.grid(row=5)
        lf.pack()
        return self.username_inp 
Example #11
Source File: views.py    From Python-GUI-Programming-with-Tkinter with MIT License 6 votes vote down vote up
def body(self, parent):
        lf = tk.Frame(self)
        ttk.Label(lf, text='Login to ABQ',
                  font='TkHeadingFont').grid(row=0)

        ttk.Style().configure('err.TLabel',
                background='darkred', foreground='white')
        if self.error.get():
            ttk.Label(lf, textvariable=self.error,
                      style='err.TLabel').grid(row=1)
        ttk.Label(lf, text='User name:').grid(row=2)
        self.username_inp = ttk.Entry(lf, textvariable=self.user)
        self.username_inp.grid(row=3)
        ttk.Label(lf, text='Password:').grid(row=4)
        self.password_inp = ttk.Entry(lf, show='*', textvariable=self.pw)
        self.password_inp.grid(row=5)
        lf.pack()
        return self.username_inp 
Example #12
Source File: Embed_tkinter.py    From Python-GUI-Programming-Cookbook-Second-Edition with MIT License 6 votes vote down vote up
def tkinterApp():
    import tkinter as tk
    from tkinter import ttk
    win = tk.Tk()    
    win.title("Python GUI")
    aLabel = ttk.Label(win, text="A Label")
    aLabel.grid(column=0, row=0)    
    ttk.Label(win, text="Enter a name:").grid(column=0, row=0)
    name = tk.StringVar()
    nameEntered = ttk.Entry(win, width=12, textvariable=name)
    nameEntered.grid(column=0, row=1)
    nameEntered.focus() 
     
    def buttonCallback():
        action.configure(text='Hello ' + name.get())
    action = ttk.Button(win, text="Print", command=buttonCallback) 
    action.grid(column=2, row=1)
    win.mainloop()

#================================================================== 
Example #13
Source File: wicc_view_dos.py    From WiCC with GNU General Public License v3.0 5 votes vote down vote up
def build_window(self):
        """
        Generates the window.

        :author: Pablo Sanz Alguacil
        """

        self.root = Toplevel()
        self.root.geometry('310x200')
        self.root.resizable(width=False, height=False)
        self.root.title('DoS Attack')
        self.root.protocol("WM_DELETE_WINDOW", self.destroy_window)

        self.labelframe_info = LabelFrame(self.root)
        self.labelframe_info.pack(fill="both", expand="no", pady=15)

        self.label_info = Label(self.labelframe_info, pady=15, text="With this tool yo can perform a DoS Attack."
                                                                    "\n\nIntroduce the attack's duration in seconds."
                                                                    "\nIntroduce 0 for infite time attack."
                                                                    "\nWait until the tool finishes the attack. ")
        self.label_info.pack()

        self.labelframe_buttons = LabelFrame(self.root)
        self.labelframe_buttons.pack(fill="both", expand="no", pady=5)

        self.label_time = Label(self.labelframe_buttons, text="Time: ")
        self.label_time.grid(column=0, row=0, padx=5, pady=5)

        self.entry = ttk.Entry(self.labelframe_buttons)
        self.entry.grid(column=1, row=0, padx=5, pady=5)

        self.button_start = Button(self.labelframe_buttons, text="Start", command=self.start_dos)
        self.button_start.grid(column=2, row=0, padx=5, pady=5) 
Example #14
Source File: findwindow.py    From Tkinter-GUI-Programming-by-Example with MIT License 5 votes vote down vote up
def __init__(self, master, **kwargs):
        super().__init__(**kwargs  )

        self.geometry('350x100')
        self.title('Find and Replace')

        self.text_to_find = tk.StringVar()
        self.text_to_replace_with = tk.StringVar()

        top_frame = tk.Frame(self)
        middle_frame = tk.Frame(self)
        bottom_frame = tk.Frame(self)

        find_entry_label = tk.Label(top_frame, text="Find: ")
        self.find_entry = ttk.Entry(top_frame, textvar=self.text_to_find)

        replace_entry_label = tk.Label(middle_frame, text="Replace: ")
        self.replace_entry = ttk.Entry(middle_frame, textvar=self.text_to_replace_with)

        self.find_button = ttk.Button(bottom_frame, text="Find", command=self.on_find)
        self.replace = ttk.Button(bottom_frame, text="Replace", command=self.on_replace)
        self.cancel_button = ttk.Button(bottom_frame, text="Cancel", command=self.destroy)

        find_entry_label.pack(side=tk.LEFT, padx=(20, 0))
        self.find_entry.pack(side=tk.LEFT, fill=tk.X, expand=1)

        replace_entry_label.pack(side=tk.LEFT)
        self.replace_entry.pack(side=tk.LEFT, fill=tk.X, expand=1)

        self.find_button.pack(side=tk.LEFT, padx=(85, 0))
        self.cancel_button.pack(side=tk.RIGHT, padx=(0, 30))

        top_frame.pack(side=tk.TOP, expand=1, fill=tk.X, padx=30)
        middle_frame.pack(side=tk.TOP, expand=1, fill=tk.X, padx=30)
        bottom_frame.pack(side=tk.TOP, expand=1, fill=tk.X) 
Example #15
Source File: addfriendwindow.py    From Tkinter-GUI-Programming-by-Example with MIT License 5 votes vote down vote up
def __init__(self, master):
        super().__init__()
        self.master = master

        self.transient(master)
        self.geometry("250x100")
        self.title("Add a Friend")

        main_frame = ttk.Frame(self)

        username_label = ttk.Label(main_frame, text="Username")
        self.username_entry = ttk.Entry(main_frame)

        add_button = ttk.Button(main_frame, text="Add", command=self.add_friend)

        username_label.grid(row=0, column=0)
        self.username_entry.grid(row=0, column=1)
        self.username_entry.focus_force()

        add_button.grid(row=1, column=0, columnspan=2)

        for i in range(2):
            tk.Grid.columnconfigure(main_frame, i, weight=1)
            tk.Grid.rowconfigure(main_frame, i, weight=1)

        main_frame.pack(fill=tk.BOTH, expand=1) 
Example #16
Source File: program6.py    From python-gui-demos with MIT License 5 votes vote down vote up
def __init__(self, master):
        self.label = ttk.Label(master, text='Enter the text below')
        self.label.pack()
        
        self.entry = ttk.Entry(master, width = 30)  # number of characters along the width
        self.entry.pack()
        
        self.button = ttk.Button(master, text = "Get Entry")
        self.button.pack()
        self.tkstrvar = tk.StringVar()  # create tk string variable
        self.tkstrvar.set('Nothing is done yet!')   # set the value of tk string variable
        self.button.config(command = self.getEntry)
        
        self.msg = ttk.Label(master, text = self.tkstrvar.get())    # get the value of string variable
        self.msg.pack()
        
        self.btn1 = ttk.Button(master, text='Delete the entry', command = self.btn1func)
        self.btn1.pack()
        
        self.crypt = tk.StringVar()
        self.crypt.set('Encrypt')
        self.btn2 = ttk.Button(master, text = "{} Text in Entry Field".format(self.crypt.get()), command = self.changecrypt)
        self.btn2.pack()
        #self.entryText = ttk.Entry(master, width=30)
        
        ttk.Button(master, text = 'Disable Entry Field', command = self.btn3func).pack()
        ttk.Button(master, text = 'Enable Entry Field', command = self.btn4func).pack()
        ttk.Button(master, text = 'Readonly Entry Field', command = self.btn5func).pack()
        ttk.Button(master, text = 'Edit Entry Field', command = self.btn6func).pack() 
Example #17
Source File: program6.py    From python-gui-demos with MIT License 5 votes vote down vote up
def changecrypt(self):
        if self.crypt.get()=='Encrypt':
            self.entry.config(show='*')
            self.crypt.set('Decrypt')
            self.btn2.config(text = "{} Text in Entry Field".format(self.crypt.get()))
        else:
            self.entry.config(show='')
            self.crypt.set('Encrypt')
            self.btn2.config(text = "{} Text in Entry Field".format(self.crypt.get())) 
Example #18
Source File: program6.py    From python-gui-demos with MIT License 5 votes vote down vote up
def btn1func(self):
        self.entry.delete(0, tk.END)    # delete all from 0 to END character in Entry Widget 
Example #19
Source File: formbuilder.py    From python-in-practice with GNU General Public License v3.0 5 votes vote down vote up
def add_entry(self, variable, row, column, **kwargs):
        name = self._canonicalize(variable)
        extra = "" if kwargs.get("kind") != "password" else ', show="*"'
        create = "self.{}Entry = ttk.Entry(self{})".format(name, extra)
        layout = """self.{}Entry.grid(row={}, column={}, sticky=(\
tk.W, tk.E), padx="0.75m", pady="0.75m")""".format(name, row, column)
        self.statements.extend((create, layout)) 
Example #20
Source File: Find.py    From python-in-practice with GNU General Public License v3.0 5 votes vote down vote up
def create_widgets(self):
        self.findLabel = TkUtil.Label(self, text="Find:", underline=1)
        self.findEntry = ttk.Entry(self, width=25)
        self.replaceLabel = TkUtil.Label(self, text="Replace:",
                underline=1)
        self.replaceEntry = ttk.Entry(self, width=25)
        self.caseSensitiveCheckbutton = TkUtil.Checkbutton(self,
                text="Case Sensitive", underline=5,
                variable=self.caseSensitive)
        self.wholeWordsCheckbutton = TkUtil.Checkbutton(self,
                text="Whole Words", underline=0,
                variable=self.wholeWords)
        self.findButton = TkUtil.Button(self, text="Find", underline=0,
                command=self.find, default=tk.ACTIVE, state=tk.DISABLED)
        self.replaceButton = TkUtil.Button(self, text="Replace",
                underline=0, command=self.replace, state=tk.DISABLED)
        self.closeButton = TkUtil.Button(self, text="Close", underline=0,
                command=self.close)
        if TkUtil.x11():
            self.extendButton = TkUtil.ToggleButton(self, text="Extend",
                    underline=1, command=self.toggle_extend)
        else:
            self.extendButton = ttk.Button(self, text="Extend",
                    underline=1, command=self.toggle_extend,
                    image=self.images[UNEXTEND], compound=tk.LEFT)
        self.extensionWidgets = (self.replaceLabel, self.replaceEntry,
                self.replaceButton) 
Example #21
Source File: MeterLogin.py    From python-in-practice with GNU General Public License v3.0 5 votes vote down vote up
def create_widgets(self, master):
        self.frame = ttk.Frame(master)
        self.usernameLabel = ttk.Label(self.frame, text="Username:",
                underline=-1 if TkUtil.mac() else 0)
        self.usernameEntry = ttk.Entry(self.frame, width=25)
        self.usernameEntry.insert(0, getpass.getuser())
        self.passwordLabel = ttk.Label(self.frame, text="Password:",
                underline=-1 if TkUtil.mac() else 0)
        self.passwordEntry = ttk.Entry(self.frame, width=25, show="•") 
Example #22
Source File: Main.py    From python-in-practice with GNU General Public License v3.0 5 votes vote down vote up
def create_widgets(self):
        self.sourceLabel = ttk.Label(self, text="Source Folder:",
                underline=-1 if TkUtil.mac() else 1)
        self.sourceEntry = ttk.Entry(self, width=30,
                textvariable=self.sourceText)
        self.sourceButton = TkUtil.Button(self, text="Source...",
                underline=0, command=lambda *args:
                    self.choose_folder(SOURCE))
        self.helpButton = TkUtil.Button(self, text="Help", underline=0,
                command=self.help)
        self.targetLabel = ttk.Label(self, text="Target Folder:",
                underline=-1 if TkUtil.mac() else 1)
        self.targetEntry = ttk.Entry(self, width=30,
                textvariable=self.targetText)
        self.targetButton = TkUtil.Button(self, text="Target...",
                underline=0, command=lambda *args:
                    self.choose_folder(TARGET))
        self.aboutButton = TkUtil.Button(self, text="About", underline=1,
                command=self.about)
        self.statusLabel = ttk.Label(self, textvariable=self.statusText)
        self.scaleButton = TkUtil.Button(self, text="Scale",
                underline=1, command=self.scale_or_cancel,
                default=tk.ACTIVE, state=tk.DISABLED)
        self.quitButton = TkUtil.Button(self, text="Quit", underline=0,
                command=self.close)
        self.dimensionLabel = ttk.Label(self, text="Max. Dimension:",
                underline=-1 if TkUtil.mac() else 6)
        self.dimensionCombobox = ttk.Combobox(self,
                textvariable=self.dimensionText, state="readonly",
                values=("50", "100", "150", "200", "250", "300", "350",
                        "400", "450", "500"))
        TkUtil.set_combobox_item(self.dimensionCombobox, "400") 
Example #23
Source File: Find.py    From python-in-practice with GNU General Public License v3.0 5 votes vote down vote up
def create_widgets(self):
        self.findLabel = TkUtil.Label(self, text="Find:", underline=1)
        self.findEntry = ttk.Entry(self, width=25)
        self.replaceLabel = TkUtil.Label(self, text="Replace:",
                underline=1)
        self.replaceEntry = ttk.Entry(self, width=25)
        self.caseSensitiveCheckbutton = TkUtil.Checkbutton(self,
                text="Case Sensitive", underline=5,
                variable=self.caseSensitive)
        self.wholeWordsCheckbutton = TkUtil.Checkbutton(self,
                text="Whole Words", underline=0,
                variable=self.wholeWords)
        self.findButton = TkUtil.Button(self, text="Find", underline=0,
                command=self.find, default=tk.ACTIVE, state=tk.DISABLED)
        self.replaceButton = TkUtil.Button(self, text="Replace",
                underline=0, command=self.replace, state=tk.DISABLED)
        self.closeButton = TkUtil.Button(self, text="Close", underline=0,
                command=self.close)
        if TkUtil.x11():
            self.extendButton = TkUtil.ToggleButton(self, text="Extend",
                    underline=1, command=self.toggle_extend)
        else:
            self.extendButton = ttk.Button(self, text="Extend",
                    underline=1, command=self.toggle_extend,
                    image=self.images[UNEXTEND], compound=tk.LEFT)
        self.extensionWidgets = (self.replaceLabel, self.replaceEntry,
                self.replaceButton) 
Example #24
Source File: main.py    From Bitcoin-Trading-Client with GNU General Public License v2.0 5 votes vote down vote up
def addTopIndicator(what):
    global topIndicator
    global DatCounter

    if DataPace == "tick":
        popupmsg("Indicators in Tick Data not available, choose 1 minute tf if you want short term.")

    if what == "none":
        topIndicator = what
        DatCounter = 9000

    elif what == "rsi":
        rsiQ = tk.Tk()
        rsiQ.wm_title("Periods?")
        label = ttk.Label(rsiQ, text="Choose how many periods you want each RSI calculation to consider.\nThese periods are contingent on your current time settings on the chart. 1 period = 1 OHLC candlestick.", font=NORM_FONT)
        label.pack(side="top", fill="x", pady=10)

        e = ttk.Entry(rsiQ)
        e.insert(0,14)
        e.pack()
        e.focus_set()

        def callback():
            periods = (e.get())
            group = []
            group.append("rsi")
            group.append(periods)
            topIndicator = group
            DatCounter = 9000
            print("set top indicator to",group)
            rsiQ.destroy()
        
        b = ttk.Button(rsiQ, text="Submit", width=10, command=callback)
        b.pack()

        tk.mainloop()

    elif what == "macd":
        topIndicator = "macd"
        DatCounter = 9000 
Example #25
Source File: main.py    From Bitcoin-Trading-Client with GNU General Public License v2.0 5 votes vote down vote up
def addBottomIndicator(what):
    global bottomIndicator
    global DatCounter

    if DataPace == "tick":
        popupmsg("Indicators in Tick Data not available, choose 1 minute tf if you want short term.")

    if what == "none":
        bottomIndicator = what
        DatCounter = 9000

    elif what == "rsi":
        rsiQ = tk.Tk()
        rsiQ.wm_title("Periods?")
        label = ttk.Label(rsiQ, text="Choose how many periods you want each RSI calculation to consider.\nThese periods are contingent on your current time settings on the chart. 1 period = 1 OHLC candlestick.", font=NORM_FONT)
        label.pack(side="top", fill="x", pady=10)

        e = ttk.Entry(rsiQ)
        e.insert(0,14)
        e.pack()
        e.focus_set()

        def callback():
            periods = (e.get())
            group = []
            group.append("rsi")
            group.append(periods)
            bottomIndicator = group
            DatCounter = 9000
            print("set top indicator to",group)
            rsiQ.destroy()
        
        b = ttk.Button(rsiQ, text="Submit", width=10, command=callback)
        b.pack()

        tk.mainloop()

    elif what == "macd":
        bottomIndicator = "macd"
        DatCounter = 9000 
Example #26
Source File: test_widgets.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def setUp(self):
        class TestClass(widgets.ValidatedMixin, ttk.Entry):
            pass
        self.vw1 = TestClass(self.root) 
Example #27
Source File: test_widgets.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def setUp(self):
        class TestClass(widgets.ValidatedMixin, ttk.Entry):
            pass
        self.vw1 = TestClass(self.root) 
Example #28
Source File: test_widgets.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def setUp(self):
        class TestClass(widgets.ValidatedMixin, ttk.Entry):
            pass
        self.vw1 = TestClass(self.root) 
Example #29
Source File: test_widgets.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def setUp(self):
        class TestClass(widgets.ValidatedMixin, ttk.Entry):
            pass
        self.vw1 = TestClass(self.root) 
Example #30
Source File: test_widgets.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def setUp(self):
        class TestClass(widgets.ValidatedMixin, ttk.Entry):
            pass
        self.vw1 = TestClass(self.root)