Beispiel #1
0
    def createWidgets(self):
        self.top = self.winfo_toplevel()

        self.style = Style()

        self.TabStrip1 = Notebook(self.top, takefocus='red')
        print(type(self.TabStrip1['takefocus']))
        self.TabStrip1.place(relx=0.02,
                             rely=0.005,
                             relwidth=0.96,
                             relheight=0.99)

        self.TabStrip1__Tab2 = Frame(self.TabStrip1, bg='white')
        tasklist_ = tasklist()
        tasklist_.create_tasklist_tv(self.TabStrip1__Tab2)

        self.TabStrip1__Tab1 = Frame(self.TabStrip1)
        self.home = main_page(self.TabStrip1__Tab1, tasklist_)
        self.TabStrip1.add(self.TabStrip1__Tab1, text='首页')

        self.TabStrip1.add(self.TabStrip1__Tab2, text='任务列表')
Beispiel #2
0
 def __init__(
     self,
     parent,
     options=None,
 ):
     """
     :param parent: базовый объект Tk
     :param options: параметры вывода
     """
     print('Start init')
     # self.url = 'https://some-random-api.ml/facts/cat'
     self.url = 'http://time.jsontest.com/'
     Frame.__init__(self, parent)
     self.style = Style()
     self.parent = parent
     self.pack(fill=BOTH, expand=1)
     # todo: refactor
     if options:
         self.options.update(options)
     self.create_window()
     self.init_ui()
Beispiel #3
0
def main(prog,args=None):
        root = tk.ThemedTk()
        root.configure(background="lightgrey")
        s = Style()
        s.theme_use('radiance')
        root.minsize(width=500,height=200)
        my_gui = MyGUI(root,title=prog,args=args)
        root.update_idletasks()
        RHeight = root.winfo_reqheight()
        RWidth = root.winfo_reqwidth()
        root.geometry(("%dx%d+300+300") % (RWidth,RHeight))
        args = my_gui
        root.bind("<Return>", my_gui.run)
        root.bind("<Escape>", my_gui.Quit)
        center(root)
        root.wait_window(my_gui.master)
        try:
                #print(args.arguments)
                detect_twins.Main(**args.arguments)
        except:
                root.destroy
    def init(**params):
        for key, default in (("debug", False), ("multiplierType", Multiplier)):
            for o in (CommonUIComponents, Global):
                setattr(o, constcase(snakecase(key)), params.get(key, default))

        SmartWidget._STYLE_INSTANCE = Style()

        # pylint: disable = import-outside-toplevel
        from tkinter import Canvas
        from tkinter.ttk import Button, Label, Radiobutton
        from .containers import             \
           Container                        \
           , LabeledContainer               \
           , LabeledRadioButtonGroup        \
           , LabeledWidgetContainer         \
           , LabeledWidgetLabeledContainer  \
           , LabeledWidgetsContainer        \
           , TimePicker
        from .widgets import \
           Checkbutton       \
           , Combobox        \
           , CommonCombobox  \
           , Entry           \
           , LabeledScale    \
           , Listbox         \
           , NumberEntry     \
           , Scrollbar       \
           , Spinbox         \
           , StatefulButton

        for tkinterBase in (Button, Canvas, Label, Radiobutton):
            CommonUIComponents.wrapClass(tkinterBase)

        for smartWidget in (Checkbutton, Combobox, CommonCombobox, Container,
                            Entry, LabeledContainer, LabeledRadioButtonGroup,
                            LabeledWidgetContainer, LabeledWidgetsContainer,
                            LabeledWidgetLabeledContainer, LabeledScale,
                            Listbox, NumberEntry, Scrollbar, Spinbox,
                            StatefulButton, TimePicker):
            CommonUIComponents.registerClass(smartWidget)
 def __init__(self):
     global root
     self.master = Toplevel(root)
     self.master.withdraw()
     self.master.protocol('WM_DELETE_WINDOW', root.destroy)
     self.master.iconbitmap(imgdir)
     self.master.geometry("400x150")
     self.master.resizable(False, False)
     self.master.title("Adb & Fastboot Installer - By @Pato05")
     estyle = Style()
     estyle.element_create("plain.field", "from", "clam")
     estyle.layout("White.TEntry",
                   [('Entry.plain.field', {'children': [(
                       'Entry.background', {'children': [(
                           'Entry.padding', {'children': [(
                               'Entry.textarea', {'sticky': 'nswe'})],
                               'sticky': 'nswe'})], 'sticky': 'nswe'})],
                       'border': '4', 'sticky': 'nswe'})])
     estyle.configure("White.TEntry",
                      background="white",
                      foreground="black",
                      fieldbackground="white")
     window = Frame(self.master, relief=FLAT)
     window.pack(padx=10, pady=5, fill=BOTH)
     Label(window, text='Installation path:').pack(fill=X)
     self.syswide = IntVar()
     self.instpath = StringVar()
     self.e = Entry(window, state='readonly',
                    textvariable=self.instpath, style='White.TEntry')
     self.e.pack(fill=X)
     self.toggleroot()
     Label(window, text='Options:').pack(pady=(10, 0), fill=X)
     inst = Checkbutton(window, text="Install Adb and Fastboot system-wide?",
                        variable=self.syswide, command=self.toggleroot)
     inst.pack(fill=X)
     self.path = IntVar(window, value=1)
     Checkbutton(window, text="Put Adb and Fastboot in PATH?",
                 variable=self.path).pack(fill=X)
     Button(window, text='Install', command=self.install).pack(anchor='se')
     self.master.deiconify()
