[136] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

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

daemon@ATHENA.MIT.EDU (Edwin Young)
Wed May 14 03:25:27 1997

Date: Wed, 14 May 1997 08:23:00 +0100 (BST)
From: Edwin Young <ey200@hermes.cam.ac.uk>
To: gtk-list@redhat.com
In-Reply-To: <199705132107.RAA27058@lacrosse.redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

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

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post