Re: [gtk-list] Re: Python (was Re: Proposal for a new project)



On Tue, 13 May 1997, Michael K. Johnson wrote:
> Having seen sample code for PerlGtk, I can say that as it stands, I'm
> not sure I would want a direct translation. ... I just have a vague 
> idea that I want the binding I use to be truly object-oriented and well
> tied into Python (better than PythonTk, definitely), and I want to be
> able to use them in code that looks compact; extra verbiage bothers me.

It should be possible to do better than Tkinter; that has to jump through
hoops to get around all the <shudder> Tcl floating around in Tk.

Just to kick around a few ideas, what should a python version of simple.c
look like? I was thinking something vaguely like

from gtk import *

def hello:
	gprint "hello world"

def destroy:
	gtk.exit(0)

gtk.init()
w = Window(WINDOW_TOPLEVEL)
w.destroy = destroy      #alternatively w.commands{"destroy":destroy}
w.border_width = 10

b = Button("Hello World")
b.clicked = [hello,w.destroy] #list of commands to execute
b.show()

w.add(b)
w.show()

gtk.main()

Bear in mind that I'm not wholly sure how you'd implement that...

-Edwin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]