Beispiel #6
0
    def init_ui(self, master):
        self.style = Style()
        self.style.theme_use("default")
        self.master.title("Calculator")


        self.label = Label(master, text="Enter two numbers")
        self.label.pack()

        self.entry1 = Entry()
        self.entry1.pack()

        self.entry2 = Entry()
        self.entry2.pack()

        self.val = IntVar()
        self.resultLabel = Label(master, textvariable=self.val)
        self.resultLabel.pack()

        buttonFrame = Frame()

        add_button = Button(buttonFrame, text="+", command=self.add)
        add_button.grid(row=0, column=0)

        minus_button = Button(buttonFrame, text="-", command=self.subtract)
        minus_button.grid(row=0, column=1)

        multiply_button = Button(buttonFrame, text="*", command=self.multiply)
        multiply_button.grid(row=0, column=2)

        divide_button = Button(buttonFrame, text="/", command=self.divide)
        divide_button.grid(row=0, column=3)

        clear_button = Button(buttonFrame, text="c", command=self.clear)
        clear_button.grid(row=0, column=4)

        buttonFrame.pack()

        self.close_button = Button(self.master, text="Close", command=self.master.quit)
        self.close_button.pack()
Beispiel #7
0
    def __init__(self, parent):
        self.parent = parent
        self.style = Style()
        #self.style.theme_create("light", parent= "clam")
        self.style.theme_use("clam")

        #self.style.configure('TButton', foreground = 'white', background = 'blue')
        self.style.configure('TFrame', background=GREY)
        self.style.configure(BGWHITE, background=WHITE)
        self.style.configure(BGDARKGREY, background=DARKGREY)
        self.style.configure("TNotebook", background=GREY, borderwidth=0)
        self.style.map("TNotebook.Tab",
                       background=[("selected", WHITE)],
                       foreground=[("selected", BLACK)])
        self.style.configure("TNotebook.Tab",
                             background=DARKGREY,
                             foreground=BLACK)
        self.style.configure("Tab", focuscolor=GREY)

        #self.parent.option_add('*Label.bg', 'red')
        self.parent.option_add('*TCombobox*Listbox.selectBackground', 'yellow')
        self.parent.option_add('*TCombobox*Listbox.selectForeground', 'black')
Beispiel #8
0
    def initUI(self):
        self.master.title("Hungarian Algoritms")
        self.style = Style()
        self.style.theme_use("default")
        frame = Frame(self, relief=RAISED, borderwidth=1)
        frame.pack(fill=BOTH, expand=True)
        self.pack(fill=BOTH, expand=True)

        canvas = Canvas(frame)

        closeButton = Button(self, text="Close")
        closeButton["command"] = self.quit
        closeButton.pack(side=RIGHT, padx=5, pady=5)

        RunButton = Button(self,
                           text="Draw",
                           command=lambda: self.draw(canvas, self.l))
        RunButton.pack(side=RIGHT, padx=5, pady=5)

        UploadButton = Button(self, text="Upload")
        UploadButton["command"] = self.onOpen
        UploadButton.pack(side=RIGHT)
