Canvas mysterious segfault



Hi,

Trying to get started with Gnome::Canvas, I took a minimal subset out
of the canvas_demo program (see below). While the canvas_demo runs
without any problems, my simple program crashes with a segfault in the
line marked below.

Any suggestions? I must be overlooking something trivial.

Thanks,
Kasper


#include <gtkmm/main.h>
#include <gtkmm/button.h>
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <libgnomecanvasmm/canvas.h>
#include <libgnomecanvasmm/init.h>

class MainWin : public Gtk::Window {
		public:
		  MainWin();
};

MainWin::MainWin()
     {
     Gtk::VBox*   vbox1 = Gtk::manage(new Gtk::VBox(false, 4));
     add(*vbox1);
     Gtk::Button* button = Gtk::manage(new Gtk::Button());
     vbox1->pack_start(*button, Gtk::PACK_SHRINK);
     Gnome::Canvas::Canvas* canvas = Gtk::manage(new
           Gnome::Canvas::CanvasAA());  // Crash here!
     show_all();
     }

int main(int argc, char **argv)
     {
     Gnome::Canvas::init();
     Gtk::Main app(argc,argv);
     
     MainWin mainwin;
     app.run(mainwin);
     
     return 0;
     }




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