def __init__(self, parent):
        Frame.__init__(self, parent)

        self.parent = parent
        self.grid(sticky=N+E+S+W)

        self.initui()
    def __init__(self, parent=None, *args, **kwargs):
        Frame.__init__(self, parent)
        self.parent = parent

        # Create scrollbar
        scrollbar = Scrollbar(self)
        scrollbar.pack(side=RIGHT, fill=Y)

        # Create Treeview
        self.tree = Treeview(self,
                             columns=('#0', '#1', '#2'),
                             selectmode="browse",
                             yscrollcommand=scrollbar.set)
        self.tree.pack(expand=TRUE, fill=X)
        scrollbar.config(command=self.tree)

        # Setup column heading
        self.tree.heading('#0', text='Thumbnail', anchor='center')
        self.tree.heading('#1', text='Name', anchor='center')
        self.tree.heading('#2', text='Origin Text', anchor='nw')

        # Setup column
        self.tree.column('#0', stretch=NO)
        self.tree.column('#1', stretch=NO)
        self.tree.column('#2', anchor='nw', minwidth=300)

        # Bind event
        self.tree.bind('<Double-1>', self.show_menu)

        # Variables init
        self.video_path_list = []
        self.video_texts_list = []
        self.video_name_list = []
        self.video_images = []
        self.load_video_info()
    def __init__(self, root_window):
        """
        Constructor method for setting up the window
        and user interface

        :param Tkinter.Tk root_window: Main window object
        """

        Frame.__init__(self)
        self.root = root_window
        self.master.state('zoomed')

        # set font
        font_type = "Helvetica"
        self.main_font = tkFont.Font(family=font_type, size=16)
        self.sub_font = tkFont.Font(family=font_type, size=13)
        self.small_font = tkFont.Font(family=font_type, size=8)

        # placeholder for Entry box
        self.k_input = None
        # placeholder for image
        self.idw_image_jov = None
        # placeholder for message
        self.info_message = None

        self.initGIS()

        self.initUI()
Beispiel #4
0
 def __init__(self, master=None, text="", **kwargs):
     font = kwargs.pop('font', '')
     Frame.__init__(self, master, **kwargs)
     self.style_name = self.cget('style')
     self.toggle_style_name = '%s.Toggle' % ('.'.join(
         self.style_name.split('.')[:-1]))
     self.columnconfigure(1, weight=1)
     self.rowconfigure(1, weight=1)
     self.style = Style(self)
     self.style.configure(self.toggle_style_name,
                          background=self.style.lookup(
                              self.style_name, 'background'))
     self.style.map(self.toggle_style_name, background=[])
     self._checkbutton = Checkbutton(self,
                                     style=self.toggle_style_name,
                                     command=self.toggle,
                                     cursor='arrow')
     self.label = Label(self,
                        text=text,
                        font=font,
                        style=self.style_name.replace('TFrame', 'TLabel'))
     self.interior = Frame(self, style=self.style_name)
     self.interior.grid(row=1, column=1, sticky="nswe", padx=(4, 0))
     self.interior.grid_remove()
     self.label.bind('<Configure>', self._wrap)
     self.label.bind('<1>', lambda e: self._checkbutton.invoke())
     self._grid_widgets()
     self.bind('<<ThemeChanged>>', self._theme_changed)
    def __init__(self, master):
        Frame.__init__(self, master)
        self.style = Style()
        self.style.configure('TButton', takefocus=0)

        self.canvas = Canvas(self, background='#471d0f')
        self.scroll_history = Scrollbar(self,
                                        orient='vertical',
                                        command=self.canvas.yview)
        self.moving_frame = Frame(self.canvas)
        self.canvas.create_window((0, 0),
                                  window=self.moving_frame,
                                  anchor='nw')
        self.moving_frame.bind(
            "<Configure>", lambda event: self.canvas.configure(
                scrollregion=self.canvas.bbox("all")))
        self.canvas.configure(yscrollcommand=self.scroll_history.set)

        self.update_button = Button(self.moving_frame,
                                    text='Update History',
                                    command=self.update_history)

        self.scroll_history.pack(fill='both', side='right')
        self.canvas.pack(fill='both', side='left', expand=True)
        self.update_button.pack(anchor='ne', fill='x', expand=True)
        # Label(self.moving_frame, text='HISTORY HERE').pack(anchor='ne', fill='x')
        self.grid(row=0, column=0)
Beispiel #6
0
    def __init__(self, parent):

        Frame.__init__(self, parent)

        self.parent = parent

        self.initUI()
Beispiel #7
0
 def __init__(self, figure, master, SerialReference):
     Frame.__init__(self, master)
     self.entry = None
     self.setPoint = None
     self.master = master  # a reference to the master window
     self.serialReference = SerialReference  # keep a reference to our serial connection so that we can use it for bi-directional communicate from this class
     self.initWindow(figure)  # initialize the window with our settings
Beispiel #8
0
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.create_ui()
     self.load_table()
     self.grid(sticky=(N, S, W, E))
     parent.grid_rowconfigure(1, weight=1)
     parent.grid_columnconfigure(0, weight=1)
    def __init__(self, parent):
        Frame.__init__(self, parent)

        self.input_image_frame = None
        self.output_image_frame = None

        self.init_ui()
 def __init__(self, parent, load_fingerprint_func):
     Frame.__init__(self, parent, relief=RAISED, borderwidth=1)
     self.open_fingerprint_image_button = Button(
         self, text="Open Fingerprint Image", command=load_fingerprint_func)
     self.open_fingerprint_image_button.grid(row=0,
                                             column=0,
                                             sticky=N + W + E)