Beispiel #9
0
    def initUI(self):
        self.master.title("Scale")
        self.style = Style()
        self.style.theme_use("default")

        self.frame = Frame(height=10, width=100, relief=SUNKEN)
        self.frame.pack(fill=X, expand=1)
        self.frame.grid_columnconfigure(0, weight=1)

        self.scale = Scale(self.frame, from_=0, to=100, command=self.onScale)
        self.scale.grid(row=0,
                        column=0,
                        columnspan=2,
                        padx=10,
                        pady=10,
                        sticky=E + W)
        #scale.pack(fill=X, padx=15, expand=1)
        #scale.pack(fill=X, padx=15)

        self.var = IntVar()
        self.label = Label(self.frame, text=0, textvariable=self.var)
        self.label.grid(row=0, column=2, sticky=W, padx=10)
Beispiel #10
0
    def initUI(self):

        self.master.title("OIKIA TESTING")
        self.pack(fill=BOTH, expand=1)

        # general
        Style().configure("TFrame", background="#333")

        ### text
        canvas = Canvas(self)

        # main title
        canvas.create_text(250,
                           10,
                           anchor=W,
                           font="Arial",
                           text=datetime.datetime.now(),
                           fill='#000000')

        # weather table
        weather_data = self.weather_reporter(D=self.D)
        weather_text = '\n'.join(' '.join(map(str, sl)) for sl in weather_data)

        canvas.create_text(200,
                           300,
                           anchor=W,
                           font="Arial",
                           text=weather_text,
                           fill='#ff0000')

        canvas.pack(fill=BOTH, expand=1)

        # img
        chosen_pic = Image.open(self.pic_chooser())
        display_pic = chosen_pic.resize((100, 100), Image.ANTIALIAS)
        display_pic = ImageTk.PhotoImage(display_pic)
        label1 = Label(self, image=display_pic)
        label1.image = display_pic
        label1.place(x=20, y=20)
Beispiel #11
0
    def __init__(self, master=None, **kw):
        """
        Create a CheckboxTreeview.

        The keyword arguments are the same as the ones of a Treeview.
        """
        Treeview.__init__(self, master, style='Checkbox.Treeview', **kw)
        # style (make a noticeable disabled style)
        style = Style(self)
        style.map("Checkbox.Treeview",
                  fieldbackground=[("disabled", '#E6E6E6')],
                  foreground=[("disabled", 'gray40')],
                  background=[("disabled", '#E6E6E6')])
        # checkboxes are implemented with pictures
        self.im_checked = PhotoImage(file=IM_CHECKED, master=self)
        self.im_unchecked = PhotoImage(file=IM_UNCHECKED, master=self)
        self.im_tristate = PhotoImage(file=IM_TRISTATE, master=self)
        self.tag_configure("unchecked", image=self.im_unchecked)
        self.tag_configure("tristate", image=self.im_tristate)
        self.tag_configure("checked", image=self.im_checked)
        # check / uncheck boxes on click
        self.bind("<Button-1>", self._box_click, True)
Beispiel #12
0
    def initUI(self):
        # self.pack(fill=BOTH, expand=1)
        self.parent.title("Галерея") #Название окна
        self.style = Style() #Стиль ???
        self.style.theme_use("default") #Темы для окна, еще есть alt, classic

        frame_left_top = Frame(self.parent, bg = 'green')#создание рамки
        frame_right_top = Frame(self.parent, bg = 'red')
        frame_left_top.pack(side=TOP, anchor="sw")#положение рамки
        frame_right_top.pack(side=TOP, anchor='sw')

        photo = Image.open("2.jpg")#ссылка на отображаемую картинку
        photo.thumbnail((600,600), Image.ANTIALIAS)#изменение размеров картинки
        galary_photo = ImageTk.PhotoImage(photo)#загрузка в Tk
        labal_galary = Label(frame_left_top, image=galary_photo) #создание Lebel
        labal_galary.image = galary_photo #сохранение ссылки, чтоб не съел сборщик мусора

        labal_galary.pack(anchor='center', padx=40, pady=25)#позиция картинки и отступы
        # imagesprite = canvas.create_image(0, 0, image=galary_photo)

        bt_galary = Button(frame_right_top, text='галерея', command=self.init_galary())
        bt_galary.pack(side=TOP, anchor='s', padx=40, pady=25)
