Apparently the onclick event gets called with an itemindex of -1 every other time, even when you click on the item. I was then trying to access an object in the TListBox by the provided onclick itemindex.
For every click, I get to onclick event calls. The first one has itemindex of -1 and the second one has it set properly. Sorry for top posting - using web interface. On 5/7/2006, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I'm using a custom drawn TListBox. Every _other_ time I go to tab on my >form it's crashing with this error. It's not happening during my >painting of the TListBox though - it happens afterwards apparently. All >lines references are part of Lazarus and not my code, but I won't >immediately rule out a bug on my part. > >Any ideas of what to look for? > >Here's a backtrace: > > >ERROR in gtk-interface: TGtkListStringList.Get Out of bounds. >Creating gdb catchable error: > >Program received signal SIGFPE, Arithmetic exception. >0x0811e0e0 in RAISEEXCEPTION (MSG=0x8268528) at gtkproc.inc:540 >540 gtkproc.inc: No such file or directory. > in gtkproc.inc >Current language: auto; currently pascal >(gdb) bt full >#0 0x0811e0e0 in RAISEEXCEPTION (MSG=0x8268528) at gtkproc.inc:540 >No locals. >#1 0x080cdad0 in TGTKLISTSTRINGLIST__GETLISTITEM (INDEX=-1, >this=0xb7b46f14) > at gtklistsl.inc:697 > result = (PGTKLISTITEM) 0x0 > GETLISTITEM = (PGTKLISTITEM) 0x0 > RESULT = (PGTKLISTITEM) 0x0 >#2 0x080cd99a in TGTKLISTSTRINGLIST__GETOBJECT (INDEX=-1, >this=0xb7b46f14) > at gtklistsl.inc:659 > result = (^TOBJECT) 0x0 > LISTITEM = (PGTKLISTITEM) 0x816016d > GETOBJECT = (^TOBJECT) 0x0 > RESULT = (^TOBJECT) 0x0 >#3 0x0807a0b6 in TFRMMAIN__CATLISTCLICK (SENDER=0xb7b99248, >this=0xb7b816a8) > at unitmain.pas:940 > I = 138468192 > TEMPCAT = (^TCHKCATEGORY) 0x0 > CATNAME = (ANSISTRING) 0x0 > SUBCATNAME = (ANSISTRING) 0x0 > TEMPSTR = (ANSISTRING) 0x0 >#4 0x08110916 in TCONTROL__CLICK (this=0xb7b99248) at control.inc:1857 >No locals. >#5 0x0815fde0 in TCUSTOMLISTBOX__DOSELECTIONCHANGE (USER=true, > this=0xb7b99248) at customlistbox.inc:401 >No locals. >#6 0x0815f916 in TCUSTOMLISTBOX__LMSELCHANGE (THEMESSAGE=void, > this=0xb7b99248) at customlistbox.inc:239 >No locals. >#7 0x0805ce47 in SYSTEM_TOBJECT_$__DISPATCH$formal () >No symbol table info available. >#8 0x0811021e in TCONTROL__WNDPROC (THEMESSAGE= > {MSG = 564, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, >WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}, >this=0xb7b99248) > at control.inc:1534 > FORM = (^TCUSTOMFORM) 0x832cc60 >#9 0x08107bf9 in TWINCONTROL__WNDPROC (MESSAGE= > {MSG = 564, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, >WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}, >this=0xb7b99248) > at wincontrol.inc:3365 > FORM = (^TCUSTOMFORM) 0xbfec9e01 >#10 0x081248e5 in DELIVERMESSAGE (TARGET=0xb7b99248, AMESSAGE=void) > at gtkproc.inc:3469 > result = 38926 > DELIVERMESSAGE = 38926 > RESULT = 38926 >---Type <return> to continue, or q <return> to quit--- >#11 0x081302aa in GTKLISTBOXSELECTIONCHANGEDAFTER (WIDGET=0x83e90b8, > DATA=0xb7b99248) at gtkcallback.inc:3131 > result = true > MESS = {MSG = 564, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = >0, > WPARAMHI = 0, LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0} > GTKLISTBOXSELECTIONCHANGEDAFTER = true > RESULT = true >#12 0xb7dc87b3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#13 0xb7dfc2f5 in gtk_signal_connect_while_alive () > from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#14 0xb7dfd251 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#15 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#16 0xb7dc4457 in gtk_list_scroll_vertical () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#17 0xb7dc87b3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#18 0xb7dfc2f5 in gtk_signal_connect_while_alive () > from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#19 0xb7dfd3e3 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#20 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#21 0xb7db5fdf in gtk_item_deselect () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#22 0xb7dc54cb in gtk_list_item_deselect () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#23 0xb7dc42fd in gtk_list_scroll_vertical () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#24 0xb7dc87b3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#25 0xb7dfc2f5 in gtk_signal_connect_while_alive () > from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#26 0xb7dfd3e3 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#27 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#28 0xb7db5f8f in gtk_item_select () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#29 0xb7dc54a8 in gtk_list_item_select () from /usr/lib/libgtk-1.2.so.0 >---Type <return> to continue, or q <return> to quit--- >No symbol table info available. >#30 0xb7dc2fa4 in gtk_list_undo_selection () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#31 0xb7dc8664 in gtk_marshal_NONE__POINTER () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#32 0xb7dfd336 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#33 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#34 0xb7dbf590 in gtk_list_select_child () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#35 0xb7dc0af0 in gtk_list_set_selection_mode () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#36 0xb7dc8664 in gtk_marshal_NONE__POINTER () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#37 0xb7dfd336 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#38 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#39 0xb7d7fb9c in gtk_container_set_focus_child () > from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#40 0xb7e38d3e in gtk_widget_intersect () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#41 0xb7dc87b3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#42 0xb7dfd419 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#43 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#44 0xb7e34fcc in gtk_widget_grab_focus () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#45 0xb7dc5e8e in gtk_list_item_deselect () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#46 0xb7dc8489 in gtk_marshal_BOOL__POINTER () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#47 0xb7dfd419 in gtk_signal_emit_stop_by_name () from >/usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#48 0xb7dfda59 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#49 0xb7e3c246 in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#50 0xb7dc7df0 in gtk_propagate_event () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#51 0xb7dc82c5 in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0 >---Type <return> to continue, or q <return> to quit--- >No symbol table info available. >#52 0xb7f66583 in gdk_event_get () from /usr/lib/libgdk-1.2.so.0 >No symbol table info available. >#53 0xb7f95681 in g_get_current_time () from /usr/lib/libglib-1.2.so.0 >No symbol table info available. >#54 0xb7f960f6 in g_main_add_poll () from /usr/lib/libglib-1.2.so.0 >No symbol table info available. >#55 0xb7dc6ea0 in gtk_main_iteration_do () from /usr/lib/libgtk-1.2.so.0 >No symbol table info available. >#56 0x080d2166 in TGTKWIDGETSET__APPWAITMESSAGE (this=0xb7b1e014) > at gtkobject.inc:1798 >No locals. >#57 0x0807325f in TAPPLICATION__IDLE (WAIT=true, this=0xb7b26014) > at application.inc:282 > DONE = true >#58 0x0807472d in TAPPLICATION__HANDLEMESSAGE (this=0xb7b26014) > at application.inc:912 >No locals. >#59 0x08074aa0 in RUNMESSAGE (parentfp=0xbfecbbe0) at application.inc:1029 >No locals. >#60 0x080749eb in TAPPLICATION__RUNLOOP (this=0xb7b26014) > at application.inc:1039 >No locals. >#61 0x0807c4bf in TWIDGETSET__APPRUN (ALOOP=0x80749ac ><TAPPLICATION__RUNLOOP>, > this=0xb7b1e014) at interfacebase.inc:42 >No locals. >#62 0x08074998 in TAPPLICATION__RUN (this=0xb7b26014) at >application.inc:1018 >No locals. >#63 0x08053655 in main () at cbt2.lpr:13 >No locals. >(gdb) > >_________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives