当前位置: 首页>>代码示例>>Python>>正文


Python tkinter.PanedWindow方法代码示例

本文整理汇总了Python中tkinter.PanedWindow方法的典型用法代码示例。如果您正苦于以下问题:Python tkinter.PanedWindow方法的具体用法?Python tkinter.PanedWindow怎么用?Python tkinter.PanedWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkinter的用法示例。


在下文中一共展示了tkinter.PanedWindow方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def __init__(self, master, position_key=None, preferred_size_in_pw=None, **kwargs):

        tk.PanedWindow.__init__(self, master, **kwargs)
        self._pane_minsize = 100
        self.position_key = position_key
        self._restoring_pane_sizes = False

        self._last_window_size = (0, 0)
        self._full_size_not_final = True
        self._configure_binding = self.bind("<Configure>", self._on_window_resize, True)
        self._update_appearance_binding = self.bind(
            "<<ThemeChanged>>", self._update_appearance, True
        )
        self.bind("<B1-Motion>", self._on_mouse_dragged, True)
        self._update_appearance()

        # should be in the end, so that it can be detected when
        # constructor hasn't completed yet
        self.preferred_size_in_pw = preferred_size_in_pw 
开发者ID:thonny,项目名称:thonny,代码行数:21,代码来源:ui_utils.py

示例2: create

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def create(self, **kwargs):
        return tkinter.PanedWindow(self.root, **kwargs) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:test_widgets.py

示例3: _build_ui

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def _build_ui(self):
        """ Build the elements for displaying preview images and options panels. """
        container = tk.PanedWindow(self,
                                   sashrelief=tk.RIDGE,
                                   sashwidth=4,
                                   sashpad=8,
                                   orient=tk.VERTICAL)
        container.pack(fill=tk.BOTH, expand=True)
        container.preview_display = self._display
        self._image_canvas = ImagesCanvas(container, self._tk_vars)
        container.add(self._image_canvas, height=400 * get_config().scaling_factor)

        options_frame = ttk.Frame(container)
        self._cli_frame = ActionFrame(
            options_frame,
            self._available_masks,
            self._samples.predictor.has_predicted_mask,
            self._patch.converter.cli_arguments.color_adjustment.replace("-", "_"),
            self._patch.converter.cli_arguments.mask_type.replace("-", "_"),
            self._patch.converter.cli_arguments.scaling.replace("-", "_"),
            self._config_tools,
            self._refresh,
            self._samples.generate,
            self._tk_vars)
        self._opts_book = OptionsBook(options_frame,
                                      self._config_tools,
                                      self._refresh)
        container.add(options_frame) 
开发者ID:deepfakes,项目名称:faceswap,代码行数:30,代码来源:preview.py

示例4: add_containers

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def add_containers(self):
        """ Add the paned window containers that
            hold each main area of the gui """
        logger.debug("Adding containers")
        maincontainer = tk.PanedWindow(self,
                                       sashrelief=tk.RIDGE,
                                       sashwidth=4,
                                       sashpad=8,
                                       orient=tk.VERTICAL,
                                       name="pw_main")
        maincontainer.pack(fill=tk.BOTH, expand=True)

        topcontainer = tk.PanedWindow(maincontainer,
                                      sashrelief=tk.RIDGE,
                                      sashwidth=4,
                                      sashpad=8,
                                      orient=tk.HORIZONTAL,
                                      name="pw_top")
        maincontainer.add(topcontainer)

        bottomcontainer = ttk.Frame(maincontainer, name="frame_bottom")
        maincontainer.add(bottomcontainer)
        self.objects["container_main"] = maincontainer
        self.objects["container_top"] = topcontainer
        self.objects["container_bottom"] = bottomcontainer

        logger.debug("Added containers") 
开发者ID:deepfakes,项目名称:faceswap,代码行数:29,代码来源:gui.py

示例5: add

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def add(self, child, **kw):
        kw.setdefault("minsize", self._pane_minsize)

        tk.PanedWindow.add(self, child, **kw)
        self._update_visibility()
        self._check_restore_preferred_sizes() 
开发者ID:thonny,项目名称:thonny,代码行数:8,代码来源:ui_utils.py

示例6: remove

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def remove(self, child):
        tk.PanedWindow.remove(self, child)
        self._update_visibility()
        self._check_restore_preferred_sizes() 
开发者ID:thonny,项目名称:thonny,代码行数:6,代码来源:ui_utils.py

示例7: forget

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def forget(self, child):
        tk.PanedWindow.forget(self, child)
        self._update_visibility()
        self._check_restore_preferred_sizes() 
开发者ID:thonny,项目名称:thonny,代码行数:6,代码来源:ui_utils.py

示例8: destroy

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def destroy(self):
        self.unbind("<Configure>", self._configure_binding)
        self.unbind("<<ThemeChanged>>", self._update_appearance_binding)
        tk.PanedWindow.destroy(self) 
开发者ID:thonny,项目名称:thonny,代码行数:6,代码来源:ui_utils.py

示例9: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import PanedWindow [as 别名]
def __init__(self):
        root = tk.Tk()
        root.title('OpenCV Demo')

        self.win = win = tk.PanedWindow(root, orient=tk.HORIZONTAL, sashrelief=tk.RAISED, sashwidth=4)
        self.win.pack(fill=tk.BOTH, expand=1)

        left = tk.Frame(win)
        right = tk.Frame(win)
        win.add(left)
        win.add(right)

        scrollbar = tk.Scrollbar(left, orient=tk.VERTICAL)
        self.demos_lb = demos_lb = tk.Listbox(left, yscrollcommand=scrollbar.set)
        scrollbar.config(command=demos_lb.yview)
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
        demos_lb.pack(side=tk.LEFT, fill=tk.BOTH, expand=1)

        self.samples = {}
        for fn in glob('*.py'):
            name = splitfn(fn)[1]
            if fn[0] != '_' and name not in exclude_list:
                self.samples[name] = fn

        for name in sorted(self.samples):
            demos_lb.insert(tk.END, name)

        demos_lb.bind('<<ListboxSelect>>', self.on_demo_select)

        self.cmd_entry = cmd_entry = tk.Entry(right)
        cmd_entry.bind('<Return>', self.on_run)
        run_btn = tk.Button(right, command=self.on_run, text='Run', width=8)

        self.text = text = ScrolledText(right, font=('arial', 12, 'normal'), width = 30, wrap='word')
        self.linker = linker = LinkManager(text, self.on_link)
        self.text.tag_config("header1", font=('arial', 14, 'bold'))
        self.text.tag_config("header2", font=('arial', 12, 'bold'))
        text.config(state='disabled')

        text.pack(fill='both', expand=1, side=tk.BOTTOM)
        cmd_entry.pack(fill='x', side='left' , expand=1)
        run_btn.pack() 
开发者ID:makelove,项目名称:OpenCV-Python-Tutorial,代码行数:44,代码来源:demo.py


注:本文中的tkinter.PanedWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。