[Gtk2forpascal-devel] =?gb2312?B?UG9zc2libGUgYnVnIG9mIGd0azJmb3JwYXNjYWw/?=
Brought to you by:
mgaertner
|
From: mili <mil...@16...> - 2002-08-12 08:01:50
|
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 = ^TGtkMyWidget;
^TGtkMyWidget;= 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?
|