gnome_canvas_w2c_d (GNOME_CANVAS (dwidget->home_canvas),
event->button.x,
event->button.y, &cx, &cy);
switch (event->type)
{
case GDK_BUTTON_PRESS:
switch (event->button.button)
{
case 1:
/* grab the widget */
x = event->button.x;
y = event->button.y;
cursor = gdk_cursor_new (GDK_FLEUR);
retval = gdk_pointer_grab (GTK_WIDGET
(dwidget)->window,
FALSE,
GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
NULL,
cursor,
event->button.time);
if (!retval)
dragging = TRUE;
gdk_cursor_destroy (cursor);
break;
case 2:
break;
default:
break;
}
break;
case GDK_MOTION_NOTIFY:
if (dragging && (event->motion.state
& GDK_BUTTON1_MASK)) {
gnome_canvas_item_move (dwidget->this_item,
event->button.x -
x,
event->button.y -
y);
x = event->button.x;
y = event->button.y;
}
break;
case GDK_BUTTON_RELEASE:
if (gdk_pointer_is_grabbed ()) {
gdk_pointer_ungrab (event->button.time);
dwidget->xpos = event->button.x;
dwidget->ypos = event->button.y;
dbs_widget_save (dwidget);
}
dragging = FALSE;
break;
default:
break;
}
best regards,
Thomas Morris.
begin:vcard n:Morris;Thomas tel;cell:+49 177 2857370 tel;fax:+49 631 3504738 tel;home:+49 631 3504736 tel;work:+49 631 3504736 x-mozilla-html:FALSE url:www.linuxpro.org/thomas adr:;;;;;; version:2.1 email;internet:Thomas@linuxpro.org x-mozilla-cpt:;24960 fn:Thomas Morris end:vcard