Example #1
0
        "tamiento de algunas de las distribuciones más importantes de probabilidad"
    ).place(x=40, y=75)
    consi2 = Label(Bienvenido, text="y estadística.").place(x=40, y=95)
    enjoy = Label(Bienvenido, text="Disfrútalo",
                  font=("Verdana", 20)).place(x=40, y=120)
    cre = Button(Bienvenido, text="Créditos", command=Creditos).place(x=470,
                                                                      y=128)


########################### GUI ###########################

Ventana = Tk()
Ventana.title("Distribuciones de Probabilidad")
Ventana.geometry("573x200")
Ventana.resizable(width=False, height=False)
Pestanas = ttk.Notebook(Ventana)
Pestanas.pack(fill="both",
              expand="yes")  #Las ventanas se van a expandir en toda la ventana

#Creando pestanas
Bienvenido = ttk.Frame(Pestanas)
Poi = ttk.Frame(Pestanas)
Bi = ttk.Frame(Pestanas)
Geome = ttk.Frame(Pestanas)
Hiper = ttk.Frame(Pestanas)
No = ttk.Frame(Pestanas)
NA = ttk.Frame(Pestanas)
Pestanas.add(Bienvenido, text="Bienvenido")
Pestanas.add(Poi, text="Poisson")
Pestanas.add(Bi, text="Binomial")
Pestanas.add(Geome, text="Geométrica")
Example #2
0
    elif (submit_PurchaseOrder.get()):
        submit_preview.delete('1.0', END)
        submit_preview.insert(INSERT, tag)

    elif (submit_submittedBy.get()):
        submit_preview.delete('1.0', END)
        submit_preview.insert(INSERT, tag)

    elif (submit_SendBackOriginal.get()):
        submit_preview.delete('1.0', END)
        submit_preview.insert(INSERT, tag)


#Creating TabControl object and declaring tabs
tabControl = ttk.Notebook(root, width=480, height=320)

HowToUseTab = ttk.Frame(tabControl)
submitTab = ttk.Frame(tabControl)
projectdataTab = ttk.Frame(tabControl)
fielddefTab = ttk.Frame(tabControl)
labelxmlTab = ttk.Frame(tabControl)

tabControl.add(HowToUseTab, text="How to use")
tabControl.add(submitTab, text="submit.html")
tabControl.add(projectdataTab, text="projectdata.html")
tabControl.add(fielddefTab, text="fieldDef.xml")
tabControl.add(labelxmlTab, text="labelXML.js")

tabControl.pack(expand=1, fill="both")
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu

# Create instance
win = tk.Tk()   

# Add a title       
win.title("Python GUI")  

tabControl = ttk.Notebook(win)          # Create Tab Control

tab1 = ttk.Frame(tabControl)            # Create a tab 
tabControl.add(tab1, text='Tab 1')      # Add the tab
tab2 = ttk.Frame(tabControl)            # Add a second tab
tabControl.add(tab2, text='Tab 2')      # Make second tab visible

tabControl.pack(expand=1, fill="both")  # Pack to make visible

# LabelFrame using tab1 as the parent
mighty = ttk.LabelFrame(tab1, text=' Mighty Python ')
mighty.grid(column=0, row=0, padx=8, pady=4)

