Re: [Gtk2forpascal-devel] Possible bug of gtk2forpascal?
Brought to you by:
mgaertner
From: Olaf L. <le...@ne...> - 2002-08-12 13:41:13
|
Hi Mili! I use something like that in my application: TGUI =3D record =20 window : PGtkWidget; (* Hauptfenster *) vbox : PGtkWidget; =20 da : PGtkWidget; (* Zeichenebene *) button : PGtkWidget; (* Knopf *) width : integer; (* breite der Zeichenebene *)=20 height : integer; (* H=F6he der Zeichenebene *) frame : PGdkPixbuf; (* berechnetes Bild *) pix : TBilder; (* Bildelemente *) timeout_id : gint; item_factory : PGtkItemFactory; toolbar : PGtkWidget; end; =20 PSimulation =3D ^TSimulation; TSimulation =3D record =20 next : PSimulation; (* n=E4chste Simulation *) ansicht : TAnsicht; (* Gr=F6=DFe des Feldes *) teilchen : PTeilchen; (* Liste der Teilchen *) zeit : TZeit; gui : TGUI; (* <-------- here is the gui *) end; I create a new instance of PSimulation using the new function and everything works well. The bug might be somewhere else. Perhaps you could send us a sample application that crashes on your system. Ciao, Olaf Am Mon, 2002-08-12 um 10.00 schrieb mili: Hello, Every One I found a possible bug of gtk2forpascal, but I don't know how to fix it. Let's create a new gtk widget: >>>> type PGtkMyWidget =3D ^TGtkMyWidget; ^TGtkMyWidget;=3D record hpaned : TGtkHPaned; tree_sw : PGtkScrolledWindow; tree_view : PGtkTreeView; text_sw : PGtkScrolledWindow; text_view : PGtkTextView; end;//TGtkMyWidget; <<<< What ever the other code about TGtkMyWidget is, it doesn't matter. Then new an instance of TGtkMyWidget, and put it in a window, put a button in the window, and connect the button's click signal to a callback function, in this function you try to access the text_view of TGtkMyWidget. Such as: gtk_text_view_set_editable(the_widget^.text_view,TRUE); Then the program crashes. I also find in many cases, some codes which attempt to access the member of a widget cause the program to crash. Perhaps the problem is the difference of C<--->Pascal programming and memory accessing. I don't know how to fix it. Can anyone find a solution? =20 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =C3=E2=B7=D1=D3=CA=CF=E4=BD=A1=BF=B5=C9=B1=B6=BE=B4=F3=D0=D0=B6=AF=A3= =A1 =D0=C4=B6=AF=B2=BB=C8=E7=D0=D0=B6=AF =B4=F3=BB=B0=CE=F7=D3=CE2.0=C3=E2= =B7=D1=B2=E2=CA=D4=D6=D0 =CD=F8=D2=D7=B7=C7=B3=A3=C4=D0=C5=AE =B4=AB=B5=DD=B6=CC=D0=C5=C7=E9=B8= =FC=C5=A8 =20 =20 |