Beispiel #11
0
    def __init__(self, master):
        Frame.__init__(self, master)
        self.master = master
        self.master.title("Browser")

        # Here we make our widgets.
        self.top_frame = Frame(self)
        self.url_frame = Frame(self.top_frame)
        self.url_label = Label(self.url_frame, text="Url: ", anchor="n")
        self.url_entry = Entry(self.url_frame, width=80)
        self.url_button = Button(self.url_frame,
                                 text="Go",
                                 command=self.go_button)
        self.bottom_frame = Frame(self)
        self.text_field = Text(self.bottom_frame)

        #Here we pack our widgets.
        self.top_frame.pack(side="top", padx=15, pady=15)
        self.url_frame.pack(anchor="center")
        self.bottom_frame.pack(side="bottom", fill="both", expand=True)
        self.text_field.pack(side="bottom", fill="both", expand=True)
        self.url_label.pack(side="left")
        self.url_entry.pack(side="left", fill="x", expand=True)
        self.url_button.pack(side="left", padx=5)
        self.text_field.config(state="disabled", padx=5, pady=5)
Beispiel #12
0
 def __init__(self, parent):
     Frame.__init__(self, parent)
     super().__init__()
     self.parent = parent
     self.pack(fill=BOTH, expand=1)
     self.centerWindow()
     self.initUI()
Beispiel #13
0
 def __init__(self, master):
     Frame.__init__(self, master, padding="0 0 0 13")
     Separator(self).grid(row=0, columnspan=2, pady="0 9", sticky=EW)
     self.button = Button(self, text="Close", command=master.destroy)
     self.button.grid(row=1, column=0, padx="15", sticky=E)
     self.grid(sticky=EW)
     self.columnconfigure(0, weight=1)
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)
        self.controller = controller
        self.outputState = False
        self.sem = threading.Semaphore()
        self.lock = 1

        frame1 = Frame(self, relief=RAISED, borderwidth=1)
        frame1.pack(fill=BOTH, expand=True)
        frame2 = Frame(self, relief=RAISED, borderwidth=1)
        frame2.pack(fill=BOTH, expand=True)
        frame3 = Frame(self, relief=RAISED, borderwidth=1)
        frame3.pack(fill=BOTH, expand=True)
        frame4 = Frame(self, relief=RAISED, borderwidth=1)
        frame4.pack(fill=BOTH, expand=True)

        self.outputBox = Text(self, height=15, width=40)
        self.outputBox.tag_config('error',
                                  background="yellow",
                                  foreground="red")
        self.vsb = Scrollbar(self,
                             orient="vertical",
                             command=self.outputBox.yview)
        self.outputBox.configure(yscrollcommand=self.vsb.set, state="disabled")
        self.vsb.pack(side="right", fill="y")
        self.outputBox.pack(side="left", fill="both", expand=True)

        self.oneBPName_entry = Entry(frame2, width=35)
        self.listBPPath_entry = Entry(frame3, width=35)

        self.oneBPNAme_label = Label(frame2, text="Blueprint Name:")
        self.listBPPath_label = Label(frame3, text="Blueprint List File Path:")

        self.allButton = Button(frame1,
                                text="Download All Blueprints",
                                width=30)
        self.allButton.configure(command=self.threader_all)
        self.oneButton = Button(frame2,
                                text="Download One Blueprint",
                                width=30)
        self.oneButton.configure(command=self.threader_one)
        self.listButton = Button(frame3,
                                 text="Download Blueprints From List",
                                 width=30)
        self.listButton.configure(command=self.threader_list)
        self.returnButton = Button(
            frame4,
            text="Go Back",
            command=lambda: self.controller.show_frame("MainPage"))

        self.oneBPNAme_label.pack(padx=5, pady=5)
        self.listBPPath_label.pack(padx=5, pady=5)

        self.oneBPName_entry.pack(padx=5, pady=5)
        self.listBPPath_entry.pack(padx=5, pady=5)

        self.allButton.pack(padx=5, pady=5)
        self.oneButton.pack(padx=5, pady=5)
        self.listButton.pack(padx=5, pady=5)
        self.returnButton.pack(padx=5, pady=10)
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)
        self.controller = controller

        frame = Frame(self, relief=RAISED, borderwidth=1)
        frame.pack(fill=BOTH, expand=True)

        self.label = Label(frame, text="vRABlueprintTool Main Page")
        self.label.pack(pady=10)

        self.toConnectPage = Button(
            frame,
            text="vRA Login Credentials",
            width=25,
            command=lambda: controller.show_frame("ConnectPage"))
        self.toDownloadPage = Button(
            frame,
            text="Blueprint Download",
            width=25,
            command=lambda: controller.show_frame("DownloadPage"))
        self.toUploadPage = Button(
            frame,
            text="Blueprint Upload",
            width=25,
            command=lambda: controller.show_frame("UploadPage"))

        self.toConnectPage.pack(padx=5, pady=5)
        self.toDownloadPage.pack(padx=5, pady=5)
        self.toUploadPage.pack(padx=5, pady=5)
Beispiel #16
0
 def __init__(self, parent, nameTool, nameImg):
     Frame.__init__(self, parent, relief=FLAT, borderwidth=5)
     self._parent = parent
     self._nameTool = nameTool
     self._pathImgFolder = os.path.abspath(__file__ +
                                           '/../../../data/image/')
     self.__initUI(nameImg)
