Re: Gtk::IconView & selected icon



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It seems to me that you would want to get the selected row first using
Gtk::TreeSelection. The "get_selected()" will give you the iterator of
the selected row (or get_selected_rows() for multiple rows).

Olivier- wrote:
> Hi,
> I would like to get back the data of the selected icon, so I have a code
> like that :
> 
> //XDirectory inherits of Gtk::IconView
> XDirectory::XDirectory(.......)  {
> 	treemodel = Gtk::ListStore::create(column);
> 	set_model(treemodel);
> 	set_text_column(column.name);
> 	set_pixbuf_column(column.icon);
>         (...)
> 	signal_selection_changed().connect(sigc::mem_fun(*this,
> &XDirectory::onSelection));
> }
> 
> void XDirectory::onSelection() {
> 	Gtk::IconView::ArrayHandle_TreePaths select = get_selected_items();
> 	Gtk::TreeModel::iterator iter = treemodel->get_iter(*(select.begin()));
> 	Gtk::TreeModel::Row row = *iter;
> }
> 
> gdb seems to block on the second line of onSelection (... iter =
> treemodel->get_iter ...).
> I know I have only one item selected.
> --
> View this message in context: http://www.nabble.com/Gtk%3A%3AIconView-selected-icon-t1294205.html#a3444975
> Sent from the Gtkmm forum at Nabble.com.
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 

- --
R. Douglas Barbieri
doug dooglio net
http://www.dooglio.net

GPG Fingerprint: 3707 2A46 7DFC D673 FFB8  54B1 0EC9 5CF6 A1FC 6F11
GPG recv-key   : A1FC6F11
GPG Public key : http://www.dooglio.net/dooglio.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEGdeBDslc9qH8bxERAj30AJ4ryQ9IDDrpeBGWfuvctgnZ08z3bACgl2eF
xIKxDA3D0auHIQgtz+NPq2E=
=FAe4
-----END PGP SIGNATURE-----



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