Hi Giuseppe, Did you already know about the generated ctypes bindings to gtk?
It already supports "gtk_clipboard_set_with_data".
gtk_clipboard_set_with_data = _rpythonic_function_(
"gtk_clipboard_set_with_data", ctypes.c_int, [ ("clipboard",
ctypes.POINTER(_GtkClipboard)), ("targets",
ctypes.POINTER(_GtkTargetEntry)), ("n_targets", ctypes.c_uint),
("get_func", ctypes.CFUNCTYPE(ctypes.c_void_p,
ctypes.POINTER(_GtkClipboard),ctypes.POINTER(_GtkSelectionData),ctypes.c_uint,ctypes.POINTER(ctypes.c_void_p),)),
("clear_func", ctypes.CFUNCTYPE(ctypes.c_void_p,
ctypes.POINTER(_GtkClipboard),ctypes.POINTER(ctypes.c_void_p),)),
("user_data", ctypes.POINTER(ctypes.c_void_p)),] )
I know no one is interested in using gtk with a ctypes like API, that's too low
level. To make things easy and more like the original pygtk, an object
oriented API is also generated ontop of the low level ctypes API. It here's
a usage example:
import os,sys, timeif '..' not in sys.path: sys.path.append( '..' )import
rpythonicgtk = rpythonic.module( 'gtk' )assert gtkgtk.init()win =
gtk.window_new( gtk.GTK_WINDOW_TOPLEVEL )win.set_title('hello
world')win.set_default_size( 320, 240 )def exit(*args):
gtk.main_quit()win.connect( 'destroy', exit )frame = gtk.frame_new('hello
world')win.add( frame )button = gtk.button_new_with_label("test")frame.add(
button )def callback(*args): print('python callback')button.connect( 'clicked',
callback )win.show_all()gtk.main()
The latest ctypes gtk is precached in
RPythonic/rpythonic/cache/genctypes/gtkhttp://rpythonic.googlecode.com/files/RPythonic-0.3.7.tar.bz2
by the way, there is also a precached version for gtk3.-hart
--- On Fri, 7/1/11, Giuseppe Penone <gius...@gmail.com> wrote:
From: Giuseppe Penone <gius...@gmail.com>
Subject: [pygtk] gtk_clipboard_set_with_data: (skip)
To: phol...@src.gnome.org
Cc: "pygtk" <pygtk@daa.com.au>
Date: Friday, 1 July, 2011, 1:21 AM
Hi Pavel,
I'm a GTK+ developer that used to work in pygtk2 and now ported the code to
pygobject introspection.
For my (GPL) application http://giuspen.com/cherrytree I absolutely need the
function gtk_clipboard_set_with_data
that I see you marhed as NON introspectable.
I wanted to ask you that function will ever be binded/what alternative should I
use instead.
Thank you and best regards,
Giuseppe.
-----Inline Attachment Follows-----
_______________________________________________
pygtk mailing list pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
_______________________________________________
pygtk mailing list pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/