Re: GtkTreeView "activate" signal patch



On fre, 16 mar 2001 18:31:48 jrb redhat com wrote:
> > Looks like GtkBinding only takes signals as arguments
> > but this leads to an problem because I need to check
> > if there is an item selected before the "activate" signal is 
> > emited?
> 
> It's even more complicated then that, as you need to consider cells like
> toggle buttons that can be activated on their own (see
> tests/testtreefocus.c as an example of such an application).  Anyway,
> I'll add the button click case here in the short term so you can start
> using it, and we can add the keyboard activation later.
> 

I don't think we should add the patch if were not sure it's the right
solution :-)

If I'm correct tree_view don't now what type of cell that is
clicked/focused right?

One solution is to add two new gtkcellrenderer class functions:

  void (* key_press_event)   (GtkCellRenderer     *cell, GdkEventButton *)
  void (* button_press_event)   (GtkCellRenderer     *cell, GdkEventButton
*)

... and pass the tree_view-> key_press_event/button_press_event to the cell
renderer
to check what todo.

eg:

gint
cell_render_button_press(GtkCellRenderer *cell, GtkTreeView *tview,
GdkEvent)
{
  do_the_test_to_check_if_its_ok_to_emit_the_signal()

  g_signal_emit(tree_view, "row_activated");
}

This is also good to use for the checkbox/editable cells etc.

> > Is this patch ok to submit?
> 
> Of course it's okay to submit. (-: I'll read through it and apply it,
> though...

The patch I sent to the list is broken. I forgot to store the
tree_view_signal[ACTIVATE]  id :-/

My new "local" patch also seems to be broken (sometimes coredumps on
doubleclick).

It seems like the gtk_tree_view_button_press function needs
some cleanups before we inserts more stuff to it :-) 

Greets

M.H.




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