Beispiel #17
0
 def __init__(self, parent, main, **kw):
     Frame.__init__(self, parent, **kw)
     self.main = main
     self.label_head = Label(text='Sign Up Page', font=MED_FONT)
     self.l_user = Label(text='Username')
     self.user = Entry(text='must have atleast 5 chars')
     self.l_pass = Label(text='Password')
     self.l_pass2 = Label(text='re-enter')
     self.password = Entry(show='*')
     self.password2 = Entry(show='*')
     self.sign_up_b = Button(text='Sign Up',
                             command=lambda: self.sign_up(main))
     self.back_b = Button(
         text='Back',
         command=lambda: self.main.show_frame(LOGIN_PAGE, SIGN_UP_PAGE))
     self.age = BooleanVar()
     self.age_c = Checkbutton(text='Are you above 16 years of age',
                              variable=self.age,
                              onvalue=True,
                              offvalue=False)
     self.balance = BooleanVar()
     self.balance_c = Checkbutton(
         text='Do you have 10000 rupees in \nyour bank account',
         variable=self.balance,
         onvalue=True,
         offvalue=False)
Beispiel #18
0
    def __init__(self, parent, controller, program_path):
        """
        Args:
            parent: Where this frame should be put inside.
            controller: Controller of the application.
            program_path: Path to the external program whose standard output
                should be printed inside this frame's text area.
        """
        Frame.__init__(self, parent)
        self.program_path = program_path
        self.text_area = ThreadSafeConsole(self, wrap=None)
        self.text_area.grid(column=0, row=0, columnspan=3)
        Button(self, text='Run', command=self.run_program_in_new_thread).grid(
            column=0, row=1)
        Button(self, text='Stop', command=self.stop_program).grid(column=1,
                                                                  row=1)
        Button(self, text='Back',
               command=lambda: self.leave(controller)).grid(column=2, row=1)

        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.columnconfigure(2, weight=1)
        self.rowconfigure(0, weight=1)

        self.subprocess = None
        self.subprocess_running = False
Beispiel #19
0
    def __init__(self, parent, controller):
        """
        Args:
            parent: Where this frame should be put inside.
            controller: Controller of the application.
        """
        Frame.__init__(self, parent)

        Label(self, text='Position ID:').grid(column=0, row=0, sticky=(E, S))
        self.position = StringVar()
        Entry(self, textvariable=self.position).grid(
            column=1, row=0, sticky=(W, S))

        Label(self, text='Scanned tag:').grid(column=0, row=1, sticky=(E,))
        self.tag = StringVar()
        Entry(self, textvariable=self.tag, state=DISABLED).grid(
            column=1, row=1, sticky=(W,))

        Button(self, text='Create', command=self.create_slot).grid(
            column=0, row=2, sticky=(N, E))

        Button(self, text='Back', command=lambda: self.leave(controller)).grid(
            column=1, row=2, sticky=(N, W))

        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.rowconfigure(0, weight=1)
        self.rowconfigure(2, weight=1)

        self.status = Value('b')
Beispiel #20
0
    def __init__(self, parent):
        self.Data = Data()
        self.getReciepList()

        Frame.__init__(self, parent)

        self.parent = parent

        self.recipeList = None  # Listbox
        self.recipeName = None  # Entry
        self.prepTime = None  # Entry
        self.prepTimeUnit = None  # OptionMenu
        self.cookTime = None  # Entry
        self.cookTimeUnit = None  # OptionMenu
        self.ingredientName = None  # Entry
        self.ingredientQuantity = None  # Entry
        self.ingredientUnit = None  # OptionMenu
        self.ingredientList = None  # Listbox
        self.procedure = None  # Text

        self.recipes = []
        self.ingredients = []
        self.activeRecipeID = {"lst": None, "db": None}  # (listID, dbID)
        self.activeIngredientID = {"lst": None, "db": None}  # (listID, dbID)

        self.initUI()

        self.bind_all("<Control-w>", self.onExit)
        self.bind_all("<Control-s>", self.recipeSave)
Beispiel #21
0
    def __init__(self, parent, i, j, callback_edit, **options):
        Frame.__init__(self, parent, **options)
        # grid layout
        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.rowconfigure(2, weight=1)
        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.columnconfigure(2, weight=1)
        # styles
        self.configure(style="case.TFrame")

        self.i = i
        self.j = j
        self.modifiable = True
        self.val = 0 # valeur de la case, 0 = vide
        self.possibilites = [] # possibilites écrites dans la case
        self.callback_edit = callback_edit

        # labels
        self.chiffres = [] # tableau 3x3 de labels permettant d'afficher les chiffres dans la case
        sticky_i = ["n", "ns", "s"]
        sticky_j = ["w", "ew", "e"]
        for i in range(3):
            self.chiffres.append([])
            for j in range(3):
                self.chiffres[i].append(Label(self, text=" ", anchor="center",
                                                  style="case.TLabel", width=1))
                self.chiffres[i][j].grid(row=i, column=j,
                                         sticky=sticky_i[i % 3] + sticky_j[j % 3],
                                         padx=1, pady=1)
