Re: Argh: DND madness




<adustman@comstar.net> writes:

> I'm using drag-n-drop in an app I'm working on, but it's been...
> troublesome.
> 
> First, I'm using the Python interface, so I modeled off of the dnd demo in
> testgtk.py. And in fact I now have it so I can drag from one button to
> another, delivering a nice MIME multipart/form-data. So what is the
> problem?
> 
> Initially, I was trying to drag a frame over to a button, instead of a
> button to a button. This seemed like it ought to work: The drag-n-drop
> properties are widget properties; frames and buttons are widgets; 
> therefore, it ought work, right? The signals connect up just fine to the
> frame, I start dragging and the cursor changes to... whatever, the drag
> thingy..., and when I get to the drop zone, it turns into a heart, and
> when I release the mouse button: nothing. But, I stick a button in that
> frame, connect it, etc. instead of the frame, then it works just fine. 
> 
> But I don't particularly want this button in my frame if I can avoid it
> (it presently contains a word which succinctly summarizes my frustration;
> feel free to imagine what it is); I'd rather just drag the frame, as I
> have a form of various data fields and the drop-n-drag is moving all the
> data. It just seems more intuitive. Eventually I want to drag from frame
> to frame.

Currently, DND drag sources and targets can't be NO_WINDOW widgets
like the Frame widget.

What you should do is put the Frame inside an EventBox and use
the EventBox as the drag source.

You may also have to call

 gtk_widget_set_events (event_box, GDK_BUTTON_PRESS_MASK);

to get it to recognize the start of the drag.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]