Re: [PyOpenGL-Users] opengl() title question
Brought to you by:
mcfletch
From: Douglas S. B. <db...@br...> - 2002-03-29 01:10:58
|
Thank you very much! Specifically, then, for Opengl it looks like (although not an object oriented example): ... self.win = Opengl(master = self.frame, width = width, \ height = height, double = db, depth = depth) self.win.pack(side = 'top', expand = 1, fill = 'both') self.win.winfo_toplevel().title("pyro@%s" % os.getenv('HOSTNAME')) ... And it works quite nicely. Between learning Python, Tk, and OpenGL, I got lost between languages. Thanks again, -Doug Robin Humble <rj...@gr...> said: > > 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 > -- Douglas S. Blank, Assistant Professor db...@br..., (610)526-6501 Bryn Mawr College, Computer Science Program 101 North Merion Ave, Park Science Building Bryn Mawr, PA 19010 dangermouse.brynmawr.edu |