Re: toolbuttons and icons



On Sat, 2005-02-12 at 14:39 -0500, Philippe Leroux wrote:
> Hy there,
> 
> i'm converting an app from gtkmm 2.2 to 2.4
> 
> i can't get icons to work in toolbuttons
>  
> currently i have the following (after having a look at how glade creates
> the code)

I guess you mean glademm. glademm has its own mailing list.

> 
> Glib::RefPtr<Gdk::PixbufLoader>_toolbutton_img=Gdk::PixbufLoader::create(std::string("../icons/sphere.svg"),false);
> Gtk::Image *toolbutton_img = Gtk::manage(new class
> Gtk::Image(_toolbutton_img->get_pixbuf()));
>    _toolbutton_img=Glib::RefPtr<Gdk::PixbufLoader>();
> Gtk::ToolButton* toolbuttontmp = Gtk::manage(new class
> 		Gtk::ToolButton(*toolbutton_img,iM->Name)

Surely you can break that down to discover where the problem is.

I recommend the UIManager in 2.4 anyway:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch10.html
		
				
> executing the program leads to 
> 
> terminate called after throwing an instance of 'std::logic_error'
>   what():  basic_string::_S_construct NULL not valid
> Aborted
> 
> the Gtk::Image(image_file) leads to the same error
> 
> I presume i'mn missing something but couldn't figure what
> 
> it used to work fine with the provided functions in gtkmm 2.2 
> 
> isn't there a function like for the button widget
> 	button.add_pixlabel(pixmap_file, "label");
> I couldn't find anything in the documentation
> 
> Thanks in advance
> 
> Philippe L.
> 
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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