# Modify adding a Label using mighty as the parent instead of win
a_label = ttk.Label(mighty, text="Enter a name:")
a_label.grid(column=0, row=0, sticky='W')
Example #4
0
    def __init__(self,master):
        tk.Frame.__init__(self,master)
        self.master.title("Stack Denoise App")
        self.master.resizable(False,False)
        self.master.tk_setPalette(background='#ececec')
        x=int((self.master.winfo_screenwidth()-self.master.winfo_reqwidth())/1.5)
        y=int((self.master.winfo_screenheight()-self.master.winfo_reqheight())/1.5)
        mfw,mfh=x-1,y-1
        nbfw,nbfh=mfw-50,40
        self.master.geometry('{}x{}'.format(x,y))
        
        self.bfiles=tk.Frame(master, width = mfw, height=mfh)
        self.info=tk.Label(self.bfiles,text="Click here access the plugins documentation", fg="blue", cursor="hand2")
        self.info.pack()
        self.info.bind("<Button-1>", self.callback)
        self.fpath=tk.Label(self.bfiles,text=fields[0][0])
        self.fp=tk.StringVar(self.bfiles)
        self.fpath_val=tk.Entry(self.bfiles,textvariable=self.fp)
        self.browse_button = tk.Button(self.bfiles,text="Browse", fg="green",command=self.browseSt)
        self.fpath.pack(side="left")
        self.fpath_val.pack(side="left")
        self.browse_button.pack(side="left")
        self.bfiles.pack(side="top")
        
        self.extfiles=tk.Frame(master, width = mfw, height=mfh)
        self.fext=tk.Label(self.extfiles,text=fields[1][0])
        self.fe=tk.StringVar(self.extfiles,value=fields[1][1])
        self.fext_val=tk.Entry(self.extfiles,textvariable=self.fe)
        self.fext.pack(side="left")
        self.fext_val.pack(side="left")    
        self.sfnlab=tk.Label(self.extfiles,text=fields[2][0])
        self.sfn=tk.StringVar(self.extfiles,value=fields[2][1])
        self.sfn_val=tk.Entry(self.extfiles,textvariable=self.sfn)
        self.sfn_val.pack(side="right")    
        self.sfnlab.pack(side="right")
        self.extfiles.pack(side="top")

        self.nbfr=tk.Frame(master, width = mfw, height=mfh)
        self.nbfr.pack(side="top")
        self.n=ttk.Notebook(self.nbfr)
        self.br_frame=tk.Frame(self.n, width = mfw, height=mfh-40)
        self.ch_frame=tk.Frame(self.n, width = mfw, height=mfh-40)
        self.bl_frame=tk.Frame(self.n, width = mfw, height=mfh-40)
        self.nlm_frame=tk.Frame(self.n, width = mfw, height=mfh-40)
        
        self.n.add(self.br_frame, text='TV Bregman Denoise')
        self.n.add(self.ch_frame, text='TV Chambolle Denoise')
        self.n.add(self.bl_frame, text='Bilateral Filter')  
        self.n.add(self.nlm_frame, text='Non Local Means Filter')  
        self.n.pack()

        # Create the main containers for the Bregman NB
        tk.Label(self.br_frame,text="Denoise image stacks with the TV Bregman algoritm").grid(row=0)
        self.cen_frame_br=tk.Frame(self.br_frame, width = nbfw, height=nbfh*len(fieldsTVB), pady=3)
        self.btm_frame_br=tk.Frame(self.br_frame, width = nbfw, height=nbfh, pady=3)
        
        # Layout the containers for the Bregman NB
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.cen_frame_br.grid(row=1, sticky="ew")
        self.btm_frame_br.grid(row=2, sticky="ew")
        self.entsTVB=self.makeFrame(self.cen_frame_br,fieldsTVB)
        
        # Widgets and layout of the Bregman bottom frame
        self.run_button = tk.Button(self.btm_frame_br,text="Run", fg="Red",command=self.TVBden)
        self.quit_button = tk.Button(self.btm_frame_br, text='Quit', command=self.cancel_b)
        self.prev_button= tk.Button(self.btm_frame_br, text='Preview', command=partial(self.preview_window_TVBr,'TV Bregman',self.entsTVB))

        self.run_button.grid(row=0,column=0)
        self.quit_button.grid(row=0,column=2)
        self.prev_button.grid(row=0,column=3)

        # Create the main containers for the Chambolle NB
        tk.Label(self.ch_frame,text="Denoise image stacks with the TV Chambolle algoritm").grid(row=0)
        self.cen_frame_ch=tk.Frame(self.ch_frame, width = nbfw, height=nbfh*len(fieldsTVCh), pady=3)
        self.btm_frame_ch=tk.Frame(self.ch_frame, width = nbfw, height=nbfh, pady=3)
        
        # Layout the containers for the Chambolle NB
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.cen_frame_ch.grid(row=1, sticky="ew")
        self.btm_frame_ch.grid(row=2, sticky="ew")
        self.entsTVCh=self.makeFrame(self.cen_frame_ch,fieldsTVCh)

        # Widgets and layout of the Chambolle bottom frame
        self.run_button = tk.Button(self.btm_frame_ch,text="Run", fg="Red",command=self.TVChden)
        self.quit_button = tk.Button(self.btm_frame_ch, text='Quit', command=self.cancel_b)
        self.prev_button= tk.Button(self.btm_frame_ch, text='Preview', command=partial(self.preview_window_TVCh,'TV Chambolle',self.entsTVCh))

        self.run_button.grid(row=0,column=0)
        self.quit_button.grid(row=0,column=2)
        self.prev_button.grid(row=0,column=3)

        # Create the main containers for the Bilateral NB
        tk.Label(self.bl_frame,text="Denoise image stacks with the Bilateral filter").grid(row=0)
        self.cen_frame_bl=tk.Frame(self.bl_frame, width = nbfw, height=nbfh*len(fieldsBlF), pady=3)
        self.btm_frame_bl=tk.Frame(self.bl_frame, width = nbfw, height=nbfh, pady=3)
        
        # Layout the containers for the Bilateral NB
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.cen_frame_bl.grid(row=1, sticky="ew")
        self.btm_frame_bl.grid(row=2, sticky="ew")
        self.entsBlF=self.makeFrame(self.cen_frame_bl,fieldsBlF)

        # Widgets and layout of the Bilateral bottom frame
        self.run_button = tk.Button(self.btm_frame_bl,text="Run", fg="Red",command=self.BlFden)
        self.quit_button = tk.Button(self.btm_frame_bl, text='Quit', command=self.cancel_b)
        self.prev_button= tk.Button(self.btm_frame_bl, text='Preview', command=partial(self.preview_window_BlF,'Bilateral Filter',self.entsBlF))

        self.run_button.grid(row=0,column=0)
        self.quit_button.grid(row=0,column=2)
        self.prev_button.grid(row=0,column=3)

        # Create the main containers for the NLM
        tk.Label(self.nlm_frame,text="Denoise image stacks with the Non Local Means algoritm").grid(row=0)
        self.cen_frame_nlm=tk.Frame(self.nlm_frame, width = nbfw, height=nbfh*len(fieldsNLM), pady=3)
        self.btm_frame_nlm=tk.Frame(self.nlm_frame, width = nbfw, height=nbfh, pady=3)
        
        # Layout the containers for the NLM
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.cen_frame_nlm.grid(row=1, sticky="ew")
        self.btm_frame_nlm.grid(row=2, sticky="ew")
        self.entsNLM=self.makeFrame(self.cen_frame_nlm,fieldsNLM)

        # Widgets and layout of the NLM bottom frame
        self.run_button = tk.Button(self.btm_frame_nlm,text="Run", fg="Red",command=self.NLMden)
        self.quit_button = tk.Button(self.btm_frame_nlm, text='Quit', command=self.cancel_b)
        self.prev_button= tk.Button(self.btm_frame_nlm, text='Preview', command=partial(self.preview_window_NLM,'Non Local Means',self.entsNLM))

        self.run_button.grid(row=0,column=0)
        self.quit_button.grid(row=0,column=2)
        self.prev_button.grid(row=0,column=3)
    def create_widgets(self):
        tabControl = ttk.Notebook(self.win)  # Create Tab Control

        tab1 = ttk.Frame(tabControl)  # Create a tab
        tabControl.add(tab1, text='Tab 1')  # Add the tab
        tab2 = ttk.Frame(tabControl)  # Add a second tab
        tabControl.add(tab2, text='Tab 2')  # Make second tab visible

        tabControl.pack(expand=1, fill="both")  # Pack to make visible

        # LabelFrame using tab1 as the parent
        mighty = ttk.LabelFrame(tab1, text=' Mighty Python ')
        mighty.grid(column=0, row=0, padx=8, pady=4)

        # Modify adding a Label using mighty as the parent instead of win
        a_label = ttk.Label(mighty, text="Enter a name:")
        a_label.grid(column=0, row=0, sticky='W')

        # Adding a Textbox Entry widget
        self.name = tk.StringVar()
        self.name_entered = ttk.Entry(mighty, width=24, textvariable=self.name)
        self.name_entered.grid(column=0, row=1, sticky='W')

        # Adding a Button
        self.action = ttk.Button(mighty,
                                 text="Click Me!",
                                 command=self.click_me)
        self.action.grid(column=2, row=1)

        ttk.Label(mighty, text="Choose a number:").grid(column=1, row=0)
        number = tk.StringVar()
        self.number_chosen = ttk.Combobox(mighty,
                                          width=14,
                                          textvariable=number,
                                          state='readonly')
        self.number_chosen['values'] = (1, 2, 4, 42, 100)
        self.number_chosen.grid(column=1, row=1)
        self.number_chosen.current(0)

        # Adding a Spinbox widget
        self.spin = Spinbox(mighty,
                            values=(1, 2, 4, 42, 100),
                            width=5,
                            bd=9,
                            command=self._spin)  # using range
        self.spin.grid(column=0, row=2, sticky='W')  # align left

        # Using a scrolled Text control
        scrol_w = 40
        scrol_h = 10  # increase sizes
        self.scrol = scrolledtext.ScrolledText(mighty,
                                               width=scrol_w,
                                               height=scrol_h,
                                               wrap=tk.WORD)
        self.scrol.grid(column=0, row=3, sticky='WE', columnspan=3)

        for child in mighty.winfo_children(
        ):  # add spacing to align widgets within tabs
            child.grid_configure(padx=4, pady=2)

        #=====================================================================================
        # Tab Control 2 ----------------------------------------------------------------------
        self.mighty2 = ttk.LabelFrame(tab2, text=' The Snake ')
        self.mighty2.grid(column=0, row=0, padx=8, pady=4)

        # Creating three checkbuttons
        chVarDis = tk.IntVar()
        check1 = tk.Checkbutton(self.mighty2,
                                text="Disabled",
                                variable=chVarDis,
                                state='disabled')
        check1.select()
        check1.grid(column=0, row=0, sticky=tk.W)

        chVarUn = tk.IntVar()
        check2 = tk.Checkbutton(self.mighty2,
                                text="UnChecked",
                                variable=chVarUn)
        check2.deselect()
        check2.grid(column=1, row=0, sticky=tk.W)

        chVarEn = tk.IntVar()
        check3 = tk.Checkbutton(self.mighty2, text="Enabled", variable=chVarEn)
        check3.deselect()
        check3.grid(column=2, row=0, sticky=tk.W)

        # trace the state of the two checkbuttons
        chVarUn.trace('w',
                      lambda unused0, unused1, unused2: self.checkCallback())
        chVarEn.trace('w',
                      lambda unused0, unused1, unused2: self.checkCallback())

        # First, we change our Radiobutton global variables into a list
        colors = ["Blue", "Gold", "Red"]

        # create three Radiobuttons using one variable
        self.radVar = tk.IntVar()

        # Next we are selecting a non-existing index value for radVar
        self.radVar.set(99)

        # Now we are creating all three Radiobutton widgets within one loop
        for col in range(3):
            curRad = tk.Radiobutton(self.mighty2,
                                    text=colors[col],
                                    variable=self.radVar,
                                    value=col,
                                    command=self.radCall)
            curRad.grid(column=col, row=1, sticky=tk.W)  # row=6
            # And now adding tooltips
            tt.create_ToolTip(curRad, 'This is a Radiobutton control')

        # Add a Progressbar to Tab 2
        self.progress_bar = ttk.Progressbar(tab2,
                                            orient='horizontal',
                                            length=286,
                                            mode='determinate')
        self.progress_bar.grid(column=0, row=3, pady=2)

        # Create a container to hold buttons
        buttons_frame = ttk.LabelFrame(self.mighty2, text=' ProgressBar ')
        buttons_frame.grid(column=0, row=2, sticky='W', columnspan=2)

        # Add Buttons for Progressbar commands
        ttk.Button(buttons_frame,
                   text=" Run Progressbar   ",
                   command=self.run_progressbar).grid(column=0,
                                                      row=0,
                                                      sticky='W')
        ttk.Button(buttons_frame,
                   text=" Start Progressbar  ",
                   command=self.start_progressbar).grid(column=0,
                                                        row=1,
                                                        sticky='W')
        ttk.Button(buttons_frame,
                   text=" Stop immediately ",
                   command=self.stop_progressbar).grid(column=0,
                                                       row=2,
                                                       sticky='W')
        ttk.Button(buttons_frame,
                   text=" Stop after second ",
                   command=self.progressbar_stop_after).grid(column=0,
                                                             row=3,
                                                             sticky='W')

        for child in buttons_frame.winfo_children():
            child.grid_configure(padx=2, pady=2)

        for child in self.mighty2.winfo_children():
            child.grid_configure(padx=8, pady=2)

        # Creating a Menu Bar
        menu_bar = Menu(self.win)
        self.win.config(menu=menu_bar)

        # Add menu items
        file_menu = Menu(menu_bar, tearoff=0)
        file_menu.add_command(label="New")
        file_menu.add_separator()
        file_menu.add_command(label="Exit", command=self._quit)
        menu_bar.add_cascade(label="File", menu=file_menu)

        # Display a Message Box
        def _msgBox():
            msg.showinfo(
                'Python Message Info Box',
                'A Python GUI created using tkinter:\nThe year is 2017.')

        # Add another Menu to the Menu Bar and an item
        help_menu = Menu(menu_bar, tearoff=0)
        help_menu.add_command(
            label="About", command=_msgBox)  # display messagebox when clicked
        menu_bar.add_cascade(label="Help", menu=help_menu)

        # Change the main windows icon
        self.win.iconbitmap('pyc.ico')

        # It is not necessary to create a tk.StringVar()
        # strData = tk.StringVar()
        strData = self.spin.get()

        # call function
        self.usingGlobal()

        self.name_entered.focus()

        # Add Tooltips -----------------------------------------------------
        # Add a Tooltip to the Spinbox
        tt.create_ToolTip(self.spin, 'This is a Spinbox control')

        # Add Tooltips to more widgets
        tt.create_ToolTip(self.name_entered, 'This is an Entry control')
        tt.create_ToolTip(self.action, 'This is a Button control')
        tt.create_ToolTip(self.scrol, 'This is a ScrolledText control')
