Re: [gtkmm] ImageLoader



It segfaults at 
	const Glib::RefPtr<Gdk::Pixmap> pixmap = 
> 		Gdk::Pixmap::create_from_xpm(drawable, mask, transparent, fname);
drawable's value is 0, my class is derived from Gtk::Container, instance is add-ed to 
the main window before I call this code... 

why does it segfaults ?

thx...

morti


> On Thu, 2002-12-26 at 03:31, Claude Vaillancourt wrote:
> > Assuming you're inside a Gtk::Widget derived class
> > (from the wheelbarrow.cc example in the gtkmm/examples/window directory)
> > {
> > 	const std::string &fname = "picture.xpm";
> > 	const Glib::RefPtr<const Gdk::Drawable> drawable = get_window();
> > 	const Gdk::Color transparent =
> > 		Gtk::Widget::get_default_style()->get_bg(Gtk::STATE_NORMAL);
> > 	Glib::RefPtr<Gdk::Bitmap> mask;
> > 	const Glib::RefPtr<Gdk::Pixmap> pixmap = 
> > 		Gdk::Pixmap::create_from_xpm(drawable, mask, 			transparent, fname);
> > }
> > 
> > 
> > > Other question: it always waits const std:string& does this mean I can not dynamically set a file's name ?
> > > Am not totally lamer just new in gtkmm.
> > > 
> > You can certainly pass a regular std::string, this 'const' only means
> > that the method will not modify it.
> > 
> > > thx
> > > morti
> > > 
> > 
> > 
> > 
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
Mortella <mortella freestart hu>




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