Beispiel #13
0
    def initUI(self):
        self.style = Style()
        self.style.theme_use("default")

        self.master.title("convertisseur")
        self.pack(fill = BOTH, expand = 1)

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


        bouton = Button(self, text = "Quit",
                        command = self.quit)
        bouton.pack(side = RIGHT, padx = 5, pady = 5)
        bouton1 = Button(self, text = "stay")
        bouton1.pack(side = RIGHT, padx = 5, pady = 5)

        self.var = BooleanVar()
        cb = Checkbutton(self, text = "Montre le titre",
                         variable = self.var, command = self.onClick)
        self.var.set(True)
        cb.pack(side = LEFT, padx = 5, pady = 5)
def pat_list():
    global tr

    # CLEAR = Button(center_frame, text=" CLEAR ", command=clear_text)
    # CLEAR.pack()
    CLEAR_TREE = Button(rootp, text=" Clear the table ", command=clear_tree)
    CLEAR_TREE.place()
    # CLEAR_TREE.pack()

    # right_frame = Frame(rootd, relief='raised', borderwidth=3)
    # # center_frame.pack(fill=None, expand=False)
    # right_frame.place(relx=0.65, rely=0.15, anchor=E)

    style = Style()
    style.configure("BW.TLabel", foreground="white", background="black")

    x, y = 1000, 80

    # use tree view to show the data in forms of table
    # mention the number of columns
    tr = Treeview(rootp, columns=('A', 'B', 'C', 'D', 'E'), style="BW.TLabel", selectmode="extended")
    tr.place(anchor=W)
    # heading key + text
    tr.heading('#0', text='Sr no')
    tr.column('#0', minwidth=0, width=100, stretch=NO)
    tr.heading('#1', text='Patient Name')
    tr.column('#1', minwidth=0, width=100, stretch=NO)
    tr.heading('#2', text='Gender')
    tr.column('#2', minwidth=0, width=100, stretch=NO)
    tr.heading('#3', text='Patient Id')
    tr.column('#3', minwidth=0, width=100, stretch=NO)
    tr.heading('#4', text='Address')
    tr.column('#4', minwidth=0, width=100, stretch=NO)
    tr.heading('#5', text='Consulting Doc Id')
    tr.column('#5', minwidth=0, width=100, stretch=NO)

    show_records()

    tr.place(x=900, y=y + 100)
Beispiel #15
0
    def __init__(self, parent, **kwargs):
        """
            Create a tooltip with given parent.

            KEYWORD OPTIONS

                title, alpha, padx, pady, font, background, foreground, image, text

        """
        Toplevel.__init__(self, parent)
        if 'title' in kwargs:
            self.title(kwargs['title'])
        self.transient(parent)
        self.attributes('-type', 'tooltip')
        self.attributes('-alpha', kwargs.get('alpha', 0.75))
        self.overrideredirect(True)
        self.configure(padx=kwargs.get('padx', 4))
        self.configure(pady=kwargs.get('pady', 4))

        self.font = Font(self, kwargs.get('font', ''))

        self.style = Style(self)
        if 'background' in kwargs:
            bg = kwargs['background']
            self.configure(background=bg)
            self.style.configure('tooltip.TLabel', background=bg)
        if 'foreground' in kwargs:
            self.style.configure('tooltip.TLabel',
                                 foreground=kwargs['foreground'])

        self.im = kwargs.get('image', None)
        self.label = Label(self,
                           text=kwargs.get('text', ''),
                           image=self.im,
                           style='tooltip.TLabel',
                           font=self.font,
                           wraplength='6c',
                           compound=kwargs.get('compound', 'left'))
        self.label.pack()
Beispiel #16
0
def settings():
    settings_styles = Style()
    settings_styles.configure(
        "SettingsLabelframe.TLabelframe.Label", font=("Verdana", 18, "normal"))
    settings_styles.configure(
        "SettingsLabelframe.TLabelframe.Label", foreground='black')

    popup = Toplevel()
    popup.title("Settings")
    popup.transient(root)
    popup.resizable(False, False)

    other_frame = LabelFrame(popup, text="Settings", style="SettingsLabelframe.TLabelframe")
    basefreq_lbl = Label(other_frame, text="Octave")
    basefreq_om = OptionMenu(other_frame, OPTIONS['BASE_FREQ'], BASE_FREQS[-1], *BASE_FREQS)
    

    basefreq_lbl.grid(row=0, column=0, padx=5)
    basefreq_om.grid(row=0, column=1, padx=5)
    other_frame.pack(padx=15, pady=15, ipadx=5, ipady=5)

    popup.mainloop()
