當前位置: 首頁>>代碼示例>>Python>>正文


Python Progressbar.start方法代碼示例

本文整理匯總了Python中ttk.Progressbar.start方法的典型用法代碼示例。如果您正苦於以下問題:Python Progressbar.start方法的具體用法?Python Progressbar.start怎麽用?Python Progressbar.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ttk.Progressbar的用法示例。


在下文中一共展示了Progressbar.start方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: splashscreen

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]
def splashscreen():
    root = Tk()
    root.geometry("+200+200")
    root.overrideredirect(True)
    root.configure(bg = "white")
    back = PhotoImage(file = "splashscreen.gif")
    l1 = Label(root, image = back, bg = "white")
    scritta = Progressbar(root, orient = "horizontal", mode = "determinate", length = 240)
    scritta.start(30)
    copyright = Label(root, text = "Copyright by lokk3d", bg = "white")
    root.after(3000, root.destroy)
    l1.pack()
    scritta.pack(side  = "left")
    copyright.pack( side = "right")
    root.mainloop()
開發者ID:Tecnowiki,項目名稱:python-gui-tutorial-by-Tecnowiki,代碼行數:17,代碼來源:splashscreen-eSpeakTk.py

示例2: MPExportApp

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]
class MPExportApp(object):
    """docstring for MPExportApp"""
    def __init__(self, master):
        super(MPExportApp, self).__init__()
        self.master = master
        self.export_type = StringVar()

        master.columnconfigure(1, weight=1)

        export_type_label = Label(master, text="Data Type: ")
        export_type_label.grid(row=0, column=0, sticky=E)

        radio_group_frame = Frame(master)
        radio_group_frame.grid(row=0, column=1, sticky=W)

        self.events_radio_button = Radiobutton(radio_group_frame, text='Events', value='events', variable=self.export_type,
                                               command=self.radio_button_changed)

        self.events_radio_button.select()
        self.events_radio_button.grid(row=0, column=0)

        self.people_radio_button = Radiobutton(radio_group_frame, text='People', value='people', variable=self.export_type,
                                               command=self.radio_button_changed)
        self.people_radio_button.grid(row=0, column=1)

        api_key_label = Label(master, text="API Key: ")
        api_key_label.grid(row=1, column=0, sticky=E)

        self.api_key_entry = Entry(master)
        self.api_key_entry.grid(row=1, column=1, columnspan=2, sticky=(E,W))

        api_secret_label = Label(master, text="API Secret: ")
        api_secret_label.grid(row=2, column=0, sticky=E)

        self.api_secret_entry = Entry(master)
        self.api_secret_entry.grid(row=2, column=1, columnspan=2, sticky=(E, W))

        self.project_token_label = Label(master, text="Project Token: ", state=DISABLED)
        self.project_token_label.grid(row=3, column=0, sticky=E)

        self.project_token_entry = Entry(master, state=DISABLED)
        self.project_token_entry.grid(row=3, column=1, columnspan=2, sticky=(E, W))

        self.events_label = Label(master, text="Events: ")
        self.events_label.grid(row=4, column=0, sticky=E)

        self.events_entry = Entry(master)
        self.events_entry.insert(0, 'Event A,Event B,Event C')
        self.events_entry.bind('<FocusIn>', partial(self.clear_placeholder_text, self.events_entry))
        self.events_entry.grid(row=4, column=1, columnspan=2, sticky=(E, W))

        where_label = Label(master, text="Where: ")
        where_label.grid(row=5, column=0, sticky=E)
        self.where_entry = Entry(master)
        self.where_entry.grid(row=5, column=1, columnspan=2, sticky=(E, W))

        self.from_date_label = Label(master, text="From Date: ")
        self.from_date_label.grid(row=6, column=0, sticky=E)

        self.from_date_entry = Entry(master)
        self.from_date_entry.insert(0, 'YYYY-MM-DD')
        self.from_date_entry.bind('<FocusIn>', partial(self.clear_placeholder_text, self.from_date_entry))
        self.from_date_entry.grid(row=6, column=1, columnspan=2, sticky=(E, W))

        self.to_date_label = Label(master, text="To Date: ")
        self.to_date_label.grid(row=7, column=0, sticky=E)

        self.to_date_entry = Entry(master)
        self.to_date_entry.insert(0, 'YYYY-MM-DD')
        self.to_date_entry.bind('<FocusIn>', partial(self.clear_placeholder_text, self.to_date_entry))
        self.to_date_entry.grid(row=7, column=1, columnspan=2, sticky=(E, W))

        export_button = Button(master, text="EXPORT", fg="green", command=self.export)
        export_button.grid(row=8, column=1, sticky=(E, W))

        self.delete_button = Button(master, text="DELETE", fg='red', state=DISABLED,
                                    command=lambda: threading.Thread(target=self.delete_people).start())
        self.delete_button.grid(row=9, column=1, sticky=(E, W))

        self.progress_bar = Progressbar(master)
        self.progress_bar_value = IntVar()
        self.progress_bar.config(mode='determinate', orient='horizontal', variable=self.progress_bar_value)
        self.progress_bar.grid(row=10, column=0, columnspan=3, sticky=(E, W))


    def clear_placeholder_text(self, entry, event):
        entry_text = entry.get()
        if entry_text == 'Event A,Event B,Event C' or entry_text == 'YYYY-MM-DD':
            entry.delete(0, END)

    def make_events_string(self, events):
        events = events.replace(', ', ',')
        events = events.split(',')
        events_string = '['
        for x in range(0, len(events)):
            events_string += '"' + events[x] + '"'
            if x != len(events)-1:
                events_string += ','
            else:
                events_string += ']'
