Re: [gtkmm] I've got a lot of segfaults in combination with Dialogs



I think i've localized the problem, the segfaults only appear when i've
added widgets to the "widgetarea". When i've done this and execute the
program, i'll get the following warning every time i close the dialog. (
its no error! only a warning in the terminal from where i started the
application )

(dialogtest:21152): Gtk-CRITICAL **: file gtkcontainer.c: line 878
(gtk_container_remove): assertion `GTK_IS_CONTAINER (container)' failed

I'll get this warning for every widget i've attached to the Dialog, so
in the source example i've included in this message it happens two times
( a label and a entry ) each time you close the dialog.

When i close the dialog ( it doesn't matter if you use OK or CANCEL )
the segfault occurs. sometimes the first time, sometimes the 10th, but
it *will* segfault.

As i've built all mij Dialogs this way i hope someone knows how to solve
this, so i can fix my application.

bart



On Fri, 2002-10-04 at 16:24, Bart Hakvoort wrote:
> Ok, i'll try to post some clear code
> 
> bart
> 
> On Fri, 2002-10-04 at 16:15, Manuel Clos wrote:
> > Bart Hakvoort wrote:
> > > On the moment, i've got a few Dialogboxes in my app, but they segfault
> > > *very* often. Is this due to the fact that gtkmm-1.3.23 is still
> > > unstable? or am i doing something wrong?
> > 
> > Hi, I'm also using gtkmm-1.3.23 and Gtk::Dialog without any problem.
> > 
> > Post some of the code you are getting problems with if you want more help.
> > 
> > Also, try to write a simple example that makes clear that Gtk::Dialog is 
> > broken.
> > 
> > see you.
> > 
> > -- 
> > Manuel Clos
> > llanero eresmas net
> > 
> > TCPA y Palladium: http://bulmalug.net/body.phtml?nIdNoticia=1398
> > TCPA and Palladium: http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html
> > 
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list





#include <gtkmm.h>

class TestDialog : public Gtk::Dialog
{
protected:
	Gtk::Label lblKaartToevoegen;
	Gtk::Entry txtKaartToevoegen;
	Gtk::VBox vbox1;	
	
public:
TestDialog()
{
	lblKaartToevoegen.set_label( "Geef de naam van de nieuwe kaart" );
	get_vbox()->pack_start( vbox1 );
	vbox1.pack_start( lblKaartToevoegen );
	vbox1.pack_start( txtKaartToevoegen );
	
	add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	add_button("Voeg kaart toe", Gtk::RESPONSE_OK);
	
	
	show_all();
}

};

class TestScreen : public Gtk::Window
{
protected:
Gtk::Button btn;

public:
TestScreen()
{
	resize( 150,150 );
	
	btn.set_label( "DialogBox" );
	btn.signal_clicked().connect( SigC::slot(*this, &TestScreen::btn_clicked) );
	add(btn);
	
	show_all();
}

void btn_clicked()
{
	TestDialog td;
	td.run();
}

};

int main( int argc, char * argv[] )
{
	Gtk::Main kit( argc, argv );
	
	TestScreen ts;
	kit.run( ts );
}


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