Beispiel #22
0
    def __init__(self, master, **kwargs):
        Frame.__init__(self, master, **kwargs)

        self._last = 0
        self.entryVar = IntVar(self._last)
        self.entry = Entry(self, textvariable=self.entryVar, width=4)
        self.entry.grid(row=0, column=1)
        self.entry.bind("<FocusIn>", self._store)
        self.entry.bind("<FocusOut>", self._validateEntry)
        self.entry.bind("<KeyPress-Return>", self._validateEntry)

        self.leftImg = PhotoImage(
            file=os.path.join(RESOURCE_DIR, "arrow-left.gif"))
        self.rightImg = PhotoImage(
            file=os.path.join(RESOURCE_DIR, "arrow-right.gif"))

        self.left = Button(self, image=self.leftImg, command=self.decrement)
        self.left.grid(row=0, column=0, sticky=Tkc.NS)

        self.down = Button(self, image=self.rightImg, command=self.increment)
        self.down.grid(row=0, column=2, sticky=Tkc.NS)

        self.minimum = 0
        self.maximum = 10

        self.changedCallback = None
Beispiel #23
0
    def __init__(self, master, origin=(0, 0)):
        Frame.__init__(self, master)
        self.origin = origin
        self.goban = golib.gui.Goban(self)
        self.buttons = Frame(self)
        self.ctx_event = None  # save the event that has originated the context menu
        self.msg = tk.StringVar(value="Hello")
        self.err = tk.StringVar(value="-")
        self.create_menubar()
        self.init_components()

        self.closed = False

        # user input part of the gui, delegated to goban ATM. may become lists later
        self.mousein = self.goban
        self.keyin = self.goban

        # these commands are expected to be set from outside, in an attempt to inject dependency via setter.
        # See 'controller' classes who instantiate some of these commands.
        self.commands = {}
        self.master.protocol("WM_DELETE_WINDOW", lambda: self.execute("close"))
        self.commands["close"] = lambda: self.master.quit()  # this command needs a default value

        # delegate some work to goban
        self.stones_changed = self.goban.stones_changed
        self.highlight = self.goban.highlight
        self.select = self.goban.select
        self.clear = self.goban.clear
Beispiel #24
0
    def __init__(self, parent, controller):
        #Basic frame setup
        global hspacee
        Frame.__init__(self, parent)

        #Page defining label
        label = Label(self, text="Pull Data", font=TITLE_FONT)
        label.pack(pady=10, padx=10)

        #Back button
        button1 = Button(self,
                         text="Back to Basic Data",
                         bg="white",
                         command=lambda: controller.show_frame(BasicDataF))
        button1.config(width=BUTTON_WIDTH,
                       height=BUTTON_HEIGHT,
                       font=DEFAULT_FONT_BUTTON)
        button1.pack(pady=20, padx=20)

        #Set up the figure with subplots
        self.f = Figure(figsize=(4, 8))
        self.f.subplots_adjust(left=None,
                               bottom=None,
                               right=None,
                               top=None,
                               wspace=None,
                               hspace=hspacee)
        # self.f.suptitle("Pace Data Display")
        self.a = self.f.add_subplot(2, 1, 1)
        self.b = self.f.add_subplot(2, 1, 2)
        self.canvas = FigureCanvasTkAgg(self.f, master=self)
Beispiel #25
0
 def __init__(self, parent, *args, **kwargs):
     Frame.__init__(self, parent, *args, **kwargs)
     self.parent = parent
     try:
         self.model = torch.load("model.pt")
     except:
         pass
     self.imgframe = Frame(self, height=140, width=140)
     self.img = None
     self.image = Label(self.imgframe)
     self.image.grid()
     
     self.result = Label(self, text="Model thinks it is: ", anchor="w")
     
     def upload():
         file = filedialog.askopenfilename(initialdir = "samples")
         self.img = resize(file)
         self.image.config(image = self.img)
         pred = self.model(TF.to_tensor(Image.open(file)).unsqueeze(0)).argmax().item()
         self.result.config(text = "Model thinks it is: " + results[pred])
         pass
     self.upload_button = Button(self, text = "Upload", command=upload)
     self.imgframe.grid_propagate(0)
     self.imgframe.grid(row=0,column=0)
     self.upload_button.grid(row=0,column=1)
     self.result.grid(row=1, column=0, columnspan=2)
Beispiel #26
0
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.parent = parent
     self.grid()
     self.init_ui()
     self.wallhandler = WallHandler()
     self.reddit = Reddit()
Beispiel #27
0
    def __init__(self, *args, **kwargs):
        Frame.__init__(self, *args, **kwargs)
        window = Toplevel(self)
        self.columnconfigure(2, pad=3)
        self.rowconfigure(3, pad=3)

        fvo_label = Label(window,
                          text="Forvo API Key:",
                          font=("Helvetica", 16),
                          height=2)
        fvo_label.grid(row=0, column=0, padx=3, sticky=W)

        fvo_entry = Entry(window, width=50, font=("Helvetica", 16))
        fvo_entry.grid(row=0, column=1, padx=3, sticky=W + E)

        ms_label = Label(window,
                         text="Microsoft Bing API Key:",
                         font=("Helvetica", 16),
                         height=2)
        ms_label.grid(row=1, column=0, padx=3, sticky=W)

        ms_entry = Entry(window, width=50, font=("Helvetica", 16))
        ms_entry.grid(row=1, column=1, padx=3, sticky=W + E)

        fvo_label = Label(window,
                          text="SAVE",
                          font=("Helvetica", 16),
                          height=2)
        fvo_label.grid(row=2, column=1, padx=3, sticky=W + E)
	def __init__(self,parent):
		
		Frame.__init__(self, master=parent)

		canvas = tkinter.Canvas(self, highlightthickness=0)
		self.innerFrame = Frame(canvas)

		myscrollbar = Scrollbar(self, orient="vertical")
		myscrollbar.configure(command=canvas.yview)

		def scrollbarSet(top, bottom):
			# Hides and shows the scroll frame depending on need
			if float(top) > 0 or float(bottom) < 1:
				myscrollbar.grid(row=0, column=1, sticky="NS")
			else:
				pass
				myscrollbar.grid_remove()
			myscrollbar.set(top, bottom)
		canvas.configure(yscrollcommand = scrollbarSet)


		configureFunc = lambda _ :  canvas.configure(scrollregion=canvas.bbox("all"))
		frameID = canvas.create_window((0,0), window=self.innerFrame, anchor='nw')
		self.innerFrame.bind("<Configure>",configureFunc)

		canvas.grid(row=0, column=0, sticky="NSEW")
		myscrollbar.grid(row=0, column=1, sticky="NS")
		self.grid_rowconfigure(0, weight=1)
		self.grid_columnconfigure(0, weight=0)


		#canvas.bind("<Configure>", lambda e : canvas.itemconfig(frameID, width=e.width))
		canvas.bind("<Configure>", lambda e : canvas.configure(width=self.innerFrame.winfo_width()))
