Kouhei Sutou wrote:
yup, i found that script, and inspected it, and it's great, but not
what i wanted to do.
I suggest you that you show a sample script that describes
what you want if you'll save our time to understand what you
"Re: [ruby-gnome2-devel-en] Gtk::Drag.source_set produces [BUG] Segmentation fault" on Thu, 25 Jan 2007 16:36:29 +0200,
Dobai-Pataky_Bálint <email@example.com> wrote:
You don't need to use Gtk::Drag for this. See
sample/misc/drag-move.rb in Ruby/GTK2.
yeah, after i sent this mail, i have found the examples, and understood them.
but they are not the right solution for me, what i want to do is to have a
fixed or a layout and some labels on it, and allow the user to move the labels
with the mouse.
I think the example shows a hint for what you want to do...
Anyway, what about sample/misc/dnd.rb?
for some reasons:
* does not move the widget while dragging, only an icon for it - i need
the object to be visible, since it's going to be sort of a wysiwyg
print layout editor with mysql backend
* as far as i understood and item has to receive the drop - i got only
1 layout as source and destination
* i need exact pixel coordinates of the drop
the current state of my Layout class is:
* it has a subclass showing a Label
* the Label can be moved on the Layout by the following steps:
on click Label is replaced by a recrangle
on move the rectangle is redrawn in the new position
on release the rectangle is cleared and the label is positioned at
the new coordinates and is shown
i currently have 2 problems with it:
* i clear the old rectangle in the move event by redrawing it with
white(i wanted background, but could not acquire it), so the rectangle
leaves it's white path on the theme'd gray background - i thought i
should fill the Drawable with white, but haven't found the filling
* i'll have to snap the rectangle in movement to a 10x10 pixel grid, so
Labels may be easily positioned on a line
if you have any ideas regarding, please don't hold them back :)