Beispiel #17
0
    def initUI(self):
        self.parent.title("Absolute positioning")
        self.pack(fill=BOTH, expand=1)
        Style().configure("TFrame", background="#333")

        bard = Image.open("D:\Pictures\earth-wallpapers-27744-9016486.jpg")
        bardejov = ImageTk.PhotoImage(bard)
        label1 = Label(self, image=bardejov)
        label1.image = bardejov
        label1.place(x=20, y=20)

        rot = Image.open("D:\Pictures\earth-wallpapers-27744-9016486.jpg")
        rotunda = ImageTk.PhotoImage(rot)
        label2 = Label(self, image=rotunda)
        label2.image = rotunda
        label2.place(x=40, y=160)

        minc = Image.open("D:\Pictures\earth-wallpapers-27744-9016486.jpg")
        mincol = ImageTk.PhotoImage(minc)
        label3 = Label(self, image=mincol)
        label3.image = mincol
        label3.place(x=170, y=50)
Beispiel #18
0
    def __init__(self, *args, **kwargs):
        '''
        Creates an GUI instance and setup for it.

        '''
        self.i = 0

        tk.Tk.__init__(self, *args, **kwargs)

        #title
        tk.Tk.wm_title(self, NAME + " - v." + VERSION)
        tk.Tk.minsize(self, width=WIDTH, height=HEIGHT)

        #WINDOW GEOMETRY

        #Background style
        Style().configure("TFrame", background="#999")

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

        #CANVAS
        self.canv = RoboCanvas(self)
        self.canv.grid_rowconfigure(0, weight=1)
        self.canv.grid_columnconfigure(0, weight=1)
        self.canv.grid(row=0, column=0, sticky="nsew")

        #BUTTON(S) FOR DEBUG
        self.create_debug_buttons()
        #self.create_control_panel()

        self.panel = PanelFrame(self)
        self.panel.grid(row=1, column=0, sticky="nsew")

        #initial call
        self.canv.read_input()
Beispiel #19
0
    def __init__(self,
                 parent,
                 lf_text,
                 mess_text,
                 def_inp="",
                 colour='brown',
                 mod=False):
        self.parent = parent
        self.lf_text = lf_text
        self.mess_text = mess_text
        self.mod = mod

        self.ent0 = None  #   for entry
        self.cb_opt = None  #   for check option

        self.out_var = StringVar()
        self.out_var.set(def_inp)

        self.farbe = farbe = {
            'blue': 'light blue',
            'brown': 'brown1',
            'green': 'light green',
            'pink': '#EAAFBF'
        }

        colour = colour if colour in farbe else 'brown'

        self.colour = colour

        st1 = Style()
        st1.theme_use('default')

        st1.configure(colour + '.TLabelframe', background='#C9B99B')
        st1.configure(colour + '.TLabelframe.Label', background=farbe[colour])
        st1.configure(colour + '.TCheckbutton', background=farbe[colour])
        st1.configure('brown.TLabel', background='#EDEF77')

        self.construct()