Beispiel #29
0
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.pack()
        self.parent = parent
        self.parent.title('CKPostMan')
        st = tkFont.Font(family='song ti', size=12)

        self.userFrame = Frame(self)
        self.userFrame.pack(fill=X, expand=1)
        self.idlabel = Label(self.userFrame, text='帳號:', font=st)
        self.idlabel.pack(pady=10, side=LEFT)
        self.idEntry = Entry(self.userFrame)
        self.idEntry.pack(pady=10, side=LEFT)
        self.pwlabel = Label(self.userFrame, text='密碼:', font=st)
        self.pwlabel.pack(padx=5, pady=10, side=LEFT)
        self.pwEntry = Entry(self.userFrame, show='*')
        self.pwEntry.pack(pady=10, side=LEFT)
        self.send = Button(self.userFrame, text='send', command=self.clickSend)
        self.send.pack(side=RIGHT)

        self.rlable = Label(self, text='收件者:', font=st)
        self.rlable.pack(fill=X)
        self.rtextarea = Text(self, height=5)
        self.rtextarea.pack(fill=X)

        self.mlable = Label(self, text='訊息內容:', font=st)
        self.mlable.pack(fill=X, pady=10)
        self.mtextarea = Text(self, height=5)
        self.mtextarea.pack(fill=X)

        self.createProgressFrame(st)
        self.bar = Progressbar(self, orient="horizontal",
                               mode="determinate")
        self.bar.pack(fill=X)
        self.bar['value'] = 0
Beispiel #30
0
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)  #Call tkinter's class init.
        # self.configure(background="white")

        #Set up the top label of the page.
        label = Label(self, text="Data Import Page", font=TITLE_FONT)
        label.pack(pady=10, padx=10)

        # img = ImageTk.PhotoImage(Image.open("seeingeye.jpg"))
        loaded = Image.open("seeingeye.jpg")
        loaded = loaded.resize((250, 250), Image.ANTIALIAS)
        rendered = ImageTk.PhotoImage(loaded)
        img = Label(self, image=rendered)
        img.image = rendered
        img.pack()

        #Set up the buttons that allow the user to import the data they have. Buttons 2/3 we did not have time to implement.
        button1 = Button(self,
                         text="Import Pace & Pull Data",
                         bg="white",
                         command=lambda: controller.requestInfo())
        button1.config(width=BUTTON_WIDTH,
                       height=BUTTON_HEIGHT,
                       font=DEFAULT_FONT_BUTTON)  #, width = BUTTON_WIDTH)
        button1.pack()
Beispiel #31
0
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.grid()
        self.parent = parent

        self.urlHint = Label(self, text='請輸入網址:', width=10, padding=3)
        self.urlHint.grid(row=0, column=0, columnspan=2)
        self.urlEntry = Entry(self, width=40)
        self.urlEntry.grid(row=0, column=2, columnspan=8)

        self.keyHint = Label(self, text='尋找內容:', width=10, padding=3)
        self.keyHint.grid(row=1, column=0, columnspan=2)
        self.keyEntry = Entry(self, width=40)
        self.keyEntry.grid(row=1, column=2, columnspan=8)

        self.pageHint = Label(self, text='尋找範圍:', width=10, padding=3)
        self.pageHint.grid(row=2, column=0, columnspan=2)
        self.p1Entry = Entry(self, width=5)
        self.p1Entry.grid(row=2, column=2, stick=W)
        self.rangeHint = Label(self, text='~')
        self.rangeHint.grid(row=2, column=3, stick=W)
        self.p2Entry = Entry(self, width=5)
        self.p2Entry.grid(row=2, column=4, stick=W)
        self.p2Hint = Label(self, text='(留空代表最後一頁)')
        self.p2Hint.grid(row=2, column=5, stick=W)

        self.bar = Progressbar(self,
                               orient="horizontal",
                               length=220,
                               mode="determinate")
        self.bar['value'] = 0
        self.bar.grid(row=3, column=0, columnspan=5)
        self.btn = Button(self, text='搜尋', command=self.clickBtn)
        self.btn.grid(row=3, column=5, columnspan=5, stick=E)