Example #6
0
    def drawGUI(self):
        style = ttk.Style(self.root)
        style.configure('lefttab.TNotebook')
        notebook = ttk.Notebook(self.root, style='lefttab.TNotebook')
        f_create_user = tk.Frame(notebook, width=500, height=500)
        f_instance_details = tk.Frame(notebook, width=500, height=500)
        self.f_roles = tk.Frame(notebook, width=500, height=500)

        #instance information URL
        lbl_url = tk.Label(f_instance_details, text='HCM URL:')
        lbl_url.place(x=10, y=10)
        self.entry_url = tk.Entry(f_instance_details, bd=1, width=50)
        self.entry_url.place(x=110, y=10)
        #self.entry_url.focus()

        #username
        lbl_username = tk.Label(f_instance_details, text='Username:'******'Password:'******'Save',
                             command=self.save_to_pickle,
                             width=10,
                             fg="black",
                             bd=3)
        btn_save.place(x=10, y=130)

        #Create User
        lbl_new_usrname = tk.Label(f_create_user, text='*UserName:'******'First Name:')
        lbl_fn.place(x=10, y=40)
        self.entry_fn = tk.Entry(f_create_user, bd=1, width=50)
        self.entry_fn.place(x=110, y=40)

        #Last Name
        lbl_ln = tk.Label(f_create_user, text='Last Name:')
        lbl_ln.place(x=10, y=70)
        self.entry_ln = tk.Entry(f_create_user, bd=1, width=50)
        self.entry_ln.place(x=110, y=70)

        #password
        lbl_pw = tk.Label(f_create_user, text='*Password:'******'Roles to be assigned (separated by comma)')
        lbl_roles.place(x=10, y=130)
        self.text_role = tk.Text(f_create_user, height=8, width=50)
        self.text_role.place(x=10, y=150)

        #Create User button
        self.btn_create_usr = tk.Button(f_create_user,
                                        text='Create User',
                                        command=self.call_create_user,
                                        width=20,
                                        fg="black",
                                        bd=3)
        self.btn_create_usr.place(x=10, y=290)

        #status area
        lbl_status = tk.Label(f_create_user, text='Status:')
        lbl_status.place(x=10, y=330)
        self.text_status = tk.Text(f_create_user,
                                   height=5,
                                   width=50,
                                   state='disabled')
        self.text_status.place(x=10, y=350)

        #Tab 3
        #add refresh role button
        self.btn_fetch_roles = tk.Button(self.f_roles,
                                         text='Fetch roles from system',
                                         command=self.fetch_roles,
                                         width=30,
                                         fg="black",
                                         bd=3)
        self.btn_fetch_roles.place(x=10, y=10)

        self.lbl_roles_fetch_status = tk.Label(self.f_roles, text='Status:')
        self.lbl_roles_fetch_status.place(x=10, y=50)

        # cols = ('role_name', 'role_code', 'role_category')
        # tv = ttk.Treeview(f_roles, columns=cols, show='headings')
        # f_roles.grid_rowconfigure(0, weight = 1)
        # f_roles.grid_columnconfigure(0, weight = 1)

        # tv.heading('#1', text='Role Name', anchor='w')
        # tv.heading('#2', text='Role Code')
        # tv.heading('#3', text='Role Category')
        # #tv.pack(fill='both', expand=True)

        # vsb = ttk.Scrollbar(f_roles, orient="vertical", command=tv.yview)
        # vsb1 = ttk.Scrollbar(f_roles, orient="horizontal", command=tv.xview)
        # tv.configure(yscrollcommand=vsb.set, xscrollcommand=vsb1.set)
        # tv.bind("<Double-1>", self.fetch_roles)
        # #vsb.pack(side='right', fill='y')
        # #vsb1.pack(side='bottom', fill='x')
        # tv.grid(row=0,column=0, sticky='nsew')
        # vsb.grid(row=0,column=1,sticky='ns')
        # vsb1.grid(row=1,column=0, sticky='ew')
        # self.treeview = tv

        # for i in range(1,100):
        # 	tv.insert('','end',text="First",values=(i,i,i))

        notebook.add(f_create_user, text='Create User')
        notebook.add(f_instance_details, text='Instance Details')
        notebook.add(self.f_roles, text='Roles')

        notebook.pack(expand=1, fill='both')
