Re: rubberbanding with GTK1* and GTK2*
- From: Gerald Emig <gme epr80 de>
- To: gtk-app-devel-list gnome org
- Subject: Re: rubberbanding with GTK1* and GTK2*
- Date: Fri, 25 Feb 2005 14:36:33 +0100
On Fri, 25 Feb 2005 13:42:48 +0100
Carlo Agrusti <carlo-ag libero it> wrote:
kees ha scritto lo scorso 25/02/2005 12:45:
Can anyone explain to me why the very small program beneath,
demonstrating a very basic form of rubberbanding, works excellent
while compiled with GTK1* but does not work correctly when compiled
with GTK2*.
[..]
gint drawareacb(GtkWidget *widget, GdkEventButton *event, gpointer
data)
{
gint x0, y0;
gint x[2], y[2];
if(ii == 0)
{
cleararea(drawing_area);
ii=1;
}
gdk_window_get_pointer(drawing_area->window, &x0, &y0, NULL);
switch(event->type)
{
case GDK_BUTTON_PRESS:
x[0]=x0;
y[0]=y0;
gdk_draw_line(drawing_area->window, gc, 200, 400, x0, y0);
break;
case GDK_MOTION_NOTIFY:
x[1]=x0;
y[1]=y0;
gdk_draw_line(drawing_area->window, gc, 200, 400, x[0], y[0]);
^^^^^^^^^^
gdb gives:
x[0] = 1048
y[0] = -1073751042
That is the point: x[0], y[0] are probably uninitialized here...
gdk_draw_line(drawing_area->window, gc, 200, 400, x[1], y[1]);
x[0]=x[1];
y[0]=y[1];
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gerald Emig
--
EMIG Software, Engelstr. 17, D-66564 Ottweiler, Germany
Tel.+49(0)6858-699567, Fax.699568, gme emig-software de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]