Re: [gtkmm] TreeView and callbacks



Again with this approach I am running into problems..

I have a treeview with a CellRendererPixbuf, and a CellRendererText as
the column renderes. If I try to set the on signal_button_press event
handler with this:
m_TreeView.signal_button_press_event().connect(SigC::slot(*this,
&ProjectView::on_cell_button_press_event));

The handler is not called at all.

If I change the word press to release...:
m_TreeView.signal_button_press_event().connect(SigC::slot(*this,
&ProjectView::on_cell_button_press_event));

The signal handler is called, however I do not know if a double click
had happened so this will not work for me, I am giving it as an example
that something strange is happening.

If I try to hook up to signal_row_activated the call back will only be
called IF you double click on the cell with the Pixbuff renderer, and
will not do anything when double clicking on the text renderer cell.

below is the setup code for the callbacks:
m_TreeView.set_events(m_TreeView.get_events() | Gdk::BUTTON_PRESS_MASK);

	m_TreeView.signal_button_press_event().connect(SigC::slot(*this,
&ProjectView::on_cell_button_press_event));
	m_TreeView.signal_row_activated().connect(SigC::slot(*this,&ProjectView::on_row_activated));


The callabcks in question simply print if they were called.

I would appreciate any help anyone could give me on this matter

Steve

On Fri, 2002-08-02 at 09:42, Murray Cumming wrote:
> On Fri, 2002-08-02 at 13:43, Steve Przepiora wrote:
> > Hello Daniel,
> >         No I wish to catch a double click..
> 
> Then you probably want to catch the TreeView "activated signal. That is
> fired on double-click or spacebar.
> 
> -- 
> Murray Cumming
> murrayc usa net
> www.murrayc.com
> 
> 





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