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


Python Tk.rowconfigure方法代码示例

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


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

示例1: test_frame

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
def test_frame():
    c = Customers()
    p = Payments()

    root = Tk()
    rf = ReportsFrame(root,c,p,output_text)
    rf.grid(sticky='nsew')
    root.rowconfigure(0,weight=1)
    root.columnconfigure(0,weight=1)

    root.mainloop()
开发者ID:tylerjw,项目名称:jim_tracker,代码行数:13,代码来源:reports.py

示例2: testFrame

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
def testFrame():
    c = Customers()
    p = Payments()

    root = Tk()

    pf = PaymentFrame(root, c, p, output_text, refresh)
    pf.grid(sticky='nsew')
    root.rowconfigure(0,weight=1)
    root.columnconfigure(0,weight=1)

    root.mainloop()
开发者ID:tylerjw,项目名称:jim_tracker,代码行数:14,代码来源:payment.py

示例3: run

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
def run():
    """ starting the interface
    """

    from gui import GUI
    from Tkinter import Tk
    import system

    root = Tk()
    root.columnconfigure(0,weight=1)
    root.rowconfigure(1,weight=1)
    root.title(system.name + " " + system.version)
    root.minsize(width= system.minwidth , height=system.minheight)
    root.geometry(system.defsize)

    gui = GUI(root)
    gui.makeGUI()

    root.iconbitmap('hat2.ico')
    root.mainloop()
开发者ID:BackupTheBerlios,项目名称:pachat-svn,代码行数:22,代码来源:PAchat.py

示例4: output_text

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
        NewCustomerDialog.add_customer(self,event)
        if self.close:
            self.output_text("+ - Modified: " + name + " (" + self.payment.get() + ")\n")

def output_text(text):
    print text,

def refresh():
    print "refreshing...."

if __name__ == '__main__':
    c = Customers()
    pprint(c.get_list())
    
    root = Tk()
    ncf = CustomerFrame(root, c, output_text, refresh)
    ncf.grid(sticky='nsew')
    root.rowconfigure(0,weight=1)
    root.columnconfigure(0,weight=1)

    root.mainloop()

    # c = Customers()
    # pprint(c.get_list())
    
    # root = Frame()
    # ncd = NewCustomerDialog(root, c)
    # Button(root,text='New Customer',command=ncd.show).pack()
    # root.pack()
    # root.mainloop()
开发者ID:tylerjw,项目名称:jim_tracker,代码行数:32,代码来源:customer.py

示例5: editSettings

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

		def commitSettings(messageInDialogIn):
			# Temp vars
			ip = settings.serverIp
			p = settings.port

			settingsVars.serverIp = IPAddressBox.get()
			settingsVars.port = portBox.get()
			settingsVars.numberOfMessagesToGet = int(numberToGetBox.get())
			settingsVars.refreshInterval = int(refreshIntervalBox.get())

			if not cls.isServerActive():
				settingsVars.serverIp = ip
				settingsVars.port = p
				tkMessageBox.showerror(message='Invalid Server Address ' + 'http://' + IPAddressBox.get() + ':' + portBox.get() + '/')
				logging.warning('Invalid Server Address ' + 'http://' + IPAddressBox.get() + ':' + portBox.get() + '/')
			messageInDialogIn.destroy()

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

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

		addressLabel = Label(frame)
		addressLabel['text'] = 'Server Address'
		addressLabel.pack()

		IPAddressBox = Entry(frame)
		IPAddressBox.insert(0, cls.serverIp)
		IPAddressBox.pack(fill='both')

		portLabel = Label(frame)
		portLabel['text'] = 'Server Port'
		portLabel.pack()

		portBox = Entry(frame)
		portBox.insert(0, cls.port)
		portBox.pack(fill='both')

		numberToGetLabel = Label(frame)
		numberToGetLabel['text'] = '# of Messages To Get'
		numberToGetLabel.pack()

		numberToGetBox = Entry(frame)
		numberToGetBox.insert(0, cls.numberOfMessagesToGet)
		numberToGetBox.pack(fill='both')

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

		refreshIntervalBox = Entry(frame)
		refreshIntervalBox.insert(0, cls.refreshInterval)
		refreshIntervalBox.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,项目名称:forgeLandWallGUI,代码行数:76,代码来源:settings.py

