[pygtk] DnD and resize
- From: Andre Lerche <a lerche gmx net>
- To: gtk-app-devel-list gnome org
- Subject: [pygtk] DnD and resize
- Date: Tue, 11 May 2004 20:09:46 +0200
Hi!
I've a bit of a problem while programming with pygtk and I'll try
to explain it with the following little sample application:
#!/usr/bin/env python
import pygtk
import gtk as g
class dragTest (g.Window):
def __init__(self):
g.Window.__init__(self)
self.set_size_request(100,100)
self.__motion=False
self.show()
target = [("text/uri-list", 0, 0)]
self.drag_dest_set(g.DEST_DEFAULT_ALL, target, g.gdk.ACTION_COPY)
self.connect("drag-motion", self.dragMotion, None)
self.connect("drag-leave", self.dragLeave, None)
self.connect("destroy", g.main_quit)
g.main()
def dragMotion (self, widget, context, x, y, time, data):
if not self.__motion:
self.__motion = True
self.set_size_request(300,300)
self.queue_draw()
while g.events_pending():
g.main_iteration()
print "Motion"
def dragLeave (self, widget, context, time, data):
print "Leave"
dragTest()
If I drag something over the window, the window gets resized to 300x300.
But if I move the "dragobject" out of the old 100x100 area, dragLeave
is called and dragMotion stops - why? Normally I thought that dragLeave
is called when I move the "dragobject" out of the 300x300 window or am
I wrong and/or miss some functions to announce the new window size?
It's pygtk 2.3.91 with Gtk 2.4.0
Thanks,
Andre
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]