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


Python ttk.Labelframe方法代碼示例

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


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

示例1: create_widgets

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def create_widgets(self, master):
        self.frame = ttk.Frame(master)
        self.restoreFrame = ttk.Labelframe(self.frame, text="Restore")
        self.restoreWindowCheckbutton = TkUtil.Checkbutton(
                self.restoreFrame, text="Window Position and Size",
                underline=0, variable=self.restoreWindow)
        TkUtil.Tooltip.Tooltip(self.restoreWindowCheckbutton,
                "Restore Toolbars and Window Position and Size at Startup")
        self.restoreFontCheckbutton = TkUtil.Checkbutton(self.restoreFrame,
                text="Font Settings", underline=0,
                variable=self.restoreFont)
        TkUtil.Tooltip.Tooltip(self.restoreFontCheckbutton,
                "Restore the Last Used Font Settings at Startup")
        self.restoreSessionCheckbutton = TkUtil.Checkbutton(
                self.restoreFrame, text="Session", underline=0,
                variable=self.restoreSession)
        TkUtil.Tooltip.Tooltip(self.restoreSessionCheckbutton,
                "Open the Last Edited File at Startup")
        self.otherFrame = ttk.Labelframe(self.frame, text="Other")
        self.blinkCheckbutton = TkUtil.Checkbutton(self.otherFrame,
                text="Blinking Cursor", underline=0, variable=self.blink)
        TkUtil.Tooltip.Tooltip(self.blinkCheckbutton,
                "Switch Cursor Blink On or Off") 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:25,代碼來源:Preferences.py