#.........這裏部分代碼省略.........
開發者ID:jaredmixpanel,項目名稱:mpexport_py,代碼行數:103,代碼來源:MPExport.py

示例3: TkApplicationWindow

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]

#.........這裏部分代碼省略.........
    def _init_menu(self):
        main_menu = self.menu(self.root)
        self.root.config(menu=main_menu)
        file_menu = self.menu(main_menu)
        osc_menu = self.menu(main_menu)
        midi_menu = self.menu(main_menu)
        bus_menu = self.menu(main_menu)
        #buffer_menu = self.menu(main_menu)
        tune_menu = self.menu(main_menu)
        help_menu = self.menu(main_menu)
        main_menu.add_cascade(label="File", menu=file_menu)
        main_menu.add_cascade(label="OSC", menu=osc_menu)
        main_menu.add_cascade(label="MIDI", menu=midi_menu)
        #main_menu.add_cascade(label="Buses", menu=bus_menu)
        #main_menu.add_cascade(label="Buffers", menu=buffer_menu)
        #main_menu.add_cascade(label="Tune", menu=tune_menu)
        #main_menu.add_cascade(label="Help", menu=help_menu)
        self._init_file_menu(file_menu)
        self._init_osc_menu(osc_menu)
        self._init_midi_menu(midi_menu)
        self._init_bus_menu(bus_menu)
        #self._init_buffer_menu(buffer_menu)
        self._init_tune_menu(tune_menu)
        self._init_help_menu(help_menu)

    def _init_file_menu(self, fmenu):
        fmenu.add_command(label="Save Scene", command = self.save_scene)
        fmenu.add_command(label="Load Scene", command = self.load_scene)
        fmenu.add_separator()
        fmenu.add_command(label="Lliascript (Legacy)", command = self.show_history_editor)
        fmenu.add_separator()
        fmenu.add_command(label="New Synth Group", command = self._add_synth_group)
        fmenu.add_separator()
        fmenu.add_command(label="Restart", command = self._interactive_tabula_rasa)
        fmenu.add_command(label="Quit", command = self.exit_app)

    def _init_osc_menu(self, iomenu):
        iomenu.add_command(label="Ping", command = self.ping_global)
        iomenu.add_command(label="Dump", command = self.app.proxy.dump)
        iomenu.add_command(label="Toggle OSC Trace", command = self.toggle_osc_trace)

    def _init_midi_menu(self, mmenu):
        map_menu = self.menu(mmenu)
        mmenu.add_command(label = "Channel Names", command = self.show_channel_name_dialog)
        mmenu.add_command(label = "Controller Names", command = self.show_controller_name_dialog)
        mmenu.add_cascade(label = "MIDI Maps", menu = map_menu)
        mmenu.add_command(label = "Toggle MIDI Input Trace", command = self.toggle_midi_input_trace)
        mmenu.add_command(label = "Toggle MIDI Output Trace", command = self.toggle_midi_output_trace)
        mmenu.add_command(label = "Toggle Program Pretty Printer", command = self.toggle_program_pretty_printer)
        
    def _init_bus_menu(self, bmenu):
        bmenu.add_command(label="Audio", command=self.show_audiobus_dialog)
        bmenu.add_command(label="Control", command=self.show_controlbus_dialog)
        
    # def _init_buffer_menu(self, bmenu):
    #     bmenu.add_command(label="View Buffers", command=self.show_bufferlist_dialog)

    def _init_tune_menu(self, tmenu):
        tmenu.add_command(label = "FIX ME: Nothing to see here")

    def _init_help_menu(self, hmenu):
        pass
        
    def exit_gui(self):
        try:
            self.root.destroy()
