Re: Selectively trapping keypresses

On Apr 14, 2007, at 8:39 AM, Jeffrey Ratcliffe wrote:

On 13/04/07, Jeffrey Ratcliffe <jeffrey ratcliffe gmail com> wrote:
How do I check whether a Gtk2::Ex::Simple::List is being edited (when
selectively trapping keypresses)?

a. When the user presses enter, save the new data to a file

I'm being dim (serves me right for coding when I should be in bed).

row-changed will give me that.

I still can't see how to check whether a Gtk2::Ex::Simple::List is
being edited. Does it has something to do with custom cell renderers?

In order to get that sort of stuff to work, you have to use the TreeView API.

The user does not edit a TreeView (which is what a SimpleList is). The user edits cells.

Basically, when the user activates an editable cell, the tree view tells the cell to start editing itself. At this point the cell creates an editable that the tree view puts in the right spot. The user does stuff and then "ends" the editing somehow. Generally, it is up to your code to catch the "editing-done" signal and make appropriate changes to the model.

SimpleList does some work for you to apply automatically a user's changes.

To modify the behavior of SimpleList's editing controls, you'll basically have to create a custom column type, and handle the editing behavior all for yourself.

There are other discussions on this list about how to make all that work, and several cell editing examples available.

Does that answer your question?

It's all very complicated and would take a scientist to explain it.
  -- MST3K

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