All,
I think we need to keep a list of real applications written
with the pygtk bindings (perhaps on James' page?). The
more example code we have, the less problems people will have
using this. On the GTK applications page there are about 3
listed. I know there must be more then this.
David,
There are some simple examples in the "examples"
directory of pygtk. Here is one of the simplest:
-------------------------------
# this is a translation of "Hello World III" from the GTK manual,
# using gtk.py
from gtk import *
def hello(*args): # this function (method, actually)
print "Hello World" # is connected to the signal below
window.destroy()
def destroy(*args):
window.hide()
mainquit()
window = GtkWindow(WINDOW_TOPLEVEL)
window.connect("destroy", destroy)
window.set_border_width(10)
button = GtkButton("Hello World")
button.connect("clicked", hello) # the hello function defined above
# is connected to the "clicked" signal
window.add(button)
button.show()
window.show()
mainloop()
--------------------------------------
There are other examples in the same location. For a rather
long and complicated example, see my program gconfig at
www.employees.org/~stannous/gconfig.html
I use almost every widget available in this code and I've
learned quite a bit doing it (both about Python and Gtk).
Good luck,
Sam
On Thu, Jan 07, 1999 at 09:33:53AM +0100, David BERTHELOT wrote:
-> Hi everybody,
->
-> i'm new to the list. I just read the Majordomo mail but
-> it does not speak about the mailing list archives. Do they
-> exist or is the list too new ?
->
-> In fact, i'm looking for a small code example such as
-> * Opening a window that contains a button with the mouse click
-> binded to a python function.
->
-> I'm not familiar with GTK but i used Tk before and i'm quite
-> familiar with it. So i'm not totally a newbie ;-)
->
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]