Exemple #1
0
def guiSetup():
    global bar, operator_id, bdframe
    cfg.print_cfg()

    cfgframe = ConfigFrame(tkroot, cfg)
    cfgframe.grid(padx=3, pady=3)

    bdframe = BoardFrame(tkroot, bd)
    bdframe.grid(padx=3, pady=3)

    max = 6 * 60 + 30
    bar = ProgressFrame(tkroot, max)

    # Center the Window
    tkroot.update_idletasks()
    xp = (tkroot.winfo_screenwidth() / 2) - (tkroot.winfo_width() / 2) - 8
    yp = (tkroot.winfo_screenheight() / 4) - (tkroot.winfo_height() / 2) - 20
    tkroot.geometry('{0}x{1}+{2}+{3}'.format(tkroot.winfo_width(),
                                             tkroot.winfo_height(), xp, yp))

    tkroot.update()

    #   get operator ID
    operator_id = ''
    while len(operator_id) == 0:
        pw = EntryWindow(tkroot, "Scan or Enter Operator ID ",
                         'Scan or Enter Operator ID', '')
        operator_id = pw.answer.get()

    cfgframe.SetOperator(operator_id)
Exemple #2
0
    def __init__(self, title, odo_name='GUItest', icon=None):
        Tk.__init__(self)
        #    tkroot.geometry("1000x500+450+350")
        s = Style()

        s.configure('Title.TLabel', font="ariel 20 bold")
        s.configure('TButton', font="ariel 14 bold")
        #    s.configure('TLabel',font="ariel 10 normal")

        self.option_add("*TButton.Font", "ariel 12 bold")
        self.option_add("*Label.Font", "Helvetica 12 bold")

        self.title(title)
        self.tk.call('wm', 'iconbitmap', self._w, '-default',
                     'c:/airfiber/airview.ico')

        # init the test  ConfigFrame
        self.cfgframe = ConfigFrame(self, title, odo_name)
        self.cfgframe.grid(padx=3, pady=3)

        # init Progress Bar
        max = 60 * 12
        self.bar = ProgressFrame(self, max)

        # init board.conf configuration
        self.boardframe = BoardFrame(self)
        self.boardframe.grid(padx=5, pady=5)
        #
        # Center the Window
        self.update_idletasks()
        xp = (self.winfo_screenwidth() / 2) - (self.winfo_width() / 2) - 8
        yp = (self.winfo_screenheight() / 4) - (self.winfo_height() / 2) - 20
        self.geometry('{0}x{1}+{2}+{3}'.format(self.winfo_width(),
                                               self.winfo_height(), xp, yp))

        self.update()