Beispiel #20
0
 def inicializar_gui(self):
     Style().configure('Tframe', background='#FFF')
     #ubicar la cara top
     img_face_top = Image.open('Caras digitalizadas\Cara_top.jpg')
     img_face_top = ImageTk.PhotoImage(img_face_top)
     lbl_face_top = tk.Label(self.master, image=img_face_top)
     lbl_face_top.image = img_face_top
     lbl_face_top.place(x=175, y=175)
     #ubicar la cara bottom
     img_face_bottom = Image.open('Caras digitalizadas\Cara_bottom.jpg')
     img_face_bottom = ImageTk.PhotoImage(img_face_bottom)
     lbl_face_bottom = tk.Label(self.master, image=img_face_bottom)
     lbl_face_bottom.image = img_face_bottom
     lbl_face_bottom.place(x=479, y=175)
     #ubicar la cara back
     img_face_back = Image.open('Caras digitalizadas\Cara_back.jpg')
     img_face_back = ImageTk.PhotoImage(img_face_back)
     lbl_face_back = tk.Label(self.master, image=img_face_back)
     lbl_face_back.image = img_face_back
     lbl_face_back.place(x=175, y=23)
     #ubicar la cara front
     img_face_front = Image.open('Caras digitalizadas\Cara_front.jpg')
     img_face_front = ImageTk.PhotoImage(img_face_front)
     lbl_face_front = tk.Label(self.master, image=img_face_front)
     lbl_face_front.image = img_face_front
     lbl_face_front.place(x=175, y=327)
     #ubicar la cara left
     img_face_left = Image.open('Caras digitalizadas\Cara_left.jpg')
     img_face_left = ImageTk.PhotoImage(img_face_left)
     lbl_face_left = tk.Label(self.master, image=img_face_left)
     lbl_face_left.image = img_face_left
     lbl_face_left.place(x=23, y=175)
     #ubicar la cara right
     img_face_right = Image.open('Caras digitalizadas\Cara_right.jpg')
     img_face_right = ImageTk.PhotoImage(img_face_right)
     lbl_face_right = tk.Label(self.master, image=img_face_right)
     lbl_face_right.image = img_face_right
     lbl_face_right.place(x=327, y=175)
Beispiel #21
0
    def showBtn(self):
        # creating buttons fot cities
        Style().configure("TButton", padding=(2, 8, 2, 8), font='serif 10')
        # create column
        self.columnconfigure(1, weight=1)
        self.columnconfigure(3, pad=3)

        df = pd.read_csv('cities.csv')

        # create row
        for i in range(len(df.index) + 3):
            self.rowconfigure(i, pad=3)

        self.showImg(im)
        print("---")
        ttk.Style().configure("TButton",
                              foreground='black',
                              background='yellow')
        fileToShow = ''
        for index, row in df.iterrows():
            if index is 0:
                abtn = ttk.Button(
                    self, text=row['City'], style="TButton"
                )  #, command=lambda i=index: self.updateImg(im, i))
            else:
                abtn = ttk.Button(
                    self,
                    text=row['City'],
                    style="TButton",
                    command=lambda i=index: self.updateImg(im, i))

            fileToShow = 'newsSingapore.txt'
            abtn.grid(row=index + 1, column=3, sticky=W + E)

        btn = ttk.Button(
            self, text="Analysis",
            style="TButton")  #, command=lambda: self.showAnalysis(fileToShow))
        btn.grid(row=len(df.index) + 1, column=3, sticky=W + E)
 def __init__(self, setpath, pathres, installpath, type='install'):
     global root
     self.master = Toplevel(root)
     self.master.withdraw()
     self.master.protocol('WM_DELETE_WINDOW', root.destroy)
     self.master.iconbitmap(imgdir)
     self.master.title('Adb & Fastboot installer - By @Pato05')
     self.master.resizable(False, False)
     frame = Frame(self.master, relief=FLAT)
     frame.pack(padx=10, pady=5, fill=BOTH)
     Label(frame, text=('Adb & Fastboot were successfully %s!' % (
         'updated' if type == 'update' else type+'ed')), font=('Segoe UI', 15)).pack(fill=X)
     if installpath is not None:
         Label(frame, text='Installation path: %s' %
               installpath, font=('Segoe UI', 12)).pack(fill=X)
     if setpath == 1 and pathres:
         Label(frame, text='You might need to restart applications to update PATH.', font=(
             'Segoe UI', 12)).pack(fill=X)
     elif setpath == 1 and not pathres:
         Style().configure('Red.TLabel', foreground='red')
         Label(frame, text='Failed to put Adb & Fastboot into path.',
               font=('Segoe UI', 12), style='Red.TLabel').pack(fill=X)
     self.master.deiconify()
Beispiel #23
0
    def initUI(self):
        self.master.title("Absolute positioning")
        self.pack(fill=BOTH, expand=1)

        Style().configure("TFrame", background="#333")

        bard = Image.open("bardejov.jpg")
        bardejov = ImageTk.PhotoImage(bard)
        label1 = Label(self, image=bardejov)
        label1.image = bardejov
        label1.place(x=20, y=20)

        rot = Image.open("rotunda.jpg")
        rotunda = ImageTk.PhotoImage(rot)
        label2 = Label(self, image=rotunda)
        label2.image = rotunda
        label2.place(x=40, y=160)

        minc = Image.open("mincol.jpg")
        mincol = ImageTk.PhotoImage(minc)
        label3 = Label(self, image=mincol)
        label3.image = mincol
        label3.place(x=170, y=50)
