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


Python Tk.rowconfigure方法代码示例

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


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

示例1: __init__

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
    def __init__(self, title):
        root = Tk()
        root.title(title)
        root.focus_set()
        root.rowconfigure(0, weight=0)
        root.columnconfigure(0, weight=1)
        root.rowconfigure(1, weight=1)
        self._root = root

        self.menubar = Frame(root)
        self.menubar.grid(row=0, column=0, sticky=(W, E))
        self.menubar['takefocus'] = False

        quit_button = Button(self.menubar, text='Quit', command=self.quit)
        quit_button.grid(row=0, column=0)

        self._menucolumn = 1
        self.views = list()

        self.paned_win = PanedWindow(root, orient=HORIZONTAL)
        self.paned_win.grid(row=1, column=0, sticky=(N, S, W, E))

        self._query = None
        self._accept_func = None

        self.sidebar_views = dict()
        self.sidebar_count = 0
        self.sidebar = PanedWindow(self.paned_win)
        self.paned_win.add(self.sidebar, weight=1)
        
        self.tabs = Notebook(self.paned_win)
        self.tabs.enable_traversal()
        self.paned_win.add(self.tabs, weight=5)
        self.root = self.tabs
开发者ID:gokai,项目名称:tim,代码行数:36,代码来源:mainview.py

示例2: create

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
 def create():
     root=Tk()        
     root.columnconfigure(0, weight=1)
     root.rowconfigure(0, weight=1)
     gui = Gui(mockControl(), root)
     gui.grid(sticky=E+W+S+N)
     return (root, gui)
开发者ID:basilevs,项目名称:varfill,代码行数:9,代码来源:gui.py

