RE: renderer_text == editable



Selection mode is GTK_SELECTION_MULTIPLE.
Now several questions:
- Is there a way to let gtk handle all the selection stuff before
  my button-press callback is called? g_signal_connect_after() seems
  to skip my function, so i do all the selection stuff in the callback
  manually before creating the popup menu.

Have a look at
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeSelection.html#gtk-tree-se
lection-set-select-function ?  There is also the "changed" signal for the
GtkTreeSelection (which I would advise you try first).

The only question is does the selection change event occur before or after
the "button_press_event"? If this occurs AFTER, I would siggest looking at
emitting "button_press_event" signal manually once you have dealt with a
selection change and perhaps blocking that signal before you are ready to
emit it.  This is what I would attempt, I do not know if it will work!

- What is the standard way of selecting when right clicking a row?
  Should this row be selected and all others deselected 
before creating
  the menu? Or should the selection be modified according to the key
  modifiers? What is a good GUI expected to do?

This depends on the application.  Generally I would say, if you look at a
Windows program, with a SINGLE selection method, the selection is changed
and the right click applies to the item your mouse cursor is above.  If it
is a MULTIPLE selection, then (i think) the selection is not changed and the
right click applies to those ALREADY selected.

- If i double click a row then i call the open_file() function, but
  unfortunately also the cell is edited by gtk, how to prevent this?

Yes I too have experienced this, I had to choose one or the other because no
solution became apparant to me.  I believe there are plans to look at this
on the development side of the GtkTreeView.

The only viable solution if you were to attempt it (IMO), would be to have a
function on the "button_press_event" which looks at the single click and
monitors the time between that and another single click.  If the time is
close enough, emit a signal to start the editing process.  If not, you do
nothing.  This would allow double click and the standard selection process.

Regards,
Martyn



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