開發者ID:plewto,項目名稱:Llia,代碼行數:70,代碼來源:tk_appwindow.py

示例4: AudioJackGUI

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]
class AudioJackGUI(object):
    def __init__(self, master):
        self.root = master
        self.searching = False
        self.can_download = True
        audiojack.set_useragent('AudioJack', '1.0')
        self.frame = ScrollableFrame(self.root)
        self.frame.setconfig(bg='#0D47A1', width=1280, height=720)
        self.frame.pack(side=TOP, fill=BOTH, expand=1)
        self.label = Label(self.frame.mainframe, text='AudioJack', fg='#ffffff', bg=self.frame.mainframe['background'], font=('Segoe UI', 48))
        self.label.pack()
        self.url_entry = Entry(self.frame.mainframe, width=48, font=('Segoe UI', 20), bg='#1565C0', bd=2, highlightthickness=1, highlightcolor='#1565C0', highlightbackground='#0D47A1', fg='#ffffff', insertbackground='#ffffff', relief=FLAT, insertwidth=1)
        self.url_entry.pack()
        self.submit_button = Button(self.frame.mainframe, width=60, font=('Segoe UI', 16), text='Go!', bd=0, bg='#1E88E5', fg='#ffffff', activebackground='#2196F3', activeforeground='#ffffff', relief=SUNKEN, cursor='hand2', command=self.submit)
        self.submit_button.pack()

        self.search_progress = Progressbar(self.frame.mainframe, orient='horizontal', length=720, maximum=100 ,mode='indeterminate')

        self.error_info = Label(self.frame.mainframe, fg='#ff0000', bg=self.frame.mainframe['background'])

        # Use pack_forget on this to reset the view
        self.contents = Frame(self.frame.mainframe, bg=self.frame.mainframe['background'])

        # Contains results and custom tag options
        self.select_frame = Frame(self.contents, bg=self.frame.mainframe['background'])
        self.select_frame.pack()

        #Search results
        self.results_label = Label(self.select_frame, text='Results:', fg='#ffffff', bg=self.frame.mainframe['background'])
        self.results_frame = Frame(self.select_frame, bg=self.frame.mainframe['background'])
        self.results_label.pack()
        self.results_frame.pack()

        # Downloads
        self.file_label = Label(self.contents, fg='#ffffff', bg=self.frame.mainframe['background'])

    def submit(self):
        self.searching = True

        self.error_info.pack_forget()
        self.error_info.config(text='')
        self.contents.pack_forget()
        self.reset_results_frame()
        self.file_label.config(text='')

        self.results_queue = Queue.Queue()
        t = Thread(target=self.search)
        t.daemon = True
        t.start()
        self.submit_button.pack_forget()
        self.search_progress.pack()
        self.search_progress.start(10)
        self.root.after(100, self.handle_results)

    def search(self):
        url = self.url_entry.get()
        try:
            self.results_queue.put(audiojack.get_results(url))
        except Exception as e:
            self.results_queue.put([])

    def handle_results(self):
        try:
            results = self.results_queue.get(0)
            self.reset_results_frame()
            self.search_progress.pack_forget()
            self.submit_button.pack()
            if results == []:
                self.error_info.config(text='No results found.')
                self.error_info.pack()
            else:
                for i, entry in enumerate(results):
                    self.get_result_box(entry).grid(row=i / 4, column=i % 4)
                self.contents.pack()
                self.select_frame.pack()
        except Queue.Empty:
            self.root.after(100, self.handle_results)

    def reset_results_frame(self):
        for result in self.results_frame.winfo_children():
            result.destroy()

    def get_result_box(self, entry):
        try:
            text ='%s\n%s\n%s' % (entry['title'], entry['artist'], entry['album'])
            raw_image = Image.open(BytesIO(entry['img'].decode('base64')))
            side = self.frame.mainframe.winfo_reqwidth() / 4
            image_data = raw_image.resize((side, side), Image.ANTIALIAS)
            image = ImageTk.PhotoImage(image=image_data)
            frame = Frame(self.results_frame)
            button = Button(frame, fg='#ffffff', text=text, image=image, compound=CENTER, bg=self.frame.mainframe['background'], command=lambda: self.select(entry))
            button.image = image
            button.pack(fill=BOTH, expand=1)
            return frame
        except Exception as e:
            print e
            print type(e)

    def select(self, entry):
        if self.can_download:
