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


Python tkinter.FALSE属性代码示例

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


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

示例1: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def __init__(self, parent, property_dict, *args, **kw):
        tk.Frame.__init__(self, parent, *args, **kw)

        # create a canvas object and a vertical scrollbar for scrolling it
        self.vscrollbar = vscrollbar = tk.Scrollbar(self, orient=tk.VERTICAL)
        vscrollbar.pack(fill=tk.Y, side=tk.RIGHT, expand=tk.FALSE)
        self.canvas = canvas = tk.Canvas(self, bd=0, highlightthickness=0,
                        yscrollcommand=vscrollbar.set)
        canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=tk.TRUE)
        vscrollbar.config(command=canvas.yview)

        # reset the view
        canvas.xview_moveto(0)
        canvas.yview_moveto(0)

        # create a frame inside the canvas which will be scrolled with it
        self.interior = interior = tk.Frame(canvas)
        self.interior_id = canvas.create_window(0, 0, window=interior,
                                           anchor='nw')

        self.interior.bind('<Configure>', self._configure_interior)
        self.canvas.bind('<Configure>', self._configure_canvas)

        self.build(property_dict) 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:26,代码来源:viewer.py

示例2: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def __init__(self, master, async_result, description, title="Please wait!", timeout=None):
        self._async_result = async_result
        super().__init__(master)
        if misc_utils.running_on_mac_os():
            self.configure(background="systemSheetBackground")
        self.title(title)
        self.resizable(height=tk.FALSE, width=tk.FALSE)
        # self.protocol("WM_DELETE_WINDOW", self._close)
        self.desc_label = ttk.Label(self, text=description, wraplength=300)
        self.desc_label.grid(padx=20, pady=20)

        self.update_idletasks()

        self.timeout = timeout
        self.start_time = time.time()
        self.after(500, self._poll) 
开发者ID:thonny,项目名称:thonny,代码行数:18,代码来源:ui_utils.py

示例3: _init_menu

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def _init_menu(self) -> None:
        self.option_add("*tearOff", tk.FALSE)
        if lookup_style_option("Menubar", "custom", False):
            self._menubar = ui_utils.CustomMenubar(
                self
            )  # type: Union[tk.Menu, ui_utils.CustomMenubar]
            if self.get_ui_mode() != "simple":
                self._menubar.grid(row=0, sticky="nsew")
        else:
            opts = get_style_configuration("Menubar")
            if "custom" in opts:
                del opts["custom"]
            self._menubar = tk.Menu(self, **opts)
            if self.get_ui_mode() != "simple":
                self["menu"] = self._menubar
        self._menus = {}  # type: Dict[str, tk.Menu]
        self._menu_item_specs = (
            {}
        )  # type: Dict[Tuple[str, str], MenuItem] # key is pair (menu_name, command_label)

        # create standard menus in correct order
        self.get_menu("file", _("File"))
        self.get_menu("edit", _("Edit"))
        self.get_menu("view", _("View"))
        self.get_menu("run", _("Run"))
        self.get_menu("tools", _("Tools"))
        self.get_menu("help", _("Help")) 
开发者ID:thonny,项目名称:thonny,代码行数:29,代码来源:workbench.py

示例4: handle_button

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def handle_button(self, i, j):
        if (self.turn == tkinter.TRUE):
            self.button_lst[i][j].config(text="X", state=tkinter.DISABLED)
            self.turn = tkinter.FALSE
            self.bState[i][j] = 1
            if i in self.bWin:
                for a in range(1, 10):
                    for b in range(1, 10):
                        self.button_lst[a][b].config(state=tkinter.DISABLED,
                                                     bg="red")
                for a in range(1, 10):
                    self.button_lst[j][a].config(state=tkinter.NORMAL,
                                                 bg="blue")
            else:
                for a in self.bWin:
                    for b in range(1, 10):
                        self.button_lst[a][b].config(state=tkinter.DISABLED,
                                                     bg="red")
                for a in range(1, 10):
                    self.button_lst[j][a].config(state=tkinter.NORMAL,
                                                 bg="blue")


        else:
            self.button_lst[i][j].config(text="O", state=tkinter.DISABLED)
            self.turn = tkinter.TRUE
            self.bState[i][j] = -1
            for a in range(1, 10):
                for b in range(1, 10):
                    self.button_lst[a][b].config(state=tkinter.DISABLED,
                                                 bg="red")
            for a in range(1, 10):
                self.button_lst[j][a].config(state=tkinter.NORMAL, bg="blue")

        self.check() 
开发者ID:prateekiiest,项目名称:Code-Sleep-Python,代码行数:37,代码来源:inceptionTTT.py

