Re: Possible bug in gtk when using textview



Martyn Russell schrieb:

Oliver Rauch wrote:

Hello.

I have a problem with textview:

When I run the attached test program
(compile with "gcc  `pkg-config --cflags --libs gtk+-2.0` textview.c")
and do:
- select a part of the text with the mouse
- press the close or the window-destroy button

then the program crashes with a segmentation fault.

Just an observation, shouldnt your delete_event callback be defined as:
gboolean on_main_delete_event(GtkWidget *widget, GdkEvent *event,
gpointer user_data);

Plus, if you return FALSE from this callback, gtk assumes you dont want
to delete the widget.  I am not sure what it defaults to if you dont
return a value: perhaps this is part of the problem? - just a thought.

Yes, you are right, it should be a gboolean and the widget
should not be deleted in the event, but that does not change anything.
The delete_callback only is called when you press the delete button
of the window manager, it is not called when you press the close
button or destroy the widget.



Plus - if I had to guess, I would say it might be crashing because you
havn't referenced the object

I do not see a reason to reference any objects here.

Bye
Oliver



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