Re: Gtk::IconView & selected icon



Gtk::TreeModel::Row row = *(treemodel->get_iter(select[0]));

Jason

Jason Burchfield wrote:

try

void XDirectory::onSelection() {
    vector<Gtk::TreeModel::Path> select = get_selected_items();
    Gtk::TreeModel::Row row = treemodel->get_iter(select[0]);
}

Jason


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



--
Jason Burchfield
CAS, Inc.
(256) 971-6096
Jason.Burchfield at cas-inc dot com




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