示例5: startGame

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def startGame(self, p1, p2):
        self.p1_button.config(state=tkinter.DISABLED)
        self.p2_button.config(state=tkinter.DISABLED)
        self.back_p_button.config(state=tkinter.DISABLED)
        for i in range(1, 10):
            for j in range(1, 10):
                self.button_lst[i][j].config(state=tkinter.NORMAL)

        if (p1 == tkinter.TRUE):
            self.start_label.config(text="Player 1 starts with X")
            self.turn = tkinter.TRUE

        else:
            self.start_label.config(text="Player 2 starts with O")
            self.turn = tkinter.FALSE

        self.bState = [[10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                       [10, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

        self.bSum = [[0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0],
                     [0, 0, 0, 0, 0, 0, 0, 0], ]

        self.fState = [10, 0, 0, 0, 0, 0, 0, 0, 0, 0]

        self.bWin = [10]

        self.GameDone = tkinter.FALSE 
开发者ID:prateekiiest,项目名称:Code-Sleep-Python,代码行数:44,代码来源:inceptionTTT.py

示例6: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def __init__(self, parent, *args, **kw):
        tk.Frame.__init__(self, parent, *args, **kw)
        self.config(borderwidth=2, relief='sunken')

        # create a canvas object and a vertical scrollbar for scrolling it
        vscrollbar = tk.ttk.Scrollbar(self, orient=tk.VERTICAL)
        vscrollbar.pack(fill=tk.Y, side=tk.RIGHT, expand=tk.FALSE)
        canvas = tk.Canvas(self, bd=0, highlightthickness=0,
                        yscrollcommand=vscrollbar.set)
        canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=tk.TRUE)
        vscrollbar.config(command=canvas.yview)

        # reset the view
        canvas.xview_moveto(0)
        canvas.yview_moveto(0)

        # create a frame inside the canvas which will be scrolled with it
        self.interior = interior = tk.Frame(canvas)
        interior_id = canvas.create_window(0, 0, window=interior,
                                           anchor=tk.NW)

        self.prev_size = (interior.winfo_reqwidth(), max(interior.winfo_reqheight(), canvas.winfo_reqheight()))

        # track changes to the canvas and frame width and sync them,
        # also updating the scrollbar
        def _configure_interior(event):
            # update the scrollbars to match the size of the inner frame
            size = (interior.winfo_reqwidth(), max(interior.winfo_reqheight(), canvas.winfo_height()))
            if self.prev_size != size:
                canvas.config(scrollregion="0 0 %s %s" % size)
                self.prev_size = size
            # update the canvas's width to fit the inner frame
            if canvas.winfo_reqwidth() != interior.winfo_reqwidth():
                canvas.config(width=interior.winfo_reqwidth())
        interior.bind('<Configure>', _configure_interior)

        def _configure_canvas(event):
            # update the inner frame's width to fill the canvas
            if canvas.winfo_width() != interior.winfo_width():
                canvas.itemconfigure(interior_id, width=canvas.winfo_width())
        canvas.bind('<Configure>', _configure_canvas)
        self.canvas=canvas 
开发者ID:JonathanTaquet,项目名称:Oe2sSLE,代码行数:44,代码来源:VerticalScrolledFrame.py

示例7: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import FALSE [as 别名]
def __init__(self, parent, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.transient(parent)
        self.title('About Open e2sSample.all Library Editor')
        self.resizable(width=tk.FALSE, height=tk.FALSE)

        body = tk.Frame(self)
        self.text = tk.Text(body,state=tk.NORMAL,width=80)
        self.text.pack()
        body.pack(padx=5, pady=5)

        text = self.text
        text.config(cursor="arrow")
        text.insert(tk.INSERT,"Oe2sSLE "+str(Oe2sSLE_VERSION[0])+"."+str(Oe2sSLE_VERSION[1])+"."+str(Oe2sSLE_VERSION[2])+"\n")

        text.insert(tk.END,
"""
The Home of this application is its GitHub repository.
To contribute or support, visit """)
        text.tag_config("link-github", foreground="blue", underline=1)
        text.tag_bind("link-github", "<Button-1>", lambda event: webbrowser.open('https://github.com/JonathanTaquet/Oe2sSLE/'))
        text.insert(tk.END, "<https://github.com/JonathanTaquet/Oe2sSLE/>", "link-github")
        text.insert(tk.END,
"""

Copyright (C) 2015-2017 Jonathan Taquet

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see """)
        text.tag_config("link-gpl", foreground="blue", underline=1)
        text.tag_bind("link-gpl", "<Button-1>", lambda event: webbrowser.open('http://www.gnu.org/licenses/'))
        text.insert(tk.END, "<http://www.gnu.org/licenses/>", "link-gpl")

        text.config(state=tk.DISABLED)

        self.focus_set()
        self.grab_set()
        self.wait_window(self) 
开发者ID:JonathanTaquet,项目名称:Oe2sSLE,代码行数:50,代码来源:about_dialog.py


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