Re: [gtk-list] Re: ANNOUNCE: python-gtk version 0.1



On Mon, Nov 03, 1997 at 11:11:12AM +0100, Sascha Ziemann wrote:
> 
> Neil Schemenauer wrote:
> 
> > import gtk
> > def hello():
> >         print 'hello world'
> > 
> > w = gtk.Window()
> > b = gtk.Button(label='Hello')
> > b.connect('clicked', hello)
> > w.add(b)
> > b.show()
> > w.show()
> > gtk.main()
> 
> I don't think that it is wise to change the names of all functions. Try
> using gtk.defs to create the stubs! There is a discussion between the
> makers of the Perl bindings and the Guile bindings to unify any bindings
> to every another language. Please try to find a consens with them so
> that every foreign binding works in the same way. 

Sorry, I can't agree with this.  What is the point of prefixing
every method with 'gtk_<sometype>_<method>'?  The translation to
my naming scheme is very simple:

	'gtk_<sometype>_<method>' -> '<sometype>.<method>'

Anyone familiar with the C API should have no problem making the
translation.  If 'gtk.py' was just a thin wrapper around the C
API I would agree with you (like the guile bindings?).  However,
I want 'gtk.py' to utilize the object oriented features of
Python.

Perhaps there should be some discussion on how object oriented
languages should implement bindings to Gtk.

I just realized that you may not understand what the gtk module
is.  There are actually two modules, a low level extension
module '_gtk', and a Python module 'gtk'.  '_gtk' uses exactly
the same names at the C API.  For example:


	from _gtk import *

	w = gtk_window_new(GTK_WINDOW_TOPLEVEL)
	gtk_window_show(w)
	gtk_main()

Hopefully this clears things up.


	Neil



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