#.........這裏部分代碼省略.........
開發者ID:Blue9,項目名稱:AudioJack-GUI,代碼行數:103,代碼來源:audiojack_gui_beta.py

示例5: QuoraAnalyticsUI

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]

#.........這裏部分代碼省略.........
        tree.column("question", stretch=True, anchor="w")
        tree.grid(column=0, columnspan=4, row=4, sticky="EWNS")
        tree.bind("<Double-1>", self.tree_item_click)
        self.answer_tree = tree
        self.populate_tree()

        f2 = Frame(self)
        self.add(f1, text="Answer Backup", underline=7)
        self.add(f2, text="Analytics")

    def tree_item_click(self, event):
        idx_clicked = self.answer_tree.identify_row(event.y)
        if idx_clicked:
            print "Tree Item Clicked - ", idx_clicked

    def show_busy_dialog(self):
        tkMessageBox.showerror(title="Task in Progress", message=BUSY_MSG, icon=tkMessageBox.INFO)

    def thread(self, task):
        print "Starting a new Thread for " + task
        if self.backup_status.get() != "Ready":
            self.show_busy_dialog()
        else:
            self.backup_status.set("Starting a new Task...")
            task_ids = (
                ("login", self.login_crawler),
                ("logout", self.logout_crawler),
                ("update", self.update_answer_list),
                ("reset", self.reset_answer_list),
            )

            for task_relation in task_ids:
                if task == task_relation[0]:
                    Thread(target=task_relation[1]).start()

    def reset_answer_list(self):
        confirm = tkMessageBox.askquestion(title="Confirm Reset", message=RESET_MSG, icon="warning")
        if confirm == "yes":
            self.backup_status.set("Reseting Answer List...")
            self.backup_progress.start(interval=500)
            self.crawler.reset_answer_list()
            self.answer_count.set(len(self.crawler.answer_list))
            self.populate_tree()

        self.backup_status.set("Ready")
        self.backup_progress.stop()
        self.backup_progress["value"] = 0

    def update_answer_list(self):
        try:
            self.backup_status.set("Checking Login Status...")
            self.backup_progress.start(interval=500)
            if not self.crawler.check_login(self.backup_progress, self.backup_status):
                self.backup_status.set("Logged Out !! Cannot continue")
                tkMessageBox.showerror(title="Login Required", message=LOGIN_REQ_MSG, icon=tkMessageBox.INFO)
            else:
                self.backup_progress["value"] = 10
                self.backup_status.set("Updating Answer List...It may take few minutes")
                self.crawler.update_answer_list(self.backup_progress, self.backup_status)
                self.answer_count.set(len(self.crawler.answer_list))
                self.populate_tree()
        except STException:
            tkMessageBox.showerror(title="Operation Aborted", message=TIMEOUT_MSG, icon=tkMessageBox.ERROR)

        self.backup_status.set("Ready")
        self.backup_progress.stop()
開發者ID:Alafazam,項目名稱:quora-analytics,代碼行數:70,代碼來源:main.py

