Re: [PyOpenGL-Users] opengl() title question
Brought to you by:
mcfletch
|
From: Robin H. <rj...@gr...> - 2002-03-29 00:35:56
|
Doug writes:
>I'm using Opengl() function to create a window, and everything is
>working fine, except I can't figure out how to set the title bar text of
>the window. The window has the title "tk".
Finally a question I can help with!! :)
...
f = Frame()
f.winfo_toplevel().title( 'title here...' )
...
or in a toy program:
---------------------------------------------------
#!/usr/bin/env python
from Tkinter import *
class Application(Frame):
def say_hi(self):
print "hi there, everyone!"
def createWidgets(self):
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["command"] = self.quit
self.QUIT.pack({"side": "left"})
self.hi_there = Button(self)
self.hi_there["text"] = "Hello",
self.hi_there["command"] = self.say_hi
self.hi_there.pack({"side": "left"})
def __init__(self, master=None):
Frame.__init__(self, master)
# add a name to the window
self.winfo_toplevel().title( "hello world" )
self.pack()
self.createWidgets()
app = Application()
app.mainloop()
---------------------------------------------------
cheers,
robin
|