Re: treeview



On Tue, Jul 26, 2005, Juan Francisco González wrote:
> Hello, I have a tremodel with five columns. How can i connect a cell of the fifth column with a signal clicked or a signal activate and so catch user cell actions.
> 

You can connect the signal to the treeview, then use get_path_at_pos to
get which part of the tree was clicked given the click coordinates:

void YourClass::treeViewClicked( GdkEventButton * event ){
    Gtk::TreeModel::Path path;
    Gtk::TreeViewColumn * column;
    int cellx,celly;
    bool gotPath;

    gotPath = phoneBookTreeView->get_path_at_pos( (int)event->x,
    (int)event->y, path, column, cellx, celly );
}

You can then get the model iterator from the path with model->get_iter(
path );

Johan.




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