示例6: iface

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]
class iface():
        def __init__(self):
            
            root.title("MuBlas")
            
            self.lab1 = Label(root, text="Music directory")
            self.lab1.grid(row = 0, column = 0)
            
            self.music_entry = Entry(root,width=50,bd=1)
            self.music_entry.grid(row = 1, column = 0)
            
            self.m_dir_but = Button(root)
            self.m_dir_but["text"] = "Choose directory"
            self.m_dir_but.grid(row = 1, column = 1)
            self.m_dir_but.bind("<Button-1>", self.ask_mus_dir)
            
            self.lab3 = Label(root, text="Size in MBytes")
            self.lab3.grid(row = 2, column = 0)
            
            self.size_entry = Entry(root,width=5,bd=1)
            self.size_entry.grid(row = 2, column = 1)
            
            self.lab2 = Label(root, text="Destination directory")
            self.lab2.grid(row = 3, column = 0)
            
            self.destination_entry = Entry(root,width=50,bd=1)
            self.destination_entry.grid(row = 4, column = 0)
            
            self.dest_dir_but = Button(root)
            self.dest_dir_but["text"] = "Choose directory"
            self.dest_dir_but.grid(row = 4, column = 1)
            self.dest_dir_but.bind("<Button-1>", self.ask_out_dir)
            
            self.process_but = Button(root)
            self.process_but["text"] = "Run"
            self.process_but.grid(row = 6, column = 0)
            self.process_but.bind("<Button-1>", self.start)
            
            self.exit_but = Button(root)
            self.exit_but["text"] = "Exit"
            self.exit_but.grid(row = 6, column = 1)
            self.exit_but.bind("<Button-1>", self.exit_app)
            
            self.pr_bar = Progressbar(root, mode='indeterminate')
            self.pr_bar.grid(row = 5, column = 0, sticky = "we", columnspan = 2)
            
            #self.pr_bar.start()
            

        def ask_mus_dir(self, event):
            dirname = tkFileDialog.askdirectory(parent = root,initialdir="/",title='Please select a directory')
            self.music_entry.delete(0, END)
            self.music_entry.insert(0, dirname)

        def ask_out_dir(self, event):
            dirname = tkFileDialog.askdirectory(parent = root,initialdir="/",title='Please select a directory')
            self.destination_entry.delete(0, END)
            self.destination_entry.insert(0, dirname)
            
        def start(self, event):
            self.pr_bar.start()
            self.process_but["state"] = DISABLED
            
            m_dir = self.music_entry.get()
            d_dir = self.destination_entry.get()
            sz = 1024000 * int(self.size_entry.get())
            
            mbls = MuBlas.MuBlas(m_dir, d_dir, sz)
            mbls.start()
            
            self.process_but["state"] = NORMAL
            self.pr_bar.stop()
            
        def exit_app(self, event):
            root.destroy()
            
        def process(self):
開發者ID:offtirael,項目名稱:MuBlas,代碼行數:79,代碼來源:main.py

示例7: Page

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]

#.........這裏部分代碼省略.........

	def submitSettings(self):
		actorSelections = []
		sonifySettings = []

		for i in range(6):
			selected = self.actorActive[i].get()
			gender = self.actorGender[i].get()

			actorSelections.append( [selected , gender ] )

		sonifySettings.append(self.tonelen.get())
		sonifySettings.append(self.bpm.get())
		sonifySettings.append(self.dpt.get())

		self.parent.actorSelections = actorSelections
		self.parent.sonifySettings = sonifySettings
		# print actorSelections
		# print sonifySettings

	def finishedPage(self):
		Label(self, text="Sonification Complete!", justify=CENTER, font=root.fontH1).pack(pady=200)



	def sonifyProcessPage(self):

		Label(self, text="Processing", justify=CENTER, font=root.fontH1).pack(pady=20)

		self.processing = Label(self, text="", justify=CENTER)
		self.processing.pack(pady=20)

		self.pbar = Progressbar(self, orient='horizontal', mode='indeterminate')
		self.pbar.start(10)
		self.pbar.pack()

		self.after(100, self.sonifyProcess)


	def sonifyProcess(self):
		# Create Output Directory
		path = dirname(normpath(self.parent.scriptpath))

		self.outdir = join(path, 'output_' + str(self.parent.movietitle))

		self.tempdir = join(self.outdir, 'temp')
		self.tempdir = join(self.tempdir, '')

		if not isdir(self.tempdir):
			makedirs(self.tempdir)

		notelen = self.parent.sonifySettings[0]
		notelen = int( notelen[-1:] )
		bpm = int( self.parent.sonifySettings[1] )
		cutoff = int( self.parent.sonifySettings[2] )

		# Create dictionary based on settings
		self.parent.Script.createSceneDictionary(cutoff=cutoff)
		sceneAmount = len(self.parent.Script.scenedictionary)

		for index, character in enumerate(self.parent.Script.topcharacters):
			selected = self.parent.actorSelections[index][0]
			gender = self.parent.actorSelections[index][1]

			if selected:
				charSong = Sonification(character, gender, index)