Beispiel #32
0
 def __init__(self, window):
     Frame.__init__(self, window, name="frame")
     # Import icons
     self.visibility_icon = ImageTk.PhotoImage(Image.open("../images/visibility.png").resize((25, 25)))
     self.visibility_off_icon = ImageTk.PhotoImage(Image.open("../images/visibility_off.png").resize((25, 25)))
     self.back_icon = ImageTk.PhotoImage(Image.open("../images/arrow_back.png").resize((25, 25)))
     self.forward_icon = ImageTk.PhotoImage(Image.open("../images/arrow_forward.png").resize((25, 25)))
     self.done_icon = ImageTk.PhotoImage(Image.open("../images/done.png").resize((25, 25)))
     self.close_icon = ImageTk.PhotoImage(Image.open("../images/close.png").resize((25, 25)))
     self.settings_icon = ImageTk.PhotoImage(Image.open("../images/settings.png").resize((25, 25)))
     self.logo_image = ImageTk.PhotoImage(Image.open("../images/logo.png").resize((100, 100)))
     # Initialize window
     self.window = window
     self.window.geometry("400x300+100+100")
     self.window.title("FaceBlur")
     self.window.resizable(False, False)
     self.window.iconphoto(True, self.logo_image)
     self.pack(fill=tk.BOTH, expand=True)
     self.initialize_video_selection_ui()
     # Initialize class fields
     self.index = 0  # index of current showing unique face image
     self.faces_display = []  # list of PhotoImage objects of frames including unique faces
     self.video_file = ""  # path to input video
     self.destination = ""  # path to output video
     self.queue = Queue()  # multiprocessing queue for sending data back from different processes
     self.photo_img = None  # PhotoImage object of current frame
     self.blur_toggles = None  # ndarray where each element indicates whether the matching face will be blurred
     self.settings = {  # dictionary holding settings value from settings window
         "resamples": 1,
         "tolerance": 0.5,
         "track_period": 10,
         "blur_method": "pixelate",
         "blur_intensity": 20,
         "display_output": True
     }
Beispiel #33
0
    def __init__(self, parent, music_filepath):
        Frame.__init__(self, parent)
        self.player = Player(music_filepath)
        
        title = os.path.basename(music_filepath) 

        label = tkinter.Label(self, text=title, width=30)
        label.pack(side=LEFT)

        padx = 10
        #image = tkinter.PhotoImage(file=icon_play)
        play_button = Button(self, text="Play")#image=image)
        play_button.pack(side=LEFT, padx=padx)
        play_button.bind("<Button-1>", self.play)
        
        #image = tkinter.PhotoImage(file=icon_pause)
        #pause_button = Button(self, text="Pause")#image=image)
        #pause_button.pack(side=LEFT, padx=padx)
        #pause_button.bind("<Button-1>", self.pause)
        #self.pausing = False
        
        #image = tkinter.PhotoImage(file=icon_stop)
        stop_button = Button(self, text="Stop")#image=image)
        stop_button.pack(side=LEFT, padx=padx)
        stop_button.bind("<Button-1>", self.stop)
Beispiel #34
0
 def __init__(self,parent,properties,node,cost):
     Frame.__init__(self, parent)
     self._parent = parent
     self._properties = properties
     self._node = node
     self._cost = cost
     self.__initUI()
Beispiel #35
0
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent 

        self.music_root = ''
        self.query_path = ''
        self.extractor = Extractor(n_frames=40, 
                                   n_blocks=100, 
                                   learning_rate=0.00053,
                                   verbose=True)

        self.style = Style()
        self.style.theme_use("default")
        
        padx = 2
        pady = 2

        root_select_button = Button(self, text="Select a directory")
        root_select_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        root_select_button.bind("<Button-1>", self.set_music_root)

        analyze_button = Button(self, text="Analyze")
        analyze_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        analyze_button.bind("<Button-1>", self.analyze)

        query_select_button = Button(self, text="Select a file")
        query_select_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        query_select_button.bind("<Button-1>", self.set_query_path)

        search_button = Button(self, text="Search similar songs")
        search_button.pack(fill=tkinter.X, padx=padx, pady=pady)
        search_button.bind("<Button-1>", self.search_music)
 
        self.pack(fill=BOTH, expand=1)
Beispiel #36
0
    def __init__(self, parent, dim):
        Frame.__init__(self, parent)

        self.dim = dim

        self.figure = pyplot.Figure(figsize=(5.5, 3.2),
                                    facecolor=(240 / 255, 240 / 255,
                                               237 / 255))
        self.figure.subplots_adjust(left=0.15, bottom=0.2)

        self.canvas = FigureCanvas(self.figure, master=self)
        self.canvas.get_tk_widget().pack()
        self.canvas.get_tk_widget().configure(highlightthickness=0)

        toolbar = CutDownNavigationToolbar(self.canvas, self)
        toolbar.pack()

        if dim == 2:
            self.axes = self.figure.add_subplot(1, 1, 1)
        elif dim == 3:
            self.axes = Axes3D(self.figure)
        else:
            raise ValueError("Dimension must be either 2 or 3")

        self.currentLines = []
 def __init__(self, master, layout, font=('Segoe UI', 14)):
     Frame.__init__(self, master)
     s = ttk.Style()
     s.configure('TButton', font=font)
     self.button_layout = layout.value
     self.buttons = {}
     self.create_buttons()