示例3: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run screen in test window."""
    from data_01_conflictModel import ConflictModel

    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    cFrame = ttk.Frame(root)
    cFrame.columnconfigure(0, weight=1)
    cFrame.rowconfigure(1, weight=1)
    cFrame.grid(column=0, row=0, sticky=NSEW)

    hSep = ttk.Separator(cFrame, orient=VERTICAL)
    hSep.grid(column=1, row=0, rowspan=10, sticky=NSEW)

    conf = ConflictModel()
    conf.load_from_file("save_files/Garrison.gmcr")

    testFrame = StabilityFrame(cFrame, conf)
    if testFrame.hasRequiredData():
        testFrame.buildFrame()
    else:
        print("data missing")
        return
    testFrame.enter()

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:30,代码来源:frame_08_stabilityAnalysis.py

示例4: setupGui

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def setupGui():
	global window
	global labelShows, labelEpisodes, labelDownloads
	global listShows, listEps, listDownloads
	global btnAbout, btnDownload, btnChooseFolder
	global folderFrame
	global folderName
	window = Tk()
	window.title('iView')
	window.minsize(300, 200)
	
	labelShows = Label(window, text='Shows')
	labelShows.grid(column=0, row=0, sticky=[N,S,E,W])
	
	listShows = Listbox(window)
	listShows.grid(column=0, row=1, sticky=[N,S,E,W])
	listShows.bind('<<ListboxSelect>>', indexEpsEv)
	indexShows()
	
	labelEpisodes = Label(window, text='Episodes')
	labelEpisodes.grid(column=1, row=0, sticky=[N,S,E,W])
	
	listEps = Listbox(window)
	listEps.grid(column=1, row=1, sticky=[N,S,E,W])
	listEps.bind('<<ListboxSelect>>', setEpNumEv)
	indexEps(0)
	
	labelDownloads = Label(window, text='Downloads')
	labelDownloads.grid(column=2, row=0, sticky=[N,S,E,W])
	
	listDownloads = Listbox(window)
	listDownloads.grid(column=2, row=1, sticky=[N,S,E,W])
	
	btnAbout = Button(window, text='About', command=about)
	btnAbout.grid(column=0, row=2, sticky=[N,S,E,W])
	
	btnDownload = Button(window, text='Download', command=download)
	btnDownload.grid(column=1, row=2, sticky=[N,S,E,W])
	
	btnChooseFolder = Button(window, text='Choose Download Folder', command=chooseDir)
	btnChooseFolder.grid(column=2, row=2, sticky=[N,S,E,W])
	
	folderName = Text(window, height=1)
	folderName.grid(column=0, row=3, columnspan=3)
	folderName.insert(END, expanduser("~")+(':Videos:iView:'.replace(':', os.sep)))
	
	window.columnconfigure(0, weight=1)
	window.columnconfigure(1, weight=1)
	window.columnconfigure(2, weight=1)
	window.rowconfigure(1, weight=1)
	
	def updateDownloadList():
		refreshDownloadList()
		window.after(1000, updateDownloadList)
	dlListThrd = threading.Thread(target=updateDownloadList)
	dlListThrd.setName('Update Download List')
	dlListThrd.start()
开发者ID:gitter-badger,项目名称:python-iview,代码行数:59,代码来源:iview-tk.py

示例5: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel('pris.gmcr')

    res = InverseContent(root, g1)
    res.grid(column=0, row=0, sticky=NSEW)

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:13,代码来源:widgets_f07_01_inverseContent.py

示例6: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run widget in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel('AmRv2.gmcr')

    theTree = TreeInfeas(root, g1)
    theTree.grid(column=0, row=0, sticky=NSEW)

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:14,代码来源:widgets_f02_02_infeasTreeview.py

示例7: editSettings

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
    def editSettings(cls):

        def commitSettings(messageInDialogIn):
            try:
                SettingsVars.DEFAULT_BOARD = defaultBoardBox.get()
                SettingsVars.REFRESH_INTERVAL = int(refreshIntervalBox.get())
                messageInDialogIn.destroy()
            except ValueError:
                messagebox.showwarning(message="Invalid Settings")
                messageInDialogIn.focus_force()

        settingsDialog = Tk()
        settingsDialog.title('Settings')
        try:
            if os.name == "nt":
                settingsDialog.wm_iconbitmap(bitmap='./gui/images/icon.ico')
        except _tkinter.TclError:
            pass
        settingsDialog.columnconfigure(0, weight=1)
        settingsDialog.rowconfigure(0, weight=1)

        settingsDialog.minsize(width=100, height=50)
        frame = Frame(settingsDialog)

        refreshIntervalLabel = Label(frame)
        refreshIntervalLabel['text'] = 'Refresh Interval'
        refreshIntervalLabel.pack()

        refreshIntervalBox = Entry(frame)
        refreshIntervalBox.insert(0, cls.REFRESH_INTERVAL)
        refreshIntervalBox.pack(fill='both')

        defaultBoardLabel = Label(frame)
        defaultBoardLabel['text'] = 'Default Board'
        defaultBoardLabel.pack()

        defaultBoardBox = Entry(frame)
        defaultBoardBox.insert(0, cls.DEFAULT_BOARD)
        defaultBoardBox.pack(fill='both')

        submitButton = Button(frame)
        submitButton['text'] = 'Ok'
        submitButton['command'] = lambda: commitSettings(settingsDialog)
        submitButton.pack(side="left", expand="yes", fill="both", padx=5, pady=3)

        cancelButton = Button(frame)
        cancelButton['text'] = 'Cancel'
        cancelButton['command'] = settingsDialog.destroy
        cancelButton.pack(fill='both', expand="yes", padx=5, pady=3)

        frame.pack(fill='both', expand="yes", padx=0, pady=0)

        return settingsDialog
开发者ID:Jelloeater,项目名称:chanThreadWatcher,代码行数:55,代码来源:settings.py

示例8: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run widget in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel('Prisoners.gmcr')

    FeasView = FeasDisp(root, g1)
    FeasView.grid(column=0, row=0, sticky=NSEW)

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:14,代码来源:widgets_f02_03_feasDisp.py

示例9: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run widget in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel()
    g1.load_from_file('Examples/SyriaIraq.gmcr')

    theTree = TreeInfeas(root, g1)
    theTree.grid(column=0, row=0, sticky=NSEW)

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:15,代码来源:widgets_f02a_02_infeasTreeview.py

示例10: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run widget in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel('Prisoners.gmcr')

    radFrame = RadiobuttonEntry(root, g1)
    radFrame.grid(column=0, row=0, sticky=(N, W))

    root.mainloop()

    print(radFrame.getStates())
开发者ID:onp,项目名称:gmcr-py,代码行数:16,代码来源:widgets_f02_01_radioButtonEntry.py

示例11: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run widget in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    g1 = ConflictModel()
    g1.load_from_file('Examples/SyriaIraq.gmcr')

    radFrame = RadiobuttonEntry(root, g1)
    radFrame.grid(column=0, row=0, sticky=(N, W))

    root.mainloop()

    print(radFrame.getStates())
开发者ID:onp,项目名称:gmcr-py,代码行数:17,代码来源:widgets_f02a_01_radioButtonEntry.py

示例12: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run screen in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    cFrame = ttk.Frame(root)
    cFrame.columnconfigure(0, weight=1)
    cFrame.rowconfigure(1, weight=1)
    cFrame.grid(column=0, row=0, sticky=NSEW)

    hSep = ttk.Separator(cFrame, orient=VERTICAL)
    hSep.grid(column=1, row=0, rowspan=10, sticky=NSEW)

    testConflict = ConflictModel('SyriaIraq.gmcr')

    testFrame = PreferenceRankingFrame(cFrame, testConflict)
    testFrame.enter()

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:22,代码来源:frame_05_preferenceRanking.py

示例13: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run screen in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    cFrame = ttk.Frame(root)
    cFrame.columnconfigure(0, weight=1)
    cFrame.rowconfigure(1, weight=1)
    cFrame.grid(column=0, row=0, sticky=NSEW)

    hSep = ttk.Separator(cFrame, orient=VERTICAL)
    hSep.grid(column=1, row=0, rowspan=10, sticky=NSEW)

    g1 = ConflictModel('AmRv2.gmcr')

    testFrame = DMInpFrame(cFrame, g1)
    testFrame.enter()

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:22,代码来源:frame_01_decisionMakers.py

示例14: main

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
def main():
    """Run screen in test window."""
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.rowconfigure(0, weight=1)

    cFrame = ttk.Frame(root)
    cFrame.columnconfigure(0, weight=1)
    cFrame.rowconfigure(1, weight=1)
    cFrame.grid(column=0, row=0, sticky=NSEW)

    hSep = ttk.Separator(cFrame, orient=VERTICAL)
    hSep.grid(column=1, row=0, rowspan=10, sticky=NSEW)

    g1 = ConflictModel()
    g1.load_from_file('Examples/SyriaIraq.gmcr')

    testFrame = MisperceptionFrame(cFrame, g1)
    testFrame.enter()

    root.mainloop()
开发者ID:onp,项目名称:gmcr-py,代码行数:23,代码来源:frame_02a_misperceptions.py

示例15: __init__

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import rowconfigure [as 别名]
class OthelloGUI:

    n = 1

    def __init__(self):
        self._configure_game()
        self._init_game()
        self.refresh_board()

    def _configure_game(self) -> None:
        config = ConfigureGUI()
        config.start()
        self.game = config.getOthello()

    def _init_game(self) -> None:
        # Make some game constants more easily accessible
        self.rows = self.game.board.rows
        self.columns = self.game.board.cols
        
        #
        # Main window
        #
        self._root = Tk()
        self._root.title("Othello")
        self._root.columnconfigure(0, weight=1)
        self._root.rowconfigure(2, weight=1)
        self._root.minsize(50 * self.columns + 100, 50 * self.rows + 100)
        
        #
        # Score Label
        #
        score_frame = Frame(self._root)
        self._score_label = ttk.Label(score_frame, background="white", foreground="black", text="TEMPORARY LABEL") #TODO: compute label text
        
        score_frame.grid(row=0, column=0, sticky="ew")
        self._score_label.grid(row=0, column=0, sticky="ew", padx=5, pady=5)
        
        score_frame.columnconfigure(0, weight=1)
        
        #
        # Info Label
        #
        info_frame = Frame(self._root)
        self._info_label = ttk.Label(info_frame, text="", background="white", foreground="black")
        
        info_frame.grid(row=1, column=0, sticky="ew")
        self._info_label.grid(row=0, column=0, sticky="ew", padx=5, pady=5)
        
        info_frame.columnconfigure(0, weight=1)
        
        #
        # Game content (Othello board)
        #
        self._content = Frame(self._root)
        self._content.grid(row=2, column=0, sticky="nsew")
        
        self.cells = []
        
        for row in range(self.rows):
            for col in range(self.columns):
                self.cells.append(self._build_cell(row, col))
                self._content.columnconfigure(col, weight=1)

            self._content.rowconfigure(row, weight=1)

    def _build_cell(self, row: int, col: int) -> Frame:
        cell = Frame(self._content, borderwidth=5, relief=const.SUNKEN, height=50, width=50)
        
        cell._canvas = Canvas(master=cell, height=50, width=50)
        cell.row = row
        cell.col = col
        cell.bound = False
        
        cell.grid(row=row, column=col, sticky="nsew")
        cell.columnconfigure(0, weight=1)
        cell.rowconfigure(0, weight=1)
        
        cell._canvas.grid(row=0, column=0, sticky="nsew")
        return cell

    def refresh_board(self) -> None:
        self.draw_board()
        self._score_label["text"] = "I update when things happen. n = %d" % self.n
        self.n = self.n + 1
    
    def draw_board(self) -> None:
        for cell in self.cells:
            p = Point(cell.col, cell.row)
            board_piece = self.game.board.piece_at(p)
            if(Piece.is_playable_piece(board_piece)):
                self.draw_piece(cell, board_piece)
                if cell.bound:
                    cell._canvas.unbind("<ButtonPress-1>", None)
            else:
                cell._canvas.bind("<ButtonPress-1>", self.click_empty)
                cell.bound = True

    def draw_piece(self, cell: Frame, piece: Piece) -> None:
        cell._canvas.delete(const.ALL)
        
#.........这里部分代码省略.........
开发者ID:solomc1,项目名称:python,代码行数:103,代码来源:othello_GUI(3).py


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