[pygtk] pygtk and python3 (ctypes-gtk)
Hart's Antler
bhartsho at yahoo.com
Thu Jan 6 13:04:47 WST 2011
Its more than just a test case for RPythonic. PyGTK is compiled, so it becomes an issue when used from Python embedded inside Blender, also Blender is using Python3 and i'm not sure what the status is of PyGTK with Python3, is it already working?
I found the tutorial thanks, got hello world running, next step python callbacks.
-brett
from _ctypes_gtk import *
gtk_init( ctypes.byref( ctypes.c_int(0) ), ctypes.byref( ctypes.pointer( ctypes.c_char_p(''))) )
winwidget = gtk_window_new(GTK_WINDOW_TOPLEVEL)win = ctypes.cast( winwidget, ctypes.POINTER(GtkWindow) )gtk_window_set_title(win, "ctypes pygtk")gtk_window_set_default_size(win, 320, 240)
gtk_signal_connect_full( ctypes.cast(win,ctypes.POINTER(GtkObject)), "destroy", gtk_main_quit, None, None, None, ctypes.c_int(0), ctypes.c_int(0))
frame = gtk_frame_new('hello world')gtk_container_add( ctypes.cast(win, ctypes.POINTER(GtkContainer)), ctypes.cast(frame, ctypes.POINTER(GtkWidget)))
gtk_widget_show_all( winwidget )gtk_main()print('exit')
--- On Wed, 1/5/11, jbowtie at amathaine.com <jbowtie at amathaine.com> wrote:
From: jbowtie at amathaine.com <jbowtie at amathaine.com>
Subject: Re: [pygtk] pygtk and python3 (ctypes-gtk)
To: "Hart's Antler" <bhartsho at yahoo.com>
Date: Wednesday, 5 January, 2011, 8:39 PM
Is there a particular scenario where this would be a better choice
than using the PyGTK bindings? Or is this just intended to be a test
case for the RPythonic wrapper generator?
I'd look at http://zetcode.com/tutorials/gtktutorial/firstprograms/
for some simple C programs to translate - the first example (just show
a window) is 4 function calls.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20110105/e7e46224/attachment.html>
More information about the pygtk
mailing list