Beispiel #38
0
    def __init__(self, master, **kw):
        Frame.__init__(self, master, **kw)
        self.style = Style()
        self.configure()

        loadIcon(self.master, self.master, IIVLXICO)
        self.master.title(self.WINDOW_TITLE)
        self.master.resizable(*self.WINDOW_RESIZABLE)
        x = self.master.winfo_pointerx() - self.WINDOW_WIDTH_OFFSET
        y = self.master.winfo_pointery() - self.WINDOW_HEIGHT_OFFSET
        y = y if y > self.WINDOW_Y_MIN else self.WINDOW_Y_MIN
        self.master.geometry(
            f'{self.WINDOW_WIDTH}x{self.WINDOW_HEIGHT}+{x}+{y}')
        self.master.minsize(self.WINDOW_WIDTH_MIN, self.WINDOW_HEIGHT_MIN)
        # configure master grid
        self.master.grid_rowconfigure(0, weight=1)
        self.master.grid_columnconfigure(0, weight=1)
        # place the window
        self.grid(row=0, column=0, sticky='news')
        #configure grid
        self.grid_rowconfigure(0, weight=1)
        self.grid_rowconfigure(1, weight=1)
        self.grid_rowconfigure(2, weight=1)
        self.grid_rowconfigure(2, weight=0)
        self.grid_columnconfigure(0, weight=1)
        self.grid_columnconfigure(1, weight=1)
        self.grid_columnconfigure(2, weight=1)
        self.grid_columnconfigure(2, weight=2)
        # subwindows
        self.memoryview = None
        # draw the window
        self.createMenubar()
        self.createContextMenu()
        self.draw()
        self.setBinds()
Beispiel #39
0
    def __init__(self, master):
        """Construct a Box frame with parent master.

        Args:
            master: The parent frame.
        """
        Frame.__init__(self, master, style=styles.BOX_FRAME)
        self.position = (0, 0)
        self.binding_tag = 'BoxFrame' + str(Box._counter)
        self.number_text = StringVar(self, '')
        Box._counter += 1

        self.borders = dict()
        for edge in 'nesw':
            self.borders[edge] = Border(self, edge)

        self.inner_frame = Frame(self, width=30, height=30, style=styles.BOX_FRAME)
        self.pencil_marks = _build_3x3_grid(self.inner_frame, Pencil)

        self.label = Label(self.inner_frame, textvariable=self.number_text, style=styles.NUMBER_LABEL)

        _tag_widget(self, self.binding_tag)
        _tag_widget(self.inner_frame, self.binding_tag)
        _tag_widget(self.label, self.binding_tag)
        for mark in self.pencil_marks:
            _tag_widget(mark, self.binding_tag)
            _tag_widget(mark.label, self.binding_tag)
Beispiel #40
0
    def __init__(self, master):
        """Construct a Box frame with parent master.

        Args:
            master: The parent frame.
        """
        Frame.__init__(self, master, style=styles.BOX_FRAME)
        self.position = (0, 0)
        self.binding_tag = 'BoxFrame' + str(Box._counter)
        self.number_text = StringVar(self, '')
        Box._counter += 1

        self.borders = dict()
        for edge in 'nesw':
            self.borders[edge] = Border(self, edge)

        self.inner_frame = Frame(self,
                                 width=30,
                                 height=30,
                                 style=styles.BOX_FRAME)
        self.pencil_marks = _build_3x3_grid(self.inner_frame, Pencil)

        self.label = Label(self.inner_frame,
                           textvariable=self.number_text,
                           style=styles.NUMBER_LABEL)

        _tag_widget(self, self.binding_tag)
        _tag_widget(self.inner_frame, self.binding_tag)
        _tag_widget(self.label, self.binding_tag)
        for mark in self.pencil_marks:
            _tag_widget(mark, self.binding_tag)
            _tag_widget(mark.label, self.binding_tag)
Beispiel #41
0
    def __init__(self, master):
        """Construct a SubGrid frame with parent master.

        Args:
            master: The parent frame.
        """
        Frame.__init__(self, master, style=styles.GRID_FRAME)
        self.position = (0, 0)
Beispiel #42
0
 def __init__(self, master, train_dir):
     Frame.__init__(self, master)
     self.dir = train_dir
     self.manager = NNManager()
     self.img_list = ImgList(self)
     self.img_list.pack()
     Button(self, text='Histo', command=self.histo).pack()
     Button(self, text='Train', command=self.train).pack()
Beispiel #43
0
 def __init__(self,parent):
     Frame.__init__(self , parent)
     self.enc1 = Encoder(21)
     self.parent = parent
     self.conexion = True#is_connected()
     self.est_pinza = 1
     self.est_subebaja = 1
     self.initUI()
Beispiel #44
0
    def __init__(self, parent):
        Frame.__init__(self, parent)

        self.parent = parent

        self.initUI()

        self.db = dao('blist') #데이터베이스 관리 클래스 생성
Beispiel #45
0
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.parent = parent
     self.info = {}
     self.window = None
     self.size = (640, 480)
     self.fields = []
     self.init_ui()
Beispiel #46
0
 def __init__(self, master, width=0, height=0, sid=None, **kwargs):
     Frame.__init__(self, master, width=width, height=height)
     self.master = master
     self.width = width
     self.height = height
     self.sid = sid
     self.text_widget = Text(self, **kwargs)
     self.text_widget.pack(expand=True, fill="both")
Beispiel #47
0
 def __init__(self):
     window = Tk()
     self.parent = window
     window.geometry("800x600+50+50")
     Frame.__init__(self, window)
     self.baseline = 0
     self.initUI()
     window.mainloop()
Beispiel #48
0
 def __init__(self, lnp, parent):
     #pylint:disable=super-init-not-called
     Frame.__init__(self, parent)
     self.pack(side=TOP, fill=BOTH, expand=Y)
     self.lnp = lnp
     self.create_variables()
     self.create_controls()
     self.read_data()