Beispiel #24
0
   def __init__(self, window): 
               
        self.path_resultados = ''
        self.input_text_resultados= ''  
        etiq_bt1 = "Archivo u2020"
        etiq_bt2 = "Descargar en..."
        etiq_bt3 = "Resultados"
        window.title("Huawei RET Checker 1.1")
        window.config(bg='#321899')
        window.resizable(0, 0) 
        window.geometry("800x300")  #ancho largo
           
        style = Style() 
        style.configure('W.TButton', font =('calibri', 10, 'bold', 'underline'), background = "orange", foreground = 'blue') 
               
        ttk.Button(window, text = etiq_bt1,style = 'W.TButton', command = lambda: self.set_path_log()).grid(row = 0) 
        self.scrolledtext0=st.ScrolledText(window, width=80, height=2)
        self.scrolledtext0.grid(column=1,row=0, padx=0, pady=10)

        ttk.Button(window, text = etiq_bt2, style = 'W.TButton',command = lambda: self.set_path_descarga()).grid(row = 4) 
        self.scrolledtext1=st.ScrolledText(window, width=80, height=2)
        self.scrolledtext1.grid(column=1,row=4, padx=0, pady=10)
        ttk.Button(window, text = etiq_bt3, style = 'W.TButton',command = lambda: self.Proceso1()).grid(row = 6) 
Beispiel #25
0
    def initUI(self):
            self.parent.title('Abs positioning')
            self.pack(fill = BOTH, expand=1)
            Style().configure('TFrame',background='#333')

            os.listdir("F:\Python\project1\image")
            bard = Image.open("F:\Python\project1\image\_aa.jpg")
            bardejov = ImageTk.PhotoImage(bard)
            label1 = Label(self, image=bardejov)
            label1.image = bardejov
            label1.place(x=20, y=20)

            rot = Image.open("F:\Python\project1\image\_bb.jpg")
            rotunda = ImageTk.PhotoImage(rot)
            label2 = Label(self, image=rotunda)
            label2.image = rotunda
            label2.place(x=40, y=160)

            minc = Image.open("F:\Python\project1\image\_cc.jpg")
            mincol = ImageTk.PhotoImage(minc)
            label3 = Label(self, image=mincol)
            label3.image = mincol
            label3.place(x=170, y=50)
Beispiel #26
0
    def __init__(self, master):
        Toplevel.__init__(self, master, class_=APP_NAME)
        self.title(_("Settings"))
        self.grab_set()
        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.rowconfigure(0, weight=1)
        self.resizable(True, True)
        self.minsize(470, 574)

        style = Style(self)
        self._bg = style.lookup('TFrame', 'background')

        self.notebook = Notebook(self)
        self._validate = self.register(self._validate_entry_nb)

        self.img_color = PhotoImage(master=self, file=IM_COLOR)

        self.lang = StringVar(self,
                              LANGUAGES[CONFIG.get("General", "language")])
        self.gui = StringVar(self,
                             CONFIG.get("General", "trayicon").capitalize())

        self._init_general()
        self._init_widget()

        self.notebook.grid(sticky='ewsn', row=0, column=0, columnspan=2)
        Button(self, text=_('Ok'), command=self.ok).grid(row=1,
                                                         column=0,
                                                         sticky='e',
                                                         padx=4,
                                                         pady=10)
        Button(self, text=_('Cancel'), command=self.destroy).grid(row=1,
                                                                  column=1,
                                                                  sticky='w',
                                                                  padx=4,
                                                                  pady=10)
