Re: [gtkmm] Gtk::CTree and pixmaps
- From: Daniel <dss home se>
- To: Thomas Adams <thomas adams onlinehome de>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] Gtk::CTree and pixmaps
- Date: Sat, 21 Sep 2002 13:42:58 +0200
Hello
In gtkmm-1.2 you can use the imageloader class to display pixmaps in a CList. Search for imageloader in the header-files or have a look at jagsnetworkslistview.cc in my program jagsmm (http://jags.sf.net) for an example. I am not sure of the exact filename but if you search the source for imageloader i think you will find something.
However, I think you should consider upgrading to gtkmm2 unless you're forced to use gtkmm-1.2 for some reason. It will be an improvement!!!
/Daniel
On Sat, 21 Sep 2002 12:49:43 +0200
Thomas Adams <thomas adams onlinehome de> wrote:
> Hello list,
>
> I'm a newbie to gtk+ and gtkmm. I want to display
> pixmaps within a CTree object instead of plus and minus.
>
> I have tried following code, but this does not work, and I
> cannot figured out why:
>
> CTree *m_tree=new CTree(titles,0);
> //creating pixmap from file
>
> pixmapSelectedNode=manage(new class Gtk::Pixmap( folder_t_xpm));
> pixmapUnselectedNode=manage(new class Gtk::Pixmap(mini_ofolder_xpm));
>
> //getting necessary information
> Gdk_Pixmap gdk_selected;
> Gdk_Bitmap gdk_selected_mask;
> pixmapSelectedNode->get(gdk_selected,gdk_selected_mask);
>
> Gdk_Pixmap gdk_unselected;
> Gdk_Bitmap gdk_unselected_mask;
> pixmapUnselectedNode->get(gdk_unselected,gdk_unselected_mask);
>
> //setting und Node-Element of CTree
> vector<string> item;
> item.push_back("column0");
> item.push_back("column1");
>
> //adding it to CTree
> m_tree->rows().push_back(Element(item,gdk_unselected,gdk_unselected_mask,gdk_selected,gdk_unselected_mask));
>
> Compiling works without errors, but the pixmaps aren't displayed
> at runtime, only the plus and minus is been displayed
>
> Does anybody has an idea, or can provide me with short example?
>
> Thanks in advance
>
> Thomas Adams
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]