Selecting Matching Selectors when Objects are Selected

This post explains selection of treeview rows when objects belonging to that selector row are selected.

First, the objects in the desktop selection are obtained. Next the treeview’s rows are iterated and each row’s column _colObj is obtained as:
std::vector<spobject *> objVec = row[_mColumns._colObj];

The selected object’s ID is compared with each object’s ID in objVec. If the comparison returns true, then the row whose objVec had matching objects is added to treeview selection as:
_treeView.get_selection()->select(row);

By default, only the parent rows are iterated. So a check is also performed on child rows to see if IDs match with them. Also if there is a prior selection and the current object selected does not belong to any selector, then the treeview selection is cleared using _unselect_all() function of Gtk::TreeSelection.

Screenshot from 2016-07-27 13:50:02
In the above screenshot, the object associated with second child row is selected which in turn selects the row in treeview.

Leave a Reply

Follow

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: