[gtkmm] TreeView selection changes



Hello again,

I made my first use of the Gtk::TreeView widget this week, and after
getting my head around all of the different classes, I've now got a
tree using a ListStore populated from a database.  The TreeView
tutorial chapter was immensely useful here, so I'd like to thank the
authors for their sterling work.

The interface contains three buttons: Add, Properties and Remove to
manipulate the rows of the list (and also the underlying PostgreSQL
database).  After each change to the database, I clear the ListStore
and re-load the data.  Depending on whether there is a selected row in
the TreeView, I have some of the buttons set insensitive.  In order to
keep them in the correct state, I attached a handler to the
signal_changed() signal of the Selection.  This works, but... when I
call Gtk::ListStore::clear() to clear the list, the Selection doesn't
emit a "changed" signal, even though its selection has been lost...
What is the best way to deal with this?

Another issue is reloading the data in the list.  What is the best way
to prevent the TreeView redrawing until I've finished populating the
ListStore?  Can I disable signals somehow with gtkmm to achieve this?
Is there a standard way of doing this?


Many thanks for your help,
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



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