Beispiel #27
0
    def initUI(self):
        Style().configure("TButton", padding=(0, 5, 0, 5), font='serif 10')

        for i in range(5):
            self.rowconfigure(i, pad=9)
            if i < 4:
                self.columnconfigure(i, pad=3)

        matrix = {
            'Cls': [1, 0],
            'Back': [1, 1],
            'Close': [1, 3],
            '7': [2, 0],
            '8': [2, 1],
            '9': [2, 2],
            '/': [2, 3],
            '4': [3, 0],
            '5': [3, 1],
            '6': [3, 2],
            '*': [3, 3],
            '1': [4, 0],
            '2': [4, 1],
            '3': [4, 2],
            '-': [4, 3],
            '0': [5, 0],
            '.': [5, 1],
            '=': [5, 2],
            '+': [5, 3],
        }

        entry = Entry(self)
        entry.grid(row=0, columnspan=4, sticky=W + E)
        for k, v in list(matrix.items()):
            v.append(Button(self, text=k))
            v[2].grid(row=v[0], column=v[1])
        self.matrix = matrix
        self.pack(padx=5, pady=5)
Beispiel #28
0
    def initUI(self):

        Style().configure("TFrame", background="#333")
        # frame = dark gray background
        self.master.title("Absolute positioning")
        # set the title of the window
        # .master = gives access to the root window
        self.pack(fill=BOTH, expand=1)
        # pack() organizes widgets into horizontal
        # and vertical boxes.
        # Frame widget is accessed via the self attribute
        # to the Tk root window and expanded in both direction

        image1 = Image.open("plus.jpg")
        # create an image object
        image11 = ImageTk.PhotoImage(image1)
        # create a photo image object from an image
        label1 = Label(self, image=image11)
        # create a label with an image
        # labels can contain image / text
        label1.image = image11
        # reference to the image to prevent
        # image being garbage collected
        label1.place(x=20, y=20)
        # place the label

        image2 = Image.open("identicon.jpg")
        image22 = ImageTk.PhotoImage(image2)
        label2 = Label(self, image=image22)
        label2.image = image22
        label2.place(x=40, y=160)

        image3 = Image.open("facebook.jpg")
        image33 = ImageTk.PhotoImage(image3)
        label3 = Label(self, image=image33)
        label3.image = image33
        label3.place(x=170, y=50)
Beispiel #29
0
    def __init__(self,
                 list_of_model_components,
                 xpa_access_point=None,
                 hide_plot_button=False,
                 xlabel=None,
                 ylabel=None):
        '''Create a new Tk window for the editor.

        The user supplies a list of sherpa model components.
        '''
        self.xpa = xpa_access_point

        self.win = Tk()
        self.win.title("DAX Sherpa Model Editor")
        sty = Style(self.win)
        sty.theme_use("clam")
        self.row = 0
        self.model_parameters = []
        for mdl in list_of_model_components:
            self.add_model_component(mdl)
        self.add_buttons(hide_plot_button)
        self.cancel_clicked = False
        self.x_label = xlabel
        self.y_label = ylabel
Beispiel #30
0
	def initUI(self): #hàm thiết lập UI
		self.parent.title('Bài Tập Lớn') #tạo tiêu đề cho khung Tkinter
		self.pack(fill = BOTH, expand = 1)

		Style().configure("TFrame", background="#333")

		bard = Image.open("logo.png")
		bardejov = ImageTk.PhotoImage(bard)
		label1 = Label(self, image = bardejov)
		label1.image = bardejov
		label1.place(x = 0, y = 0)

		introd = Button(self, text = "General Introduction", command = self.onIntro)
		introd.grid(padx = 10, pady = 20)
		introd.place(x = 150, y = 10)
		resize = Button(self, text = "Scaling", command = self.onResize)
		resize.grid(row = 1, column = 0)
		resize.place(x = 170, y = 50)
		transl = Button(self, text = "Translation", command = self.onTranslation)
		transl.grid(row = 2, column = 0)
		transl.place(x = 170, y = 80)
		rotate = Button(self, text = "Rotate", command = self.onRotate)
		rotate.grid(row = 3, column = 0)
		rotate.place(x = 170, y = 110)
		affine = Button(self, text = "Affine Transform", command = self.onAffine)
		affine.grid(row = 4, column = 0)
		affine.place(x = 157, y = 140)
		perspt = Button(self, text = "Perspective Transform", command = self.onPerspect)
		perspt.grid(row = 5, column = 0)
		perspt.place(x = 142, y = 170)
		applic = Button(self, text = "Application", command = self.onApply)
		applic.grid(row = 5, column = 0)
		applic.place(x = 170, y = 200)
		exit11 = Button(self, text = "Exit", command = self.onQuit)
		exit11.grid(row = 6, column = 0)
		exit11.place(x = 170, y = 270)