Example #7
0
    def start_admin_mode(self, tool):
        password = simpledialog.askstring(title="Tool Password",
                                          prompt=f"Please enter password for {tool.manifest['name']}", show="*")
        if password != tool.manifest['password']:
            raise InterfaceError("Password is incorrect")

        window = self.deploy_window(f"ADMIN:{tool.manifest['name']}", 800, 800, True)

        notebook = ttk.Notebook(window)
        notebook.pack(expand=1, fill=BOTH)

        data = ttk.Frame(notebook)
        notebook.add(data, text="DataSet Preview")

        datatypes = ttk.Frame(notebook)
        notebook.add(datatypes, text="Manage Dropdowns")

        new_lst = [
            [{"type": "label", "value": "tester the sdf sdf sdf sdf sdf sdf sdf sdf sfd sdf "},
             {"type": "label", "value": "tester fslgjslfkjsdlfkjsdflkjsdflksjfd"},
             {"type": "label", "value": "tester"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
            [{"type": "label", "value": "tester"}, {"type": "input"},
             {"type": "input"}],
        ]

        Table(data, new_lst)
Example #8
0
from tkinter import *
import tkinter.font as font
import math
from tkinter import ttk
import tkinter as tk
from tkinter import messagebox



window = tk.Tk()
window.geometry("535x542")
window.title("Számológép")

"""Create a notebook"""
notebook = ttk.Notebook(window)
notebook.pack(pady=50, expand=True)
notebook.grid(row=1, column=0)

"""Create frames"""
frame0 = ttk.Frame(window)
frame0.grid(row=0, column=0)

frame1 = ttk.Frame(notebook, width=400, height=280)
frame2 = ttk.Frame(notebook, width=400, height=280)
frame3 = ttk.Frame(notebook,width=400, height=280)
frame4 = ttk.Frame(notebook,width=400, height=280)

# frame0.pack(fill='both', expand=True)
frame1.pack(fill='both', expand=True)
frame2.pack(fill='both', expand=True)
frame3.pack(fill='both', expand=True)
Example #9
0
def on_tab_selected(event):
    selected_tab = event.widget.select()
    tab_text = event.widget.tab(selected_tab, "text")

    if tab_text == "Speed Mode":
        print("Speed Mode tab selected")
    if tab_text == "Angle Mode":
        print("Angle Mode tab selected")


window = tk.Tk()
window.title("Sternfeuerung 1.0 Beta")

#=====================Setting Tab 1 and Tab 2============================#
tab_parent = ttk.Notebook(window)

tab1 = ttk.Frame(tab_parent)
tab1.grid()
tab2 = ttk.Frame(tab_parent)
tab2.grid()

tab_parent.bind("<<NotebookTabChanged>>", on_tab_selected)
tab_parent.add(tab1, text="Speed Mode")
tab_parent.add(tab2, text="Angle Mode")

feedbackspeed = StringVar()
check1 = IntVar()
check1.set(0)

#=========================Tab 1: Speed Mode=============================#
Example #10
0
from PIL import ImageTk, Image # For showing images with Tkinter

from tkinter import messagebox #For showing popup messages on errors

from tkinter import ttk #For showing different tabs in the interface

import os

import webbrowser

import wikipedia

root = Tk()#Making the main window for user interaction

my_notebook=ttk.Notebook(root)#Creating a notebook to show tabs

my_notebook.grid(row=0,column=0)

a=0

class HoverLabel(Label):

	def __init__(self, master, **kw):
	    Label.__init__(self,master=master,**kw)
	    self.defaultForeground = self["foreground"]
	    self.bind("<Enter>", self.on_enter)
	    self.bind("<Leave>", self.on_leave)

	def on_enter(self, e):
	    self['foreground'] = self['activeforeground']
Example #11
0
    arr_pd.append(e1.get())
    arr_name.append(e2.get())
    arr_all_name.append(e3.get())
    # with open(dir_path + '/last.json', 'w', encoding='utf8') as json_f:
    #     json.dump(print_info(find_key(e1.get())), json_f, ensure_ascii=False)


master = Tk()
master.geometry("500x250")

rows = 0
while rows < 50:
    master.rowconfigure(rows, weight=1)
    master.columnconfigure(rows, weight=1)
    rows += 1
nb = ttk.Notebook(master)
nb.grid(row=1, column=0, columnspan=50, rowspan=49, sticky='NESW')
main_page = ttk.Frame(nb)
nb.add(main_page, text='Main')
page1 = ttk.Frame(nb)
nb.add(page1, text='Tab1')
page2 = ttk.Frame(nb)
nb.add(page2, text='Tab2')
m_l = Label(
    main_page,
    text=
    "To work with all files go to Tab1.\n\nTo work with the specified one go to Tab2"
)
m_l.config(font=("Courier", 14))
m_l.place(x=5, y=50)
b1 = Button(page1, text="Show_path", command=openfile)
Example #12
0
import tkinter as tk
from tkinter import ttk
 
import platform
 
def quit():
    global tkTop
    tkTop.destroy()
 
tkTop = tk.Tk()
tkTop.geometry('500x300')
 
tkLabelTop = tk.Label(tkTop, text=" http://hello-python.blogspot.com ")
tkLabelTop.pack()
 
notebook = ttk.Notebook(tkTop)
frame1 = ttk.Frame(notebook)
frame2 = ttk.Frame(notebook)
notebook.add(frame1, text='Frame One')
notebook.add(frame2, text='Frame Two')
notebook.pack()
 
tkButtonQuit = tk.Button(
    tkTop,
    text="Quit",
    command=quit)
tkButtonQuit.pack()
  
tkDummyButton = tk.Button(
    frame1,
    text="Dummy Button")
Example #13
0
    def __init__(self, master):
        tk.Frame.__init__(self, master)
        self.master.title("Stack Intensity correction App")
        self.master.resizable(False, False)
        self.master.tk_setPalette(background='#ececec')
        x = int(
            (self.master.winfo_screenwidth() - self.master.winfo_reqwidth()) /
            1.5)
        y = int(
            (self.master.winfo_screenheight() - self.master.winfo_reqheight())
            / 1.5)
        self.master.geometry('{}x{}'.format(x, y))

        self.n = ttk.Notebook(master)
        self.IC_frame = tk.Frame(self.n, width=mfw, height=mfh)
        self.CLAHE_frame = tk.Frame(self.n, width=mfw, height=mfh)

        self.n.add(self.IC_frame, text='Intensity Correction')
        self.n.add(self.CLAHE_frame, text='Contrast enhancement')
        self.n.pack()

        # Create the main containers for the Intensity correction notebook
        tk.Label(
            self.IC_frame,
            text="App to correct for B&C changes in image stacks").grid(row=0)
        self.top_frame = tk.Frame(self.IC_frame,
                                  width=nbfw,
                                  height=nbfh,
                                  pady=3)
        self.cen_frame = tk.Frame(self.IC_frame,
                                  width=nbfw,
                                  height=nbfh * len(params[1:]),
                                  pady=3)
        self.btm_frame = tk.Frame(self.IC_frame,
                                  width=nbfw,
                                  height=nbfh,
                                  pady=3)

        # Create the main containers for the Intensity correction notebook
        tk.Label(
            self.CLAHE_frame,
            text="App to enhance local contrast in image stacks (CLAHE)").grid(
                row=0)
        self.top_frame_CE = tk.Frame(self.CLAHE_frame,
                                     width=nbfw,
                                     height=nbfh,
                                     pady=3)
        self.cen_frame_CE = tk.Frame(self.CLAHE_frame,
                                     width=nbfw,
                                     height=nbfh * len(paramsCE[1:]),
                                     pady=3)
        self.btm_frame_CE = tk.Frame(self.CLAHE_frame,
                                     width=nbfw,
                                     height=nbfh,
                                     pady=3)

        # Layout the containers
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.top_frame.grid(row=0, sticky="ew")
        self.cen_frame.grid(row=1, sticky="ew")
        self.btm_frame.grid(row=2, sticky="ew")

        self.fpath = tk.Label(self.top_frame, text=fields[0][0])
        self.fp = tk.StringVar(self.top_frame)
        self.fpath_val = tk.Entry(self.top_frame, textvariable=self.fp)
        self.browse_button = tk.Button(self.top_frame,
                                       text="Browse",
                                       fg="green",
                                       command=partial(self.browseSt, self.fp))

        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.top_frame_CE.grid(row=0, sticky="ew")
        self.cen_frame_CE.grid(row=1, sticky="ew")
        self.btm_frame_CE.grid(row=2, sticky="ew")

        self.fpath_CE = tk.Label(self.top_frame_CE, text=fields[0][0])
        self.fp_CE = tk.StringVar(self.top_frame_CE)
        self.fpath_val_CE = tk.Entry(self.top_frame_CE,
                                     textvariable=self.fp_CE)
        self.browse_button_CE = tk.Button(self.top_frame_CE,
                                          text="Browse",
                                          fg="green",
                                          command=partial(
                                              self.browseSt, self.fp_CE))

        # layout the widgets in the top frame
        self.fpath.grid(row=0)
        self.fpath_val.grid(row=0, column=1)
        self.browse_button.grid(row=0, column=2)

        self.fpath_CE.grid(row=0)
        self.fpath_val_CE.grid(row=0, column=1)
        self.browse_button_CE.grid(row=0, column=2)

        self.ents = self.makeFrame(self.cen_frame, fields, self.fp)

        self.ents_CE = self.makeFrame(self.cen_frame_CE, fieldsCE, self.fp_CE)

        # Widgets of the bottom frame
        self.run_button = tk.Button(self.btm_frame,
                                    text="Run",
                                    fg="Red",
                                    command=partial(self.CorrInt, self.ents))
        self.quit_button = tk.Button(self.btm_frame,
                                     text='Quit',
                                     command=self.cancel_b)

        self.run_button.grid(row=0, column=0)
        self.quit_button.grid(row=0, column=2)

        self.run_button = tk.Button(self.btm_frame_CE,
                                    text="Run",
                                    fg="Red",
                                    command=partial(self.calcCLAHE,
                                                    self.ents_CE))
        self.quit_button = tk.Button(self.btm_frame_CE,
                                     text='Quit',
                                     command=self.cancel_b)
        self.prev_button = tk.Button(self.btm_frame_CE,
                                     text='Preview',
                                     command=partial(self.preview_window_CLAHE,
                                                     self.ents_CE))

        self.run_button.grid(row=0, column=0)
        self.quit_button.grid(row=0, column=2)
        self.prev_button.grid(row=0, column=3)

        root.bind('<Return>', (lambda event: self.fetch(self.ents)))
        root.bind('<Tab>', (lambda event: self.fetch(self.ents_CE)))
Example #14
0
    def start(self):
        """
        Main routine of the script; invoked by the main program just after start 
        """
        # get the input ICS filename via GUI dialog (Tkinter))
        i_fname = askopenfilename()

        # read the data from the ICS input file
        if i_fname:
            i_file = open(i_fname, 'r')
            indata = i_file.read()
            i_file.close()
            self.o_fname = splitext(i_fname)[0] + "_selection.ics"

            # extract the list of events from the ICS input data
            try:
                self.app_caldata = Calendar(indata)
            except:
                messagebox.showinfo(
                    "Warning", "Something seems to be wrong with " +
                    "your input file %s" % basename(i_fname))
            else:
                # read the calendar events from the input file
                self.my_e_list = self.app_caldata.events  # list of events
                self.my_e_list.sort()  # sort them by ascending creation time
                self.e_len = len(
                    self.my_e_list)  # total amount of events in list

                if self.e_len == 0:
                    messagebox.showinfo(
                        "Warning",
                        "Your input file is empty: %s\nThere is nothing to do."
                        % basename(i_fname))
                else:
                    # Let's start the GUI
                    self.root = tk.Tk()
                    self.root.title("ICS Event Selector (" + str(self.e_len) +
                                    " events in total)")

                    # Create a menu bar
                    self.menu_bar = Menu(self.root)
                    self.root.config(menu=self.menu_bar)

                    # Add a menu to the bar, and assign some menu items to the menu
                    self.file_menu = Menu(
                        self.menu_bar, tearoff=0
                    )  # tearoff = remove default dashed line at the top
                    self.file_menu.add_command(label="Save and Exit",
                                               command=self.do_save_and_exit)
                    self.file_menu.add_command(label="Quit without Saving",
                                               command=self.do_quit_now)
                    self.menu_bar.add_cascade(label="File",
                                              menu=self.file_menu)

                    # Add one more menu to the bar, and assign a menu item to the menu
                    self.help_menu = Menu(self.menu_bar, tearoff=0)
                    self.help_menu.add_command(label="About",
                                               command=self.do_give_help)
                    self.menu_bar.add_cascade(label="Help",
                                              menu=self.help_menu)

                    # Find out how many tabs we need in order to display all of our events
                    self.e_per_tab = 20  # number of entries per tab
                    self.no_of_tabs = self.e_len // self.e_per_tab  # // = floor division
                    self.e_on_last_tab = self.e_len % self.e_per_tab  # entries in last tab (% = modulus)
                    if (self.e_on_last_tab > 0):
                        self.no_of_tabs += 1  # total number of tabs
                    else:
                        self.e_on_last_tab = self.e_per_tab  # there is no tab with zero elements

                    # Create the needed tabs
                    self.tab_control = ttk.Notebook(self.root)
                    self.tab_control.grid()  # Make tabs visible
                    e_start = 0
                    for n in range(self.no_of_tabs):
                        if n == self.no_of_tabs - 1:  # last tab
                            e_end = e_start + self.e_on_last_tab - 1
                        else:  # up to penultimate tab
                            e_end = e_start + self.e_per_tab - 1
                        # Add a new tab
                        self.new_tab = MyTab(
                            parent=self.tab_control,
                            e_list=self.my_e_list[
                                e_start:e_end +
                                1]  # subset of overall event list
                            #                            e_list=self.my_e_list[e_start:e_end+1],  # subset of overall event list
                            #                            parent_app=self.my_app
                        )
                        self.tab_control.add(self.new_tab,
                                             text=" " + str(n + 1) + " ")
                        self.my_tab_list.append(self.new_tab)
                        e_start = e_start + self.e_per_tab

                    self.tab_control.grid()  # Make tabs visible

                    self.root.mainloop()
Example #15
0
            title="Select where to save the downloaded chapter",
            filetypes=(("Compressed files", "*.zip"), ))
    chapter_downloader.download_chapter(manga_names[selected_manga.get()],
                                        selected_chapter,
                                        bool(wants_zip.get()), download_path,
                                        progress, app, progressLabel)


app.title("Kaguya Downloader")
app.resizable(0, 0)
app.iconphoto(True, PhotoImage(file="Assets/logo.png"))

app.get_themes()
app.set_theme("breeze")

note_book = ttk.Notebook(app)
page_download_chapters = ttk.Frame(note_book)
page_download_volumes = ttk.Frame(note_book)
page_show_help = ttk.Frame(note_book)

selected_manga = IntVar()
selected_manga.set(0)

wants_zip = IntVar()
wants_zip.set(0)

selected_chapter = "1"

# Single Chapter Download

labelTop = ttk.Label(page_download_chapters, text="Chapter to download:")
Example #16
0
        self.winswgx_dir.set(new_dirname)

    def ishuttle_open_dir(self):
        new_dirname = filedialog.askdirectory(parent=self, initialdir='c:\\')
        cfg_file = open('config.ini', 'w')
        self.config.set('Ugalaxy', 'dir', new_dirname)
        self.config.write(cfg_file)
        self.lbl_ishuttle_value.set(new_dirname)

    def pyinsta_open_dir(self):
        new_dirname = filedialog.askdirectory(parent=self, initialdir='c:\\')
        cfg_file = open('config.ini', 'w')
        self.config.set('PyInsta', 'dir', new_dirname)
        self.config.write(cfg_file)
        self.lbl_pyinsta_value.set(new_dirname)


if __name__ == "__main__":
    root = tk.Tk()
    main = tk.Frame(root)
    x = (root.winfo_screenwidth() - root.winfo_reqwidth()) / 2
    y = (root.winfo_screenheight() - root.winfo_reqheight()) / 2
    root.geometry("600x300+%d+%d" % (x, y))
    root.title('PyInsta')
    notebook = ttk.Notebook(main)
    tab1 = Impostazioni(notebook, main)
    notebook.add(tab1, text='Impostazioni', compound='left')
    main.grid()
    notebook.grid()
    root.mainloop()
Example #17
0
from faceDetector import *

# main window
main = Tk()
main.title('CMU Let Me In')
main.geometry('500x700')

# gives weight to the cells in the grid
rows = 0
while rows < 50:
    main.rowconfigure(rows, weight=1)
    main.columnconfigure(rows, weight=1)
    rows += 1

# Defines and places the notebook widget
nb = ttk.Notebook(main)
nb.grid(row=1, column=0, columnspan=50, rowspan=49, sticky='NESW')

vc = cv2.VideoCapture(0)
fr = CMUFaceRecogniser()


def show_frame(event=None):

    # working out which is the current Tab
    tabId = nb.index(nb.select())

    if tabId == 0:
        e2.delete(0, 'end')  # delete entry's text of tab 2

        retrain = False
    def __init__(self, *args, **kwargs):

        self.arduino = None
        self.queue = queue.Queue(maxsize=100)
        self.readConfigData()
        self.ledtable = {}
        self.currentTabClass = ""
        self.maxLEDcnt = 0
        self.paramDataChanged = False

        tk.Tk.__init__(self, *args, **kwargs)
        screen_width = self.winfo_screenwidth()
        screen_height = self.winfo_screenheight()
        if self.getConfigData("pos_x") < screen_width and self.getConfigData(
                "pos_y") < screen_height:

            self.geometry(
                '+%d+%d' %
                (self.getConfigData("pos_x"), self.getConfigData("pos_y")))
        else:
            self.geometry("+100+100")

        tk.Tk.wm_title(self, "MobaLedLib " + VERSION)

        self.title("MobaLedLib " + VERSION)
        self.transient(self.master)
        self.resizable(False, False)
        self.rowconfigure(1, weight=1)

        self.color = ""
        style = ttk.Style(self)
        style.map("palette.TFrame",
                  relief=[('focus', 'sunken')],
                  bordercolor=[('focus', "#4D4D4D")])
        self.configure(background=style.lookup("TFrame", "background"))

        menu = tk.Menu(self)
        self.config(menu=menu)
        filemenu = tk.Menu(menu)
        menu.add_cascade(label=_("Datei"), menu=filemenu)
        filemenu.add_command(label=_("Farbpalette von Datei lesen"),
                             command=self.OpenFile)
        filemenu.add_command(label=_("Farbpalette speichern als ..."),
                             command=self.SaveFileas)
        filemenu.add_separator()
        filemenu.add_command(label=_("LED Tabelle von Datei lesen"),
                             command=self.OpenFileLEDTab)
        filemenu.add_command(label=_("LED Tabelle speichern als"),
                             command=self.SaveFileLEDTab)
        filemenu.add_separator()
        filemenu.add_command(label=_("Beenden und Daten speichern"),
                             command=self.ExitProg_with_save)
        filemenu.add_command(label=_("Beenden ohne Daten zu speichern"),
                             command=self.ExitProg)

        colormenu = tk.Menu(menu)
        menu.add_cascade(label=_("Farbpalette"), menu=colormenu)
        colormenu.add_command(
            label=_("letzte Änderung Rückgängig machen [CTRL-Z]"),
            command=self.MenuUndo)
        #colormenu.add_command(label=_("Farbpalette Wiederherstellen [CRTL-Y]"), command=self.MenuRedo)
        colormenu.add_command(label=_("von Datei lesen"),
                              command=self.OpenFile)
        colormenu.add_command(label=_("speichern als ..."),
                              command=self.SaveFileas)
        colormenu.add_separator()
        colormenu.add_command(label=_("auf Standard zurücksetzen"),
                              command=self.ResetColorPalette)

        arduinomenu = tk.Menu(menu)
        menu.add_cascade(label=_("ARDUINO"), menu=arduinomenu)
        arduinomenu.add_command(label=_("Verbinden"),
                                command=self.ConnectArduino)
        arduinomenu.add_command(label=_("Trennen"),
                                command=self.DisconnectArduino)
        arduinomenu.add_command(label=_("Alle LED aus"),
                                command=self.SwitchoffallLEDs)

        helpmenu = tk.Menu(menu)
        menu.add_cascade(label=_("Hilfe"), menu=helpmenu)
        helpmenu.add_command(label=_("Hilfe öffnen"), command=self.OpenHelp)
        helpmenu.add_command(label=_("Über..."), command=self.About)

        # --- define container for tabs

        self.container = ttk.Notebook(self)

        self.container.pack(side="top", fill="both", expand=True)
        self.container.grid_rowconfigure(0, weight=1)
        self.container.grid_columnconfigure(0, weight=1)

        self.tabdict = dict()

        for tabClass in tabClassList:
            frame = tabClass(self.container, self)
            tabClassName = frame.tabClassName
            self.tabdict[tabClassName] = frame
            self.container.add(frame, text=frame.tabname)

        self.continueCheckDisconnectFile = True
        self.onCheckDisconnectFile()

        self.container.bind("<<NotebookTabChanged>>", self.TabChanged)

        startpagename = self.getStartPageClassName()

        #if self.getConfigData("startpage") == 1:
        #    self.showFramebyName("ColorCheckPage")
        #else:
        #    if self.getConfigData("startpage") == 2:                                      # 04.12.19:
        #        self.showFramebyName("SerialMonitorPage")
        #    else:
        #        self.showFramebyName("ConfigurationPage")

        self.showFramebyName(startpagename)

        self.statusmessage = tk.Label(self,
                                      text=_('Status:'),
                                      fg="black",
                                      bd=1,
                                      relief="sunken",
                                      anchor="w")
        self.statusmessage.pack(side="bottom", fill="x")
        self.ToolTip(
            self.statusmessage,
            text=
            "Zeigt den Status der Verbindung zum ARDUINO an: \nVerbunden - eine Verbidnug zum ARDUINO steht\nNicht verbunden - keine Verbindung zum ARDUINO"
        )

        self.focus_set()
        self.wait_visibility()

        self.lift()
        self.grab_set()
Example #19
0
 def __init__(self, parent):
     self.parent = parent.tabframe
     self.notebook = ttk.Notebook(self.parent)
     self.notebook.pack(expand=tk.YES, fill=tk.BOTH)
     self.regexs = regexs
     self.notebook.bind("<<NotebookTabChanged>>", lambda interruptinfo: refreshmatches(parent))
Example #20
0
    img = PhotoImage(file=name).subsample(1)
    can.create_image(10, 10, image=img, anchor=NW)


def receiptsChange(name):
    global img
    tabs.select(0)
    img = PhotoImage(file=name).subsample(1)
    can.create_image(10, 10, image=img, anchor=NW)


gui = Tk()
gui.geometry("900x800")
gui.title("Receipts")

tabs = ttk.Notebook(gui)
text = [1, 2, 3, 4]
tabs1 = Frame(tabs)  #рамка-Frame
#tabs2 = Frame(tabs)
#tabs3 = Frame(tabs)
#tabs4 = Frame(tabs)
tabs.add(tabs1, text=1)
#tabs.add(tabs2,text=2)
#tabs.add(tabs3,text=3)
#tabs.add(tabs4,text=4)
tabs.grid(row=0, column=5)

#иконка
icon = ["iconfinder_ic_import_contacts_48px_3669166.ico"]
gui.iconbitmap(icon)
Example #21
0
treeview_sheet = ttk.Treeview(right_frame,
                              height=10,
                              columns=('图标 栏'),
                              selectmode='extended')
treeview_sheet.heading('#0', text='图标栏1'), treeview_sheet.heading('#1',
                                                                  text='图标栏2')
for i in range(30):
    treeview_sheet.insert('', index='end', text=i, values=i)
treeview_tree = ttk.Treeview(right_frame, height=10, show='tree')
treeview_tree_parents = treeview_tree.insert('', index='end', text='结构树')
for i in range(10):
    treeview_tree.insert(treeview_tree_parents, index='end', text=i)

frame_nb1, frame_nb2 = ttk.Frame(right_frame), ttk.Frame(right_frame)
notebook = ttk.Notebook(right_frame, height=200, width=200)
notebook.add(frame_nb1, text='选项卡1'), notebook.add(frame_nb2, text='选项卡2')

canvas = tk.Canvas(right_frame, bg='white', height=300, width=300)
canvas.create_line(10, 10, 50, 30, 60, 70)
canvas.bind('<B1-Motion>', paint)

text = tkinter.scrolledtext.ScrolledText(bottom_frame,
                                         height=5).pack(side='left',
                                                        fill='both',
                                                        expand=1)

balloon = tix.Balloon(right_frame)
balloon.bind_widget(button_top, balloonmsg='这是一个气泡提示')

popupmenu = tk.Menu(root, tearoff=0)
Example #22
0
    def __init__(self, title, *args, **kwargs):
        Tk.__init__(self, *args, **kwargs)

        self.wm_resizable(0, 0)
        self.title(title)
        self.wm_iconbitmap("images\doublehelix.ico")
        self.messages = [
            "Start a new process, convert a GEO text file to "
            "Excel, or play with settings.",  # File
            "Edit the main form or reset both forms.",  # Edit
            "Toggle the status bar.",  # View
            "Stop to stop running program then exit for quick "
            "exit.",
            "Plot a word cloud of an output file based on the "
            "number of citations from PubMed.",  # Graph
            "Edit the advanced menu."
        ]  # Advanced
        self.bg_color = 'powder blue'

        self.container = Frame(self)
        self.container.pack(side='top', fill='both', expand=True)

        # sub_container for options bar
        self.sub_container = Frame(self.container)
        self.sub_container.pack()

        self.side_bar = OptionsBar(self.sub_container, self)
        self.side_bar.grid(column=0, rowspan=3, pady=10)

        self.pb_space = Frame(self.container, {
            'height': 50,
            'width': 500,
            'background': 'red'
        })

        # pady 2nd param also controls status bar placement
        # if the window was resizable it would be placed incorrectly
        self.pb_space.pack(pady=10)

        self.key = WordcloudKey(
            self.pb_space, {
                'background': 'white',
                'highlightthickness': '4',
                'highlightcolor': 'gray90'
            })

        self.bar = ProgressWin(self.pb_space, self)

        self.status_bar = StatusBar(self.container)
        self.status_bar.pack(side="bottom", fill=X, expand=True, anchor='s')
        self.status_bar.set("Ready")

        # =================
        # NOTEBOOK AND TABS
        # =================

        self.nbk = ttk.Notebook(self.sub_container,
                                width=NOTEBOOK_WIDTH,
                                height=NOTEBOOK_HEIGHT)

        self.nbk.bind('<<NotebookTabChanged>>', self.change_tabs)

        # contains ttk.Frame type for adding and showing frames
        self.frames = {}
        self.custom_frames = {}  # contains custom types for accessing elements

        # AdvancedPage is before FormPage because FormPage init needs to access
        # its methods (save and import_entries)
        for F in (StartPage, AdvancedPage, FormPage, OutputPage):
            frame = ttk.Frame(self.nbk)
            custom = F(
                frame, self, {
                    'background': NOTEBOOK_COLOR,
                    'highlightthickness': '4',
                    'highlightcolor': 'gray90'
                })
            custom.pack(expand=True, fill=BOTH, side=TOP)
            custom.tkraise()

            # instead of the class as the key, the string is the key
            self.frames[str(F)[15:-2]] = frame
            self.custom_frames[str(F)[15:-2]] = custom

        self.nbk.grid(row=1,
                      column=1,
                      sticky='nsew',
                      padx=(0, 20),
                      pady=(20, 5))

        # ========
        # MENU BAR
        # ========

        self.menubar = Menu(self)

        filemenu = Menu(self.menubar, tearoff=0)
        filemenu.add_command(label="New Process",
                             command=lambda: self.show_frame('FormPage'))
        filemenu.add_command(label="Convert", command=self.convert)

        filemenu.add_separator()

        settingsmenu = Menu(filemenu, tearoff=0)
        settingsmenu.add_command(label="Change Color",
                                 command=self.change_color)

        advanced_page_ = self.custom_frames['AdvancedPage']
        settingsmenu.add_command(label="Import Settings",
                                 command=advanced_page_.import_settings)
        settingsmenu.add_command(label="Save Settings",
                                 command=advanced_page_.save_settings)
        filemenu.add_cascade(label="Settings", menu=settingsmenu)

        entriesmenu = Menu(filemenu, tearoff=0)
        entriesmenu.add_command(label="Import Entries",
                                command=advanced_page_.import_entries)
        entriesmenu.add_command(label="Save Entries",
                                command=advanced_page_.save)
        filemenu.add_cascade(label="Entries", menu=entriesmenu)

        self.menubar.add_cascade(label="File", menu=filemenu)  # index = 0

        editmenu = Menu(self.menubar, tearoff=0)
        editmenu.add_command(label="Main Form",
                             command=lambda: self.show_frame('FormPage'))
        editmenu.add_command(label="Reset", command=self.reset)
        self.menubar.add_cascade(label="Edit", menu=editmenu)  # index = 1

        self.show_status = BooleanVar()
        self.show_status.set(True)
        viewmenu = Menu(self.menubar, tearoff=0)
        viewmenu.add_checkbutton(label="Status bar",
                                 command=self.status_bar_toggle,
                                 variable=self.show_status,
                                 onvalue=True,
                                 offvalue=False)
        self.menubar.add_cascade(label="View", menu=viewmenu)  # index = 2

        runmenu = Menu(self.menubar, tearoff=0)
        runmenu.add_command(label="Run Process",
                            command=lambda: main.get_entries(self))
        runmenu.add_command(label="Save and Stop", command=self.save_and_quit)
        runmenu.add_command(label="Stop", command=self.complete)
        runmenu.add_command(label="Exit", command=sys.exit)
        self.menubar.add_cascade(label="Run", menu=runmenu)

        graphmenu = Menu(self.menubar, tearoff=0)
        graphmenu.add_command(label="Word Cloud", command=self.display_cloud)
        self.menubar.add_cascade(label="Graph", menu=graphmenu)

        advancedmenu = Menu(self.menubar, tearoff=0)
        advancedmenu.add_command(
            label="Options", command=lambda: self.show_frame('AdvancedPage'))
        self.menubar.add_cascade(label="Advanced", menu=advancedmenu)

        self.config(menu=self.menubar)
        self.menubar.bind('<<MenuSelect>>', self.status_bar_update)

        # ==========
        # POPUP MENU
        # ==========

        self.popup = Menu(self, tearoff=0)
        self.popup.add_command(label='Close', command=self.close_tab)
        self.popup.add_command(label='Open All Tabs',
                               command=self.open_all_tabs)
        self.popup_index = None

        self.frame_indexes = {}
        self.current_frame = None
        self.add_frame('StartPage')

        self.update_color()
Example #23
0
def getOut():
    finishLine.close()
    root.destroy()


#initialize the main application
root = tkinter.Tk()
root.title("PyGP Management GUI")
root.minsize(width=500, height=500)

#define variables here
serialPortString = StringVar()
serialPortString.set('COM1')

#initialize the main three tabs
tabs = ttk.Notebook(root)
regTab = ttk.Frame(tabs)
raceTab = ttk.Frame(tabs)
devTab = ttk.Frame(tabs)
tabs.add(regTab, text='Registration')
tabs.add(raceTab, text='Race Admin')
tabs.add(devTab, text='Device Admin')

tabs.pack(expand=1, fill="both")
Label(devTab, text="Port:").grid(row=0, column=1, sticky=W)
Entry(devTab, textvariable=serialPortString).grid(row=0,
                                                  column=2,
                                                  columnspan=2,
                                                  sticky=(E, W))
Button(devTab, text="Set Port", command=setPort).grid(row=0,
                                                      column=4,
                                h / 2,
                                x_p + w / 2,
                                y_p + h / 2,
                                fill="red",
                                width=5)
        self.canvas.create_rectangle(x_p - self.m / 2 + w / 2,
                                     y_p - self.m / 2 + h / 2,
                                     x_p + self.m / 2 + w / 2,
                                     y_p + self.m / 2 + h / 2,
                                     fill="red")

        self.canvas.after(int(self.delta * 1000), self.move_pendulum)


window = tkinter.Tk()
window.title("Physics Simulations")

tab_control = ttk.Notebook(window)

momentum = Momentum(tab_control)
momentum.configure(bg="#ffffff")
tab_control.add(momentum, text='Momentum')

pendulum = Pendulum(tab_control)
pendulum.configure(bg="#ffffff")
tab_control.add(pendulum, text='Pendulum')

tab_control.pack()

window.mainloop()
Example #25
0
    def __init__(self, root, smart_wheels):
        """Interface for SmartWheels, 

        makes an interface for a list of SWMGuiElements objects.
        """
        # super(Interface, self).__init__(root)
        self.i_wanna_live = True
        self.sub_window_open = False  # is set back to false from the sub window

        self.root = root
        mainframe = ttk.Frame(root)
        # mainframe = ttk.Frame(root, padding="3 3 12 12")
        mainframe.grid(column=0, row=0, sticky=(tk.N, tk.W, tk.E, tk.S))
        mainframe.columnconfigure(0, weight=1)
        mainframe.rowconfigure(0, weight=1)

        self.mainframe = mainframe
        #self.mainframe.bind("<Configure>", self.on_resize)

        # top menu
        menu = tk.Menu(self.root)
        self.root.config(menu=menu)
        menu_file = tk.Menu(menu)
        menu.add_cascade(label='File', menu=menu_file)
        menu_file.add_command(label='New Wheel', command=self.new_wheel)
        menu_file.add_command(label='Quit', command=self.quit)

        # tabs
        note = ttk.Notebook(mainframe)
        note.grid(row=0, column=0)

        self.smart_wheels = smart_wheels
        self.gui_elements = {}

        self.steer_set_point = 0
        self.speed_set_point = 0

        for i, smart_wheel in enumerate(
                smart_wheels):  # every smart_wheel must have a unique name
            self.gui_elements[smart_wheel.name] = {}
            new_tab = ttk.Frame(note)

            row = 0
            ttk.Label(new_tab, text=smart_wheel.name).grid(row=row,
                                                           column=0,
                                                           columnspan=3)

            # pw = ttk.PanedWindow(new_tab, orient=tk.VERTICAL)

            # Connection
            row += 1
            label_frame_connection = ttk.Labelframe(new_tab,
                                                    text='Connection',
                                                    padding=self.PADDING)
            label_frame_connection.grid(row=row,
                                        column=0,
                                        columnspan=4,
                                        sticky="nsew")

            label_frame_row = 0
            sm_button = smart_wheel.create_button(
                label_frame_connection, 'connect_button', 'Connect',
                self.button_fun(smart_wheel, new_tab, 'connect'))
            sm_button.grid(row=label_frame_row, column=0)
            sm_button = smart_wheel.create_button(
                label_frame_connection, 'disconnect_button', 'Disconnect',
                self.button_fun(smart_wheel, new_tab, 'disconnect'))
            sm_button.grid(row=label_frame_row, column=1)

            reset = smart_wheel.create_button(
                label_frame_connection, self.GUI_RESET_BUTTON, 'Reset',
                self.button_fun(smart_wheel, new_tab, 'reset'))
            reset.grid(row=label_frame_row, column=2)
            ttk.Button(label_frame_connection,
                       text='Config',
                       command=self.button_fun(smart_wheel, new_tab,
                                               'config')).grid(
                                                   row=label_frame_row,
                                                   column=3)

            label_frame_row += 1
            ttk.Label(label_frame_connection, text='name',
                      foreground=GREY).grid(row=label_frame_row,
                                            column=0,
                                            sticky=tk.E)
            label = smart_wheel.create_label(label_frame_connection,
                                             self.GUI_CONNECTION_NAME,
                                             smart_wheel.connection.conf.name)
            label.grid(row=label_frame_row,
                       column=1,
                       columnspan=10,
                       sticky=tk.W)

            label_frame_row += 1
            ttk.Label(label_frame_connection, text='status',
                      foreground=GREY).grid(row=label_frame_row,
                                            column=0,
                                            sticky=tk.E)
            label = smart_wheel.create_label(label_frame_connection,
                                             self.GUI_CONNECTION_STATUS,
                                             '')  # fill initially with empty
            label.grid(row=label_frame_row,
                       column=1,
                       columnspan=10,
                       sticky=tk.W)

            label_frame_row += 1
            ttk.Label(label_frame_connection, text='config',
                      foreground=GREY).grid(row=label_frame_row,
                                            column=0,
                                            sticky=tk.E)
            label2 = smart_wheel.create_label(label_frame_connection,
                                              self.GUI_CONNECTION_INFO,
                                              str(smart_wheel.connection.conf))
            label2.grid(row=label_frame_row,
                        column=1,
                        columnspan=10,
                        sticky=tk.W)

            label_frame_row += 1
            ttk.Label(label_frame_connection, text='firmware',
                      foreground=GREY).grid(row=label_frame_row,
                                            column=0,
                                            sticky=tk.E)
            label = smart_wheel.create_label(label_frame_connection,
                                             self.GUI_FIRMWARE,
                                             '')  # fill initially with empty
            label.grid(row=label_frame_row,
                       column=1,
                       columnspan=10,
                       sticky=tk.W)

            label_frame_connection.columnconfigure(0, weight=1)
            label_frame_connection.columnconfigure(1, weight=1)
            label_frame_connection.columnconfigure(2, weight=1)
            label_frame_connection.columnconfigure(3, weight=1)
            label_frame_connection.columnconfigure(4, weight=100)

            # Connection
            row += 1
            label_frame_wheel = ttk.Labelframe(new_tab,
                                               text='Wheel',
                                               padding=self.PADDING)
            label_frame_wheel.grid(row=row,
                                   column=0,
                                   columnspan=4,
                                   sticky="nsew")

            button = smart_wheel.create_button(
                label_frame_wheel, self.GUI_ENABLE_BUTTON, 'Enable',
                self.button_fun(smart_wheel, new_tab, 'enable'))
            button.grid(row=0, column=0)
            button = smart_wheel.create_button(
                label_frame_wheel, self.GUI_DISABLE_BUTTON, 'Disable',
                self.button_fun(smart_wheel, new_tab, 'disable'))
            button.grid(row=0, column=1)
            button = smart_wheel.create_button(
                label_frame_wheel, self.GUI_EDIT_BUTTON, 'Edit/Debug',
                self.button_fun(smart_wheel, new_tab, 'wheel-gui'))
            button.grid(row=0, column=2)

            row += 1
            ttk.Label(new_tab, text="Speed").grid(row=row, column=0)
            #ttk.Label(new_tab, text="200").grid(row=row, column=1)
            label = smart_wheel.create_label(new_tab, self.GUI_SPEED_SET_POINT,
                                             str(self.speed_set_point))
            label.grid(row=row, column=1)
            label = smart_wheel.create_label(new_tab, self.GUI_SPEED_ACTUAL,
                                             '-')
            label.grid(row=row, column=2)

            row += 1
            ttk.Label(new_tab, text="Steer").grid(row=row, column=0)
            label = smart_wheel.create_label(new_tab, self.GUI_STEER_SET_POINT,
                                             str(self.steer_set_point))
            label.grid(row=row, column=1)
            label = smart_wheel.create_label(new_tab, self.GUI_STEER_ACTUAL,
                                             '-')
            label.grid(row=row, column=2)

            row += 1
            speed_scale = ttk.Scale(new_tab,
                                    from_=200,
                                    to=-200,
                                    orient=tk.VERTICAL,
                                    command=self.set_speed_fun(smart_wheel))
            speed_scale.grid(row=row, column=2)
            smart_wheel.set_elem(self.GUI_SPEED_SCALE, speed_scale)

            row += 1
            steer_scale = ttk.Scale(new_tab,
                                    from_=-1800,
                                    to=1800,
                                    orient=tk.HORIZONTAL,
                                    command=self.set_steer_fun(smart_wheel))
            steer_scale.grid(row=row, column=0, columnspan=3)
            smart_wheel.set_elem(self.GUI_STEER_SCALE, steer_scale)

            # input command
            row += 1
            input_field = ttk.Entry(new_tab)
            input_field.grid(row=row, column=0, columnspan=4, sticky=tk.NSEW)
            self.gui_elements[smart_wheel.name]['input_field'] = input_field

            # <return> executes the command
            input_field.bind('<Return>', self.event_fun(smart_wheel, new_tab))

            # command result
            row += 1

            scrollbar = tk.Scrollbar(new_tab)
            scrollbar.grid(row=row,
                           column=5,
                           columnspan=4,
                           rowspan=3,
                           sticky=tk.E)

            output_field = tk.Text(new_tab, yscrollcommand=scrollbar.set)
            output_field.grid(row=row,
                              column=0,
                              columnspan=4,
                              rowspan=3,
                              sticky=tk.NSEW)
            self.gui_elements[smart_wheel.name]['output_field'] = output_field

            scrollbar.config(command=output_field.yview)

            # status bar
            # row += 1
            # status = smart_wheel.create_label(
            #     mainframe, 'status', 'status info',
            #     label_args=dict(relief=tk.SUNKEN, anchor=tk.W))
            # status.grid(row=row, column=0)

            note.add(new_tab, text="%d %s" % (i, smart_wheel.name))

            # start a thread for listening the smart wheel
            update_thread = threading.Thread(
                target=self.update_thread_fun(smart_wheel))
            update_thread.start()

            # subscribe myself for back logging
            smart_wheel.subscribe(self.message)
            self.update_gui_elements(smart_wheel)
Example #26
0
    my_text.tag_configure("Token.Generic", foreground="#4FFF00")
    my_text.tag_configure("Token.Generic.Heading", foreground="#4FFF00")
    my_text.tag_configure("Token.Generic.Subheading", foreground="#4FFF00")
    my_text.tag_configure("Token.Operator", foreground="#FF0000")
    my_text.tag_configure("Token.Operator.Word", foreground="#FF0000")


root = Tk()
root.title("Digital MCU Simulator IDE")
root.iconbitmap('C:/Users/bunna/Desktop/Code/Python/DMCUS/icon.ico')
root.geometry("1200x750")

my_frame = Frame(root)
my_frame.pack(fill=X, side=TOP)

tab_parent = ttk.Notebook(root)
tab1 = ttk.Frame(tab_parent)
tab2 = ttk.Frame(tab_parent)
tab_parent.add(tab1, text="       Run       ")
tab_parent.add(tab2, text="       Debug       ")
tab_parent.pack(expand=1, fill=X, side=TOP)

my_frame2 = Frame(root)
my_frame2.pack(expand=1, fill=X, side=BOTTOM)
status_bar = Label(my_frame2, text='Ready    ', anchor=E)
status_bar.pack(fill=X, side=RIGHT, ipady=5)

text_scroll = Scrollbar(my_frame)
text_scroll.pack(side=RIGHT, fill=Y)
hor_scroll = Scrollbar(my_frame, orient="horizontal")
hor_scroll.pack(side=BOTTOM, fill=X)
Example #27
0
        data = existing_frame.loc[app, user]
        Label(win, text="Password").grid(column=0, row=2)
        Label(win, text=data.values[0]).grid(column=1,
                                             row=2,
                                             ipadx=15,
                                             ipady=15)


#Start GUI interface
root = Tk()
root.title("Password Manager")
root.resizable(False, False)

#Start GUI Notebook
notebook = ttk.Notebook(root)
notebook.pack()

# Creating the password searching mechanism
search = ttk.Frame(notebook, padding="3 3 12 12")
notebook.add(search, text='Search')

s_app = ttk.Entry(search, width=19)
s_user = ttk.Entry(search, width=19)

s_app.grid(column=2, row=0, sticky=(W, E))
s_user.grid(column=2, row=1, sticky=(W, E))

ttk.Label(search, text="App").grid(column=1, row=0, sticky=(W, E))
ttk.Label(search, text="User").grid(column=1, row=1, sticky=(W, E))
Example #28
0
    def __init__(self, root):

        _bgcolor = '#d9d9d9'
        _fgcolor = '#000000'
        _compcolor = '#d9d9d9'
        _ana1color = '#d9d9d9'
        _ana2color = '#ececec'
        self.style = ttk.Style()

        root.geometry("820x600+329+146")
        root.resizable(0, 0)
        root.title("iTech®")
        root.configure(background="#d9d9d9")
        root.configure(highlightbackground="#d9d9d9")
        root.configure(highlightcolor="black")
        self.path = StringVar()
        self.extension = StringVar()
        self.newFilesNames = StringVar()

        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(root)
        self.TNotebook1.place(relx=0.049,
                              rely=0.133,
                              relheight=0.763,
                              relwidth=0.902)
        self.TNotebook1.configure(takefocus="")
        self.TNotebook1_t1_1_1 = tk.Frame(self.TNotebook1)
        self.TNotebook1.add(self.TNotebook1_t1_1_1, padding=3)
        self.TNotebook1.tab(
            0,
            text="Preferences",
            compound="left",
            underline="-1",
        )
        self.TNotebook1_t1_1_1.configure(relief="sunken")
        self.TNotebook1_t1_1_1.configure(background="#d9d9d9")
        self.TNotebook1_t1_1_1.configure(highlightbackground="#d9d9d9")
        self.TNotebook1_t1_1_1.configure(highlightcolor="black")
        self.TNotebook1_t2_1_1 = tk.Frame(self.TNotebook1)
        self.TNotebook1.add(self.TNotebook1_t2_1_1, padding=3)
        self.TNotebook1.tab(
            1,
            text="Help",
            compound="left",
            underline="-1",
        )
        self.TNotebook1_t2_1_1.configure(relief="sunken")
        self.TNotebook1_t2_1_1.configure(background="#d9d9d9")
        self.TNotebook1_t2_1_1.configure(highlightbackground="#d9d9d9")
        self.TNotebook1_t2_1_1.configure(highlightcolor="black")
        self.TNotebook1_t3_1_1 = tk.Frame(self.TNotebook1)
        self.TNotebook1.add(self.TNotebook1_t3_1_1, padding=3)
        self.TNotebook1.tab(
            2,
            text="About",
            compound="none",
            underline="-1",
        )
        self.TNotebook1_t3_1_1.configure(relief="sunken")
        self.TNotebook1_t3_1_1.configure(background="#d9d9d9")
        self.TNotebook1_t3_1_1.configure(highlightbackground="#d9d9d9")
        self.TNotebook1_t3_1_1.configure(highlightcolor="black")

        self.path_entry = ttk.Entry(self.TNotebook1_t1_1_1)
        self.path_entry.place(relx=0.326,
                              rely=0.095,
                              relheight=0.073,
                              relwidth=0.62)
        self.path_entry.configure(font="-family {Tahoma} -size 9")
        self.path_entry.configure(justify='center')
        self.path_entry.configure(takefocus="")
        self.path_entry.configure(cursor="ibeam")
        self.path_entry.configure(textvariable=self.path)

        self.extension_entry = ttk.Entry(self.TNotebook1_t1_1_1)
        self.extension_entry.place(relx=0.326,
                                   rely=0.261,
                                   relheight=0.073,
                                   relwidth=0.62)
        self.extension_entry.configure(font="-family {Tahoma} -size 9")
        self.extension_entry.configure(justify='center')
        self.extension_entry.configure(takefocus="")
        self.extension_entry.configure(cursor="ibeam")
        self.extension_entry.configure(textvariable=self.extension)

        self.new_files_names = ttk.Entry(self.TNotebook1_t1_1_1)
        self.new_files_names.place(relx=0.326,
                                   rely=0.427,
                                   relheight=0.073,
                                   relwidth=0.62)
        self.new_files_names.configure(font="-family {Tahoma} -size 9")
        self.new_files_names.configure(justify='center')
        self.new_files_names.configure(takefocus="")
        self.new_files_names.configure(cursor="ibeam")
        self.new_files_names.configure(textvariable=self.newFilesNames)

        self.result_output = tk.Label(self.TNotebook1_t1_1_1)
        self.result_output.place(relx=0.326, rely=0.758, height=67, width=457)
        self.result_output.configure(activebackground="#f9f9f9")
        self.result_output.configure(activeforeground="black")
        self.result_output.configure(background="#d9d9d9")
        self.result_output.configure(disabledforeground="#a3a3a3")
        self.result_output.configure(
            font="-family {Segoe UI Semibold} -size 10 -weight bold")
        self.result_output.configure(foreground="#000000")
        self.result_output.configure(highlightbackground="#d9d9d9")
        self.result_output.configure(highlightcolor="black")

        self.rename_button = tk.Button(self.TNotebook1_t1_1_1)
        self.rename_button.place(relx=0.326, rely=0.569, height=42, width=456)
        self.rename_button.configure(activebackground="#ececec")
        self.rename_button.configure(activeforeground="#000000")
        self.rename_button.configure(background="#d9d9d9")
        self.rename_button.configure(disabledforeground="#a3a3a3")
        self.rename_button.configure(foreground="#000000")
        self.rename_button.configure(highlightbackground="#d9d9d9")
        self.rename_button.configure(highlightcolor="black")
        self.rename_button.configure(pady="0")
        self.rename_button.configure(command=self._resetbutton())

        self.Label2 = tk.Label(self.TNotebook1_t1_1_1)
        self.Label2.place(relx=0.027, rely=0.095, height=33, width=56)
        self.Label2.configure(activebackground="#f9f9f9")
        self.Label2.configure(activeforeground="black")
        self.Label2.configure(anchor='sw')
        self.Label2.configure(background="#d9d9d9")
        self.Label2.configure(disabledforeground="#a3a3a3")
        self.Label2.configure(foreground="#000000")
        self.Label2.configure(highlightbackground="#d9d9d9")
        self.Label2.configure(highlightcolor="black")
        self.Label2.configure(justify='left')
        self.Label2.configure(text='''Path''')

        self.Label2_1 = tk.Label(self.TNotebook1_t1_1_1)
        self.Label2_1.place(relx=0.027, rely=0.261, height=33, width=86)
        self.Label2_1.configure(activebackground="#f9f9f9")
        self.Label2_1.configure(activeforeground="black")
        self.Label2_1.configure(anchor='sw')
        self.Label2_1.configure(background="#d9d9d9")
        self.Label2_1.configure(disabledforeground="#a3a3a3")
        self.Label2_1.configure(foreground="#000000")
        self.Label2_1.configure(highlightbackground="#d9d9d9")
        self.Label2_1.configure(highlightcolor="black")
        self.Label2_1.configure(justify='left')
        self.Label2_1.configure(text='''Extension''')

        self.Label2_2 = tk.Label(self.TNotebook1_t1_1_1)
        self.Label2_2.place(relx=0.027, rely=0.427, height=33, width=146)
        self.Label2_2.configure(activebackground="#f9f9f9")
        self.Label2_2.configure(activeforeground="black")
        self.Label2_2.configure(anchor='sw')
        self.Label2_2.configure(background="#d9d9d9")
        self.Label2_2.configure(disabledforeground="#a3a3a3")
        self.Label2_2.configure(foreground="#000000")
        self.Label2_2.configure(highlightbackground="#d9d9d9")
        self.Label2_2.configure(highlightcolor="black")
        self.Label2_2.configure(text='''New Files Names''')

        self.help_text = ScrolledText(self.TNotebook1_t2_1_1)
        self.help_text.place(relx=0.014,
                             rely=0.118,
                             relheight=0.836,
                             relwidth=0.957)
        self.help_text.configure(background="white")
        self.help_text.configure(font="TkTextFont")
        self.help_text.configure(foreground="black")
        self.help_text.configure(highlightbackground="#d9d9d9")
        self.help_text.configure(highlightcolor="black")
        self.help_text.configure(insertbackground="black")
        self.help_text.configure(insertborderwidth="3")
        self.help_text.configure(selectbackground="blue")
        self.help_text.configure(selectforeground="white")
        self.help_text.configure(wrap="none")
        self.help_text.insert(
            tk.END, '''
        
        Bulk Files Renamer helps you renaming thousands files in few seconds!

        Thanks to Python Threading technique!

        • What should I input in Path?

        You should input the folder directory, where your files are located.

        Example:  C:/Users/user/Desktop/Folder/

        Hint: In windows, you should replace all Backslash with Forward Slash
        and add another Forward Slash after the folder name like the following.

        Wrong path input:       C:\\Users\\user\\Desktop\\folder

        Correct path input:   C:/Users/user/Desktop/folder/


        • What should I input in extension?

        You should input the extension of the files your are willing to rename.

        Input example: txt, pdf, doc, exe ect..


        • What should I input in New Files names?

        You should input the name which will be used for all files with the same extension.

        Exemple: Let's suppose you have multiple xlsx files which are related to a single project
        of a Hotel financial report, simply input Hotel or the hotel's name.
        
        ''')
        self.help_text.configure(state='disabled')

        self.linkedin = tk.Button(self.TNotebook1_t3_1_1)
        self.linkedin.place(relx=0.261, rely=0.498, height=42, width=378)
        self.linkedin.configure(activebackground="#ececec")
        self.linkedin.configure(activeforeground="#000000")
        self.linkedin.configure(background="#d9d9d9")
        self.linkedin.configure(disabledforeground="#a3a3a3")
        self.linkedin.configure(foreground="#000000")
        self.linkedin.configure(highlightbackground="#d9d9d9")
        self.linkedin.configure(highlightcolor="black")
        self.linkedin.configure(pady="0")
        self.linkedin.configure(text='''LinkedIn''')
        self.linkedin.configure(command=lambda: self.linked_in())

        self.github = tk.Button(self.TNotebook1_t3_1_1)
        self.github.place(relx=0.261, rely=0.659, height=42, width=378)
        self.github.configure(activebackground="#ececec")
        self.github.configure(activeforeground="#000000")
        self.github.configure(background="#d9d9d9")
        self.github.configure(disabledforeground="#a3a3a3")
        self.github.configure(foreground="#000000")
        self.github.configure(highlightbackground="#d9d9d9")
        self.github.configure(highlightcolor="black")
        self.github.configure(pady="0")
        self.github.configure(text='''Github''')
        self.github.configure(command=lambda: self.git_hub())

        self.website = tk.Button(self.TNotebook1_t3_1_1)
        self.website.place(relx=0.261, rely=0.801, height=42, width=378)
        self.website.configure(activebackground="#ececec")
        self.website.configure(activeforeground="#000000")
        self.website.configure(background="#d9d9d9")
        self.website.configure(disabledforeground="#a3a3a3")
        self.website.configure(foreground="#000000")
        self.website.configure(highlightbackground="#d9d9d9")
        self.website.configure(highlightcolor="black")
        self.website.configure(pady="0")
        self.website.configure(text='''Website''')
        self.website.configure(command=lambda: self.portfolio())

        self.about_text = tk.Label(self.TNotebook1_t3_1_1)
        self.about_text.place(relx=0.149, rely=0.142, height=111, width=567)
        self.about_text.configure(activebackground="#f9f9f9")
        self.about_text.configure(activeforeground="black")
        self.about_text.configure(background="#d9d9d9")
        self.about_text.configure(disabledforeground="#a3a3a3")
        self.about_text.configure(font="verdana")
        self.about_text.configure(foreground="#000000")
        self.about_text.configure(highlightbackground="#d9d9d9")
        self.about_text.configure(highlightcolor="black")
        self.about_text.configure(text="By iTech® 2021")

        self.title = tk.Label(root)
        self.title.place(relx=0.098, rely=0.017, height=51, width=667)
        self.title.configure(activebackground="#f9f9f9")
        self.title.configure(activeforeground="black")
        self.title.configure(background="#d9d9d9")
        self.title.configure(disabledforeground="#a3a3a3")
        self.title.configure(font="-family {Eras Demi ITC} -size 14")
        self.title.configure(foreground="#000000")
        self.title.configure(highlightbackground="#d9d9d9")
        self.title.configure(highlightcolor="black")
        self.title.configure(text='''Bulk Files Renamer''')
Example #29
0
import requests  #apelam siteul
import re  #expresii regulate
from bs4 import BeautifulSoup  #convertim html
from xlwt import Workbook  #inscriem in excel
from docx import Document  #inscriem in word
import os  #cream fisiere si salvam in ele
from rake_nltk import Rake  #extragem cuvintele cheie
import nltk  #analizam textul
from os import path  #stergem fisiere
from nltk.corpus import stopwords  #gasim stopwords
import gethtml  #modul creat de mine se foloseste la cautarea cheilor dupa url
#cream interfata grafica
form = tk.Tk()
form.title("Lucrare de An ASD")
form.geometry("1200x1000")
tab_parent = ttk.Notebook(form)
tab1 = ttk.Frame(tab_parent)
tab2 = ttk.Frame(tab_parent)
tab_parent.add(tab1, text="Extract Articles")
tab_parent.add(tab2, text="Extract Keywords")

#===First tab===
#===GUI====
label1 = tk.Label(tab1, text="Keyword:")
entry1 = tk.Entry(tab1)
text1 = tk.Text(tab1, height=15, width=25)
label1.grid(row=0, column=0, padx=15, pady=15)
entry1.grid(row=0, column=1, padx=15, pady=15)


#functie de inscriere keywords in xls
    except:
        str = "00:00:00:00:00:00"
    return str[0:17]  # call this function with getMAC('eth0')


def populate_list():
    print('Populate')


# window / gui
window = Tk()
window.title("Welcome to GUI")
window.geometry(
    '950x350')  # sets window width to 350 pixels and height to 200 pixels

tab_control = ttk.Notebook(window)  # menu/tabs puts tabs on window(gui)

# add tabs here
tab1 = ttk.Frame(tab_control)
tab2 = ttk.Frame(tab_control)
tab3 = ttk.Frame(tab_control)

# change tabs settings here
tab_control.add(tab1, text='Connect to HoloLens')
tab_control.add(tab2, text='Send a Message')
tab_control.add(tab3, text='What they see')

# Tab1 widgets
lbl1 = Label(tab1, text='Select local Bluetooth Addresses', padx=5,
             pady=5).grid(column=0, row=0)  #label for tab1
#lbl1.grid(column=0, row=0) moved to side to save room