Gtk::IconView & selected icon



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.




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