開發者ID:MaroGM,項目名稱:gendersonification,代碼行數:70,代碼來源:main.py

示例8: Metadator

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]
class Metadator(Tk):
    def __init__(self):
        u"""
        Main window constructor
        Creates 1 frame and 2 labeled subframes
        """
        # first: the log
        # see: http://sametmax.com/ecrire-des-logs-en-python/
        self.logger = logging.getLogger()
        self.logger.setLevel(logging.DEBUG)  # all errors will be get
        log_form = logging.Formatter('%(asctime)s || %(levelname)s || %(message)s')
        logfile = RotatingFileHandler('Metadator_LOG.log', 'a', 5000000, 1)
        logfile.setLevel(logging.DEBUG)
        logfile.setFormatter(log_form)
        self.logger.addHandler(logfile)
        self.logger.info('\n\t ======== Metadator ========')  # first messages
        self.logger.info('Starting the UI')

        # checking the path to GDAL in the path
        if "GDAL_DATA" not in env.keys():
            try:
                gdal.SetConfigOption(str('GDAL_DATA'),
                                     str(path.abspath(r'data/gdal')))
            except:
                print("Oups! Something has gone wrong...\
                      see: https://github.com/Guts/Metadator/issues/21")
        else:
            pass

        # basics settings
        Tk.__init__(self)           # constructor of parent graphic class
        self.title(u'Metadator {0}'.format(MetadatorVersion))
        self.style = Style()        # more friendly windows style
        if opersys == 'win32':
            self.logger.info('Op. system: {0}'.format(platform.platform()))
            self.iconbitmap('Metadator.ico')    # windows icon
            self.uzer = env.get(u'USERNAME')
        elif opersys == 'linux2':
            self.logger.info('Op. system: {0}'.format(platform.platform()))
            self.uzer = env.get(u'USER')
            icon = Image("photo", file=r'data/img/metadator.gif')
            self.call('wm', 'iconphoto', self._w, icon)
            self.minsize(580, 100)
            self.style.theme_use('clam')
        elif opersys == 'darwin':
            self.logger.info('Op. system: {0}'.format(platform.platform()))
            self.uzer = env.get(u'USER')
        else:
            self.logger.warning('Operating system not tested')
            self.logger.info('Op. system: {0}'.format(platform.platform()))
        self.resizable(width=False, height=False)
        self.focus_force()

        self.logger.info('GDAL version: {}'.format(gdal.__version__))

        # variables
        self.def_rep = ""       # folder to search for
        self.def_lang = 'FR'    # language to start
        self.def_doc = IntVar()     # to export into Word
        self.def_xls = IntVar()     # to export into Excel 2003
        self.def_xml = IntVar()     # to export into ISO 19139
        self.def_cat = IntVar()     # to merge all output Word files
        self.def_odt = IntVar()     # to export into OpenDocumentText
        self.def_dict = IntVar()    # to make a dictionnary of data
        self.def_kass = IntVar()    # to handle field name case sensitive
        self.def_stat = IntVar()    # to active/disable stats fields
        self.li_pro = []            # list for profiles in language selected
        self.li_shp = []            # list for shapefiles path
        self.li_tab = []            # list for MapInfo tables path
        self.num_folders = 0        # number of folders explored
        self.today = strftime("%Y-%m-%d")   # date of the day
        self.dico_layer = OD()      # dictionary about layer properties
        self.dico_profil = OD()     # dictionary from profile selected
        self.dico_fields = OD()     # dictionary for fields information
        self.dico_rekur = OD()      # dictionary of recurring attributes
        self.dico_err = OD()     # errors list
        self.dico_help = OD()                # dictionary of help texts
        li_lang = [lg for lg in listdir(r'locale')]   # available languages
        self.blabla = OD()      # texts dictionary

        # GUI fonts
        ft_tit = tkFont.Font(family="Times", size=10, weight=tkFont.BOLD)

        # fillfulling
        self.load_settings()
        self.load_texts(self.def_lang)
        self.li_profiles(self.def_lang)
        self.li_rekurs(self.def_lang)
        self.recup_help(self.def_lang)

        # Tabs
        self.nb = Notebook(self)
        self.tab_globals = Frame(self.nb)   # tab_id = 0
        self.tab_options = Frame(self.nb)   # tab_id = 1
        self.tab_attribs = Frame(self.nb)   # tab_id = 2
        self.nb.add(self.tab_globals,
                    text=self.blabla.get('gui_tab1'), padding=3)
        self.nb.add(self.tab_options,
                    text=self.blabla.get('gui_tab2'), padding=3)
        self.nb.add(self.tab_attribs,
#.........這裏部分代碼省略.........
開發者ID:Guts,項目名稱:Metadator,代碼行數:103,代碼來源:Metadator.py

示例9: TkSynthWindow

# 需要導入模塊: from ttk import Progressbar [as 別名]
# 或者: from ttk.Progressbar import start [as 別名]

#.........這裏部分代碼省略.........
                raise ValueError(msg)

        b_add_vel.bind("<Button-1>", add_map_callback)
        b_add_atouch.bind("<Button-1>", add_map_callback)
        b_add_keynum.bind("<Button-1>", add_map_callback)
        b_delete_vel.bind("<Button-1>", delete_map_callback)
        b_delete_atouch.bind("<Button-1>", delete_map_callback)
        b_delete_keynum.bind("<Button-1>", delete_map_callback)
        
    def sync_map2_tab(self):
        perf = self.synth.bank()[None].performance
        vmaps = perf.velocity_maps
        atmaps = perf.aftertouch_maps
        knmaps = perf.keynumber_maps
        self.list_vel_maps.delete(0, 'end')
        self.list_atouch_maps.delete(0, 'end')
        self.list_keynum_maps.delete(0, 'end')
        for q in str(vmaps).split('\n'):
            self.list_vel_maps.insert('end', q)
        for q in str(atmaps).split('\n'):
            self.list_atouch_maps.insert('end', q)
        for q in str(knmaps).split('\n'):
            self.list_keynum_maps.insert('end', q)            
        
    def status(self, msg):
        self._lab_status.config(text = msg)

    def warning(self, msg):
        msg = "WARNING: %s" % msg
        self._lab_status.config(text = msg)

    def set_value(self, param, value):
        for ed in self._child_editors.items():
            ed.set_value(param, value)

    def set_aspect(self, param, value):
        for ed in self._child_editors.values():
            ed.set_value(param, value)
    
    def sync(self, *ignore):
        self.sync_program_tab()
        self.sync_midi_tab()
        self.sync_map1_tab()
        self.sync_map2_tab()
        if "bank" not in ignore:
            self.bank_editor.sync_no_propegate()
        for key, ed in self._child_editors.items():
            if key not in ignore:
                ed.sync(*ignore)
                
    def annotation_keys(self):
        """
        See TkSubEditor annotation
        """
        acc = []
        for ed in self._child_editors.values():
            acc += ed.annotation_keys()
        return acc

    def set_annotation(self, key, text):
        """
        See TkSubEditor annotation
        """
        for ed in self._child_editors.values():
            ed.annotation(key, text)

    def get_annotation(self, key):
        """
        See TkSubEditor annotation
        """
        rs = None
        for ed in self._child_editors.values():
            rs = ed.get_annotation(key)
            if rs != None:
                return rs
        return None

    def update_progressbar(self, count, value):
        """
        Set progress bar to position value/count, where.
        count - Expected number of steps.
        value - Current step number.
        """
        self._progressbar.config(mode="determinate", maximum=count)
        self._progressbar.step()
        self.update_idletasks()
    
    def busy(self, flag, message=""):
        """
        Set progress bar to 'busy'
        """
        if message:
            self.status(message)
        self._progressbar.config(mode="indeterminate")
        if flag:
            self._progressbar.grid(row=0,column=PROGRESSBAR_COLUMN, sticky='w', padx=8)
            self._progressbar.start()
        else:
            self._progressbar.stop()
        self.update_idletasks()
開發者ID:plewto,項目名稱:Llia,代碼行數:104,代碼來源:tk_synthwindow.py


注:本文中的ttk.Progressbar.start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。