Re: GTK: When 0 + 1 = 0



Ruben Safir Secretary NYLXS wrote:

When I run this through the debugger, it gets to the line:

len = pos + 1;

and it displays that pos is zero and len is zero.  In fact, it just swings through this code
completely out of order.  I have no idea what gtk_main is doing, but when I code len = pos +0 and pos is
zero, I expect len to be 1.

Also, it seems that the line 

 pos = gtk_editable_get_position(GTK_EDITABLE(widget));

returns a huge number.  I'm completely confused at this point.  There must be a reason that this behavior 
is 
happening, but I have no clue as to why.

I bet you are compiling with optimization.  If your program uses
Automake, try

        make -s clean
        make -s CFLAGS='-g'

and then debug.  If you use a custom Makefile, edit CFLAGS in it.

hope this helps
Paul



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