[pygtk] 'gtk.gdk.DragContext' object has no attribute 'get_source_widget'

Stephen George steve_geo at optusnet.com.au
Thu Feb 19 07:08:58 WST 2009


I using a code base, that works fine on linux and produces the following 
error on windows.

  File "C:\Program Files\gramps\DataViews\GrampletView.py", line 1306, 
in drop_widget
    button = context.get_source_widget()
AttributeError: 'gtk.gdk.DragContext' object has no attribute 
'get_source_widget'

I looked at the documentation for pyGTK under DragContext, and 
get_source_widget() is listed.

however when doing a dir on DragContext it is not listed.

Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import gtk
 >>> dir( gtk.gdk.DragContext)
['__class__', '__cmp__', '__delattr__', '__dict__', '__doc__', 
'__gdoc__', '__getattribute__', '__gobject_init__', '__gr
efcount__', '__gtype__', '__hash__', '__init__', '__module__', 
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__
setattr__', '__str__', 'action', 'actions', 'chain', 'connect', 
'connect_after', 'connect_object', 'connect_object_after
', 'dest_window', 'disconnect', 'disconnect_by_func', 'drag_abort', 
'drag_drop', 'drag_drop_succeeded', 'drag_find_windo
w', 'drag_find_window_for_screen', 'drag_get_selection', 'drag_motion', 
'drag_status', 'drop_finish', 'drop_reply', 'emi
t', 'emit_stop_by_name', 'finish', 'freeze_notify', 'get_data', 
'get_properties', 'get_property', 'handler_block', 'hand
ler_block_by_func', 'handler_disconnect', 'handler_is_connected', 
'handler_unblock', 'handler_unblock_by_func', 'is_sour
ce', 'notify', 'props', 'protocol', 'set_data', 'set_icon_default', 
'set_icon_name', 'set_icon_pixbuf', 'set_icon_pixmap
', 'set_icon_stock', 'set_properties', 'set_property', 'source_window', 
'start_time', 'stop_emission', 'suggested_action
', 'targets', 'thaw_notify', 'weak_ref']
 >>> gtk.gtk_version
(2, 14, 7)
 >>> gtk.pygtk_version
(2, 12, 1)

I googled and saw a forum message from Feb 2007 along the same lines

 > since switching from pygtk-2.8 to pygtk-2.10, the method

>"get_source_widget" is not available for gtk.gdk.DragContext objects. Why is this?
>
> I'm using pygtk 2.10.3 together witn gtk-2.10.7 on windows 2000."


Can someone explain what I am doing wrong?

Steve



More information about the pygtk mailing list