示例2: setup

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def setup(self):
        self.Canvas = tk.Label(self)
        self.Canvas.grid(row=0, column=0, columnspan=6, rowspan=6)
        ttk.Button(self, text="Prev", command=self.display_prev).grid(row=4, column=6)
        ttk.Button(self, text="Next", command=self.display_next).grid(row=4, column=7)
        ttk.Button(self, text="Save & Exit", command=self.save_and_exit).grid(
            row=5, column=6, columnspan=2
        )

        self.lfdata = ttk.Labelframe(self, padding=(2, 2, 4, 4), text="Selection")
        self.lfdata.grid(row=0, column=6, columnspan=2, sticky="ne")
        for i, item in enumerate(digits + "d"):
            ttk.Button(
                self.lfdata, text=item, command=partial(self.button_callback, item)
            ).grid(in_=self.lfdata, column=6 + i % 2, row=i // 2, sticky="w") 
開發者ID:cwerner,項目名稱:fastclass,代碼行數:17,代碼來源:fc_clean.py

示例3: __init__

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def __init__(self, path_app):
        super().__init__()
        self.title('Extended PyGISS')
        path_icon = abspath(join(path_app, pardir, 'images'))
        
        # generate the PSF tk images
        img_psf = ImageTk.Image.open(join(path_icon, 'node.png'))
        selected_img_psf = ImageTk.Image.open(join(path_icon, 'selected_node.png'))
        self.psf_button_image = ImageTk.PhotoImage(img_psf.resize((100, 100)))
        self.node_image = ImageTk.PhotoImage(img_psf.resize((40, 40)))
        self.selected_node_image = ImageTk.PhotoImage(selected_img_psf.resize((40, 40)))

        for widget in (
                       'Button',
                       'Label', 
                       'Labelframe', 
                       'Labelframe.Label', 
                       ):
            ttk.Style().configure('T' + widget, background='#A1DBCD')

        self.map = Map(self)
        self.map.pack(side='right', fill='both', expand=1)

        self.menu = Menu(self)
        self.menu.pack(side='right', fill='both', expand=1)

        menu = tk.Menu(self)
        menu.add_command(label="Import shapefile", command=self.map.import_map)
        self.config(menu=menu)

        # if motion is called, the left-click button was released and we 
        # can stop the drag and drop process
        self.bind_all('<Motion>', self.stop_drag_and_drop)
        self.drag_and_drop = False

        self.image = None
        self.bind_all('<B1-Motion>', lambda _:_) 
開發者ID:afourmy,項目名稱:pyGISS,代碼行數:39,代碼來源:extended_pyGISS.py

示例4: __init__

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def __init__(self, root):
        self.root = root
        root.title('Logging Handler')
        root.columnconfigure(0, weight=1)
        root.rowconfigure(0, weight=1)
        # Create the panes and frames
        vertical_pane = ttk.PanedWindow(self.root, orient=VERTICAL)
        vertical_pane.grid(row=0, column=0, sticky="nsew")
        horizontal_pane = ttk.PanedWindow(vertical_pane, orient=HORIZONTAL)
        vertical_pane.add(horizontal_pane)
        form_frame = ttk.Labelframe(horizontal_pane, text="MyForm")
        form_frame.columnconfigure(1, weight=1)
        horizontal_pane.add(form_frame, weight=1)
        console_frame = ttk.Labelframe(horizontal_pane, text="Console")
        console_frame.columnconfigure(0, weight=1)
        console_frame.rowconfigure(0, weight=1)
        horizontal_pane.add(console_frame, weight=1)
        third_frame = ttk.Labelframe(vertical_pane, text="Third Frame")
        vertical_pane.add(third_frame, weight=1)
        # Initialize all frames
        self.form = FormUi(form_frame)
        self.console = ConsoleUi(console_frame)
        self.third = ThirdUi(third_frame)
        self.clock = Clock()
        self.clock.start()
        self.root.protocol('WM_DELETE_WINDOW', self.quit)
        self.root.bind('<Control-q>', self.quit)
        signal.signal(signal.SIGINT, self.quit) 
開發者ID:beenje,項目名稱:tkinter-logging-text-widget,代碼行數:30,代碼來源:main.py

示例5: __init__

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def __init__(self):
        """create a tkk graphic interface with a main window tk_win"""
        self.__version__ = '0.9.1'
        self._title = "2019-06-16a : 'Support un-named Tabs!'"
        self.conn = None  # Baresql database object
        self.database_file = ""
        self.tk_win = Tk()
        self.tk_win.title('A graphic SQLite Client in 1 Python file')
        self.tk_win.option_add('*tearOff', FALSE)   # hint of tk documentation
        self.tk_win.minsize(600, 200)               # minimal size

        self.font_size = 10
        self.font_wheight = 0
        self.initialdir = "."
        # With a Menubar and Toolbar
        self.create_menu()
        self.create_toolbar()

        # Create style "ButtonNotebook"
        self.create_style()
        # Initiate Drag State
        self.state_drag = False
        self.state_drag_index = 0

        # With a Panedwindow of two frames: 'Database' and 'Queries'
        p = ttk.Panedwindow(self.tk_win, orient=HORIZONTAL)
        p.pack(fill=BOTH, expand=1)

        f_database = ttk.Labelframe(p, text='Databases', width=200, height=100)
        p.add(f_database)
        f_queries = ttk.Labelframe(p, text='Queries', width=200, height=100)
        p.add(f_queries)

        # build tree view 't' inside the left 'Database' Frame
        self.db_tree = ttk.Treeview(f_database, displaycolumns=[],
                                    columns=("detail", "action"))
        self.db_tree.tag_configure("run")
        self.db_tree.pack(fill=BOTH, expand=1)

        # create a  notebook 'n' inside the right 'Queries' Frame
        self.n = NotebookForQueries(self.tk_win, f_queries, [])

        # Bind keyboard shortcuts
        self.tk_win.bind('<F9>', self.run_tab) 
開發者ID:stonebig,項目名稱:sqlite_bro,代碼行數:46,代碼來源:sqlite_bro.py

示例6: new_query_tab

# 需要導入模塊: from tkinter import ttk [as 別名]
# 或者: from tkinter.ttk import Labelframe [as 別名]
def new_query_tab(self, title, query):
        """add a Tab 'title' to the notebook, containing the Script 'query'"""

        fw_welcome = ttk.Panedwindow(self.tk_win, orient=VERTICAL)  # tk_win
        fw_welcome.pack(fill='both', expand=True)
        self.notebook.add(fw_welcome, text=(title))

        # new "editable" script
        f1 = ttk.Labelframe(fw_welcome, text='Script', width=200, height=100)
        fw_welcome.add(f1)
        fw_label = Text(f1, bd=1, undo=True)

        scroll = ttk.Scrollbar(f1, command=fw_label.yview)
        fw_label.configure(yscrollcommand=scroll.set)
        fw_label.insert(END, (query))
        fw_label.pack(side=LEFT, expand=YES, fill=BOTH, padx=2, pady=2)
        scroll.pack(side=RIGHT, expand=NO, fill=BOTH, padx=2, pady=2)

        # keep tab reference  by tk id
        working_tab_id = "." + fw_welcome._name

        # keep tab reference to script (by tk id)
        self.fw_labels[working_tab_id] = fw_label

        # new "Results" Container
        fr = ttk.Labelframe(fw_welcome, text='Results', width=200, height=100)
        fw_welcome.add(fr)

        # containing a notebook
        fw_result_nb = Notebook(fr, style="ButtonNotebook")
        fw_result_nb.pack(fill='both', expand=True)
        # resize rules
        fw_welcome.columnconfigure(0, weight=1)
        # keep reference to result_nb objects (by tk id)
        self.fw_result_nbs[working_tab_id] = fw_result_nb

        # activate this tab print(self.notebook.tabs())
        self.notebook.select(working_tab_id)
        # workaround to have a visible result pane on initial launch
        self.add_treeview(
            working_tab_id, "_", "", "click on ('->') to run Script")
        return working_tab_id  # gives back tk_id reference of the new tab 
開發者ID:stonebig,項目名稱:sqlite_bro,代碼行數:44,代碼來源:sqlite_bro.py


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