Beispiel #49
0
 def __init__(self, parent, *args, **kwargs):
     #pylint:disable=super-init-not-called
     Frame.__init__(self, parent, *args, **kwargs)
     self.parent = parent
     self.pack(side=TOP, fill=BOTH, expand=Y)
     self.create_variables()
     self.create_controls()
     self.read_data()
Beispiel #50
0
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent

        self.parent.title("Example Form")
        self.pack(fill=BOTH, expand=True)

        f = Frame(self)
        f.pack(fill=X)

        l = Label(f, text='First Name', width=10)
        l.pack(side=LEFT, padx=5, pady=5)
       
        self.firstName = Entry(f)
        self.firstName.pack(fill=X, padx=5, expand=True)
        
        f = Frame(self)
        f.pack(fill=X)
        
        l = Label(f, text='Last Name', width=10)
        l.pack(side=LEFT, padx=5, pady=5)

        self.lastName = Entry(f)
        self.lastName.pack(fill=X, padx=5, expand=True)
        
        f = Frame(self)
        f.pack(fill=X)

        l = Label(f, text='Full Name', width=10)
        l.pack(side=LEFT, padx=5, pady=5)

        self.fullName = Label(f, text='ALEX POOPKIN', width=10)
        self.fullName.pack(fill=X, padx=5, expand=True)

        f = Frame(self)
        f.pack(fill=X)

        l = Label(f, text='', width=10)
        l.pack(side=LEFT, padx=5, pady=0)

        self.errorMessage = Label(f, text='Invalid character int the name!', foreground='red', width=30)
        self.errorMessage.pack(fill=X, padx=5, expand=True)

        f = Frame(self)
        f.pack(fill=X)

        b = Button(f, text='Close', command=lambda : self.parent.quit())
        b.pack(side=RIGHT, padx=5, pady=10)
        b['default'] = ACTIVE
        b.focus_set()

        self.clearButton = Button(f, text='Clear')
        self.clearButton.pack(side=RIGHT, padx=5, pady=10)
        self.clearButton['state'] = DISABLED

        self.sendButton = Button(f, text='Send')
        self.sendButton.pack(side=RIGHT, padx=5, pady=10)
Beispiel #51
0
 def __init__(self, parent, motspiller):
     Frame.__init__(self, parent)
     self.parent = parent
     self.spiller = motspiller
     self.resultat = []
     self.resultat_label = StringVar()
     self.resultat_label.set("Beskrivelse av siste spill kommer her")
     self.style = Style()
     self.fig = None
Beispiel #52
0
    def __init__(self, parent):
        self.man = manage_Book.MyDb('book.db') #DB에 접근하는 변수

        Frame.__init__(self, parent) #MAIN FRAME만들기
        self.parent = parent
        self.table_name = 'manager'
        self.conn = sqlite3.connect('book.db')
        self.cursor = self.conn.cursor()
        self.initUI()
    def __init__( self, parent, return_target ):
        Frame.__init__( self, parent )
        self.parent = parent
        self.pack(fill=BOTH, expand=1)
        self.return_target = return_target

        parent.protocol('WM_DELETE_WINDOW', self.quit )

        self.initUI()
Beispiel #54
0
    def __init__(self, master, edge):
        """Construct a Border frame with parent master for the given edge.

        Args:
            master: The parent frame.
            edge: One of 'nesw' for which edge this frame should attach to.
        """
        Frame.__init__(self, master)
        self.edge = edge
Beispiel #55
0
 def __init__(self, master):
     """Make boxes, register callbacks etc."""
     Frame.__init__(self, master)
     self.active_category = StringVar()
     self.bind("<Configure>", self.onResize)
     self.date = None
     self.predictor = Predictor()
     self.category_buttons = self.createCategoryButtons()
     self.text = Label(self, justify=CENTER, font="Arial 14")
Beispiel #56
0
 def __init__(self, parent):
     Frame.__init__(self, parent)
     self.parent = parent
     self.window = None
     self.size = (4096, 2160)
     self.width = self.size[0]
     self.height = self.size[1]
     self.canvasi = []
     self.db = DataBase()
     self.init_ui()
Beispiel #57
0
 def __init__(self, parent, pos, tag):
     Frame.__init__(self, parent)
     self.pack()
     self.parent = parent
     self.pos = pos
     self.tag = tag
     self.size = (250, 220)
     self.entries = []
     self.text_fields = []
     self.rect_id = None
    def __init__(self, parent, *args, **kwargs):
        Frame.__init__(self, parent, *args, **kwargs)
        self.parent = parent

        self.button = Button(self, text="start", command=self.callback)
        self.cancel = Button(self, text="cancel", command=self.cancel)

        self.button.grid(row=0, column=0)
        self.cancel.grid(row=0, column=1)

        self.is_canceled = False
Beispiel #59
0
 def __init__(self, master=None, names=[], command='',
              side=None, anchor=None, *args, **kw):
     Frame.__init__(self, master, *args, **kw)
     self.chkbtns=dict()
     self.vals=dict()
     for name in names:
         self.vals[name] = IntVar()
         self.chkbtns[name] = Checkbutton(self, text=name,
                                     variable=self.vals[name],
                                     command=command)
         self.chkbtns[name].pack(side=side, anchor=anchor)
Beispiel #60
0
    def __init__(self,root, type, Q, id):
        Frame.__init__(self,root)

        self.root = root
        self.typeFilter = StringVar()
        self.typeFilter.set(type)
        self.qFactor = StringVar()
        self.qFactor.set(Q)
        self.id = id

        self.initialize()