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


Python tkinter.BROWSE屬性代碼示例

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


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

示例1: __init__

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import BROWSE [as 別名]
def __init__(self, parent, header, width=10, selectmode=tk.BROWSE):
        tk.Frame.__init__(self, parent)
        self.parent = parent
        self.num_f = len(header)
        self.headers = []
        self.lbs = []
        self.c = 0
        self.sel_idxs = []

        self.scroll = tk.Scrollbar(self, orient=tk.VERTICAL)
        for i in range(0, self.num_f):
            self.headers.append(tk.Label(self, text=header[i]))
            self.headers[-1].grid(row=0, column=self.c, sticky=tk.EW)
            self.lbs.append(tk.Listbox(self, width=width, selectmode=selectmode, yscrollcommand=self.yscroll, bg='white'))
            self.lbs[-1].grid(row=1, column=self.c, sticky=tk.EW)
            self.lbs[-1].bind("<<ListboxSelect>>", self.select)
            self.c += 1

        self.scroll.config(command=self.lbs[0].yview)
        self.scroll.grid(row=1, column=self.c, sticky=tk.NS) 
開發者ID:VCCRI,項目名稱:SVPV,代碼行數:22,代碼來源:gui_widgets.py

示例2: reset_frames

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import BROWSE [as 別名]
def reset_frames(self, update_current_class=True):
        self.dataset = self.parent.dataset
        self.clear(self.frame_list)
        self.canvas.yview_moveto(0)

        # if tab switching or image has been deleted and class is now empty
        if update_current_class or self.current_class not in self.dataset.classes:
            self.current_class = self.parent.current_object

        # initialise delete button if not yet done
        if not self.delete_button and self.current_class:
            self.delete_button = tk.Button(self.settings_frame, EDIT_BUTTON_LAYOUT, text='Delete selected images',
                                           command=self.delete_selected)
            self.delete_button.pack(side="top", fill="x", pady=10, padx=20)
            self.export_button = tk.Button(self.settings_frame, EDIT_BUTTON_LAYOUT, text='Export dataset',
                                           command=self.export_dataset_thread)
            self.export_button.pack(side="bottom", fill="x", pady=10, padx=40)

            spacing = tk.Frame(self.settings_frame, bg=GUI_SHADOW, height=1)
            spacing.pack(side="bottom", fill="x", padx=10)

            self.export_selection = tk.Listbox(self.settings_frame, selectmode=tk.BROWSE)
            self.export_selection.configure(relief="flat", cursor="hand2", takefocus=0, activestyle='none', bd=0,
                                            height=3,
                                            highlightcolor=GUI_BG, highlightbackground=GUI_BG,
                                            font=("Arial", 11, "bold"),
                                            selectbackground=GUI_SHADOW, fg=GUI_GRAYD, listvariable=0,
                                            selectforeground=GUI_GRAYD,
                                            exportselection=False)
            self.export_selection.bind('<<ListboxSelect>>', self.update_export_selection)
            self.export_selection.insert(0, "     Cropped images")
            self.export_selection.insert(1, "     Pascal VOC (xml)")
            self.export_selection.insert(2, "     Single csv file")
            self.export_selection.select_set(0)
            self.export_selection.pack(side="bottom", fill="x", pady=5, padx=40)

            # option menu to select how the data will be exported:
            tk.Label(self.settings_frame, bg=GUI_BG, fg=GUI_GRAYD, font="Arial 10 bold",
                     text="Export format:").pack(side="bottom", fill="x", padx=40) 
開發者ID:natdebru,項目名稱:OpenCV-Video-Label,代碼行數:41,代碼來源:dataset_frame.py

示例3: __init__

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import BROWSE [as 別名]
def __init__(self, parent, selected_id, helptext):
        logger.debug("Initializing: %s: (parent, %s, selected_id: %s, helptext: '%s')",
                     self.__class__.__name__, parent, selected_id, helptext)
        super().__init__(parent)
        self.pack(side=tk.TOP, padx=5, pady=5, fill=tk.BOTH, expand=True)
        self.session = None  # set when loading or clearing from parent
        self.thread = None  # Thread for loading data popup
        self.selected_id = selected_id
        self.popup_positions = list()

        self.canvas = tk.Canvas(self, bd=0, highlightthickness=0)
        self.canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        self.tree_frame = ttk.Frame(self.canvas)
        self.tree_canvas = self.canvas.create_window((0, 0), window=self.tree_frame, anchor=tk.NW)
        self.sub_frame = ttk.Frame(self.tree_frame)
        self.sub_frame.pack(side=tk.LEFT, fill=tk.X, anchor=tk.N, expand=True)

        self.add_label()
        self.tree = ttk.Treeview(self.sub_frame, height=1, selectmode=tk.BROWSE)
        self.scrollbar = ttk.Scrollbar(self.tree_frame, orient="vertical", command=self.tree.yview)
        self.scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

        self.columns = self.tree_configure(helptext)
        self.canvas.bind("<Configure>", self.resize_frame)
        logger.debug("Initialized: %s", self.__class__.__name__) 
開發者ID:deepfakes,項目名稱:faceswap,代碼行數:28,代碼來源:display_analysis.py


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