ListStore iteration
- From: "Amadeus W. M." <amadeus84 verizon net>
- To: gtkmm-list gnome org
- Subject: ListStore iteration
- Date: Thu, 05 Oct 2006 23:51:41 -0400
I have an application consisting of a DrawingArea, with a ListStore next
to it, in which I display the names of some image files, to be displayed
in the DrawingArea. I can select an image from the list, read it from disk
into a pixbuf and display it into the drawing area just fine.
What I want to do is to loop through all the images upon the click of a
button. I know how to do that too, but the images don't get displayed one
by one in the drawing area, as the iterator advances. This is how I'm
doing this:
void MainWindow::on_SaveAllButton_clicked()
{
// Members:
// class Gtk::TreeView * ItemSelector;
// Glib::RefPtr<Gtk::ListStore> SelStore_;
// Gtk::DrawingArea Darea1;
// Get a pointer to selection.
Glib::RefPtr<Gtk::TreeSelection> Selection_=ItemSelector->get_selection();
// Get the rows.
Gtk::TreeModel::Children rows=SelStore_->children();
Gtk::TreeModel::iterator r;
for(r=rows.begin(); r!=rows.end(); r++){
// Doesn't seem necessary.
Gtk::TreeModel::Row row=*r;
// Load and DISPLAY the pixbuf, upon select().
Selection_->select(row);
// do something to the image.
}
}
What am I doing wrong that the images don't get displayed? Thanks!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]