示例6: __init__

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
class GUI:
    def __init__(self, model, title='PyCX Simulator', interval=0, stepSize=1,
            param_gui_names=None):
        self.model = model
        self.titleText = title
        self.timeInterval = interval
        self.stepSize = stepSize
        self.param_gui_names = param_gui_names
        if param_gui_names is None:
            self.param_gui_names = {}
        self.param_entries = {}
        self.statusStr = ""
        self.running = False
        self.modelFigure = None
        self.currentStep = 0

        self.initGUI()

    def initGUI(self):
        #create root window
        self.rootWindow = Tk()
        self.statusText = StringVar(value=self.statusStr)
        self.setStatusStr("Simulation not yet started")

        self.rootWindow.wm_title(self.titleText)
        self.rootWindow.protocol('WM_DELETE_WINDOW', self.quitGUI)
        self.rootWindow.geometry('550x700')
        self.rootWindow.columnconfigure(0, weight=1)
        self.rootWindow.rowconfigure(0, weight=1)

        self.frameSim = Frame(self.rootWindow)

        self.frameSim.pack(expand=YES, fill=BOTH, padx=5, pady=5, side=TOP)
        self.status = Label(self.rootWindow, width=40, height=3, relief=SUNKEN,
                            bd=1, textvariable=self.statusText)
        self.status.pack(side=TOP, fill=X, padx=1, pady=1, expand=NO)

        self.runPauseString = StringVar()
        self.runPauseString.set("Run")
        self.buttonRun = Button(self.frameSim, width=30, height=2,
                                textvariable=self.runPauseString,
                                command=self.runEvent)
        self.buttonRun.pack(side=TOP, padx=5, pady=5)

        self.showHelp(self.buttonRun,
                      "Runs the simulation (or pauses the running simulation)")
        self.buttonStep = Button(self.frameSim, width=30, height=2,
                                 text="Step Once", command=self.stepOnce)
        self.buttonStep.pack(side=TOP, padx=5, pady=5)
        self.showHelp(self.buttonStep, "Steps the simulation only once")
        self.buttonReset = Button(self.frameSim, width=30, height=2,
                                  text="Reset", command=self.resetModel)
        self.buttonReset.pack(side=TOP, padx=5, pady=5)
        self.showHelp(self.buttonReset, "Resets the simulation")

        for param in self.model.params:
            var_text = self.param_gui_names.get(param, param)
            can = Canvas(self.frameSim)
            lab = Label(can, width=25, height=1 + var_text.count('\n'),
                        text=var_text, anchor=W, takefocus=0)
            lab.pack(side='left')
            ent = Entry(can, width=11)
            val = getattr(self.model, param)
            if isinstance(val, bool):
                val = int(val)  # Show 0/1 which can convert back to bool
            ent.insert(0, str(val))
            ent.pack(side='left')
            can.pack(side='top')
            self.param_entries[param] = ent
        if self.param_entries:
            self.buttonSaveParameters = Button(self.frameSim, width=50,
                    height=1, command=self.saveParametersCmd,
                    text="Save parameters to the running model", state=DISABLED)
            self.showHelp(self.buttonSaveParameters,
                    "Saves the parameter values.\n" +
                    "Not all values may take effect on a running model\n" +
                    "A model reset might be required.")
            self.buttonSaveParameters.pack(side='top', padx=5, pady=5)
            self.buttonSaveParametersAndReset = Button(self.frameSim, width=50,
                    height=1, command=self.saveParametersAndResetCmd,
                    text="Save parameters to the model and reset the model")
            self.showHelp(self.buttonSaveParametersAndReset,
                    "Saves the given parameter values and resets the model")
            self.buttonSaveParametersAndReset.pack(side='top', padx=5, pady=5)

        can = Canvas(self.frameSim)
        lab = Label(can, width=25, height=1, text="Step size ", justify=LEFT,
                anchor=W, takefocus=0)
        lab.pack(side='left')
        self.stepScale = Scale(can, from_=1, to=500, resolution=1,
                               command=self.changeStepSize, orient=HORIZONTAL,
                               width=25, length=150)
        self.stepScale.set(self.stepSize)
        self.showHelp(self.stepScale,
                "Skips model redraw during every [n] simulation steps\n" +
                "Results in a faster model run.")
        self.stepScale.pack(side='left')
        can.pack(side='top')

        can = Canvas(self.frameSim)
#.........这里部分代码省略.........
开发者ID:thaije,项目名称:intro_comp_science,代码行数:103,代码来源:pycx_gui.py

示例7: Tk

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import rowconfigure [as 别名]
                return -1 # Opponent won
        return 0 # Draw
       
########################################################################

master = Tk()
master.title("TIC TAC TOE :")
master.style = Style()
master.configure("TButton", padding=(0, 30, 0, 30),font='serif 10')
master.configure("TFrame", background="#786")

master.columnconfigure(0, pad=3)
master.columnconfigure(1, pad=3)
master.columnconfigure(2, pad=3)
			
master.rowconfigure(0, pad=3)
master.rowconfigure(1, pad=3)
master.rowconfigure(2, pad=3)
master.rowconfigure(3, pad=3)

entry = Entry(self)
entry.grid(row=0, columnspan=4, sticky=W+E)

T1 = Button(self, text="_")
T1.grid(row=1, column=0)
T2 = Button(self, text="_")
T2.grid(row=1, column=1)
T3 = Button(self, text="_")
T3.grid(row=1, column=2)

T4 = Button(self, text="_")
开发者ID:rohankoul,项目名称:CL-II,代码行数:33,代码来源:min.py


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