Re: CellRendererSpinButton in a List

On Mar 6, 2006, at 12:34 PM, zentara wrote:

On Sun, 5 Mar 2006 22:35:54 -0500
muppet <scott asofyet org> wrote:

You've answered your own question ---- add code to your START_EDITING
to hook up a handler to the new editable's "focus-out-event" signal.

Yeah, I'm starting to play around with signals in the SpinCellRenderer
and am getting results.
But I still cannot alter the text which appears in the column after
the Spin Button disaappears. I can get the value which I want to set there,
but I can't get it in.

After seeing the code you sent out in the CellRendererSpinButtonZ thread, it appears that you were leaving out the model in the model- view-controller setup.

You were using a global variable to store the value for editing, and to update it for later. This looks like you were controlling what value shows up in the cell renderer, but not what was actually in the model.

The idea of the cell editor is not that it directly manipulates the model. The model holds the data. The view displays the data. The cell renderer does the actual drawing of the data. The cell renderer lets you start editing, but that editing is merely a service to get input, which the aggregating layer (main program, application code, or whatever layer set up the whole treeview) responds to by altering the model.

That is, the cell emits the "edited" signal to let other code update the model. The cell should not alter the model.

Is there a way I can keep the spincell widget displayed constantly?
That would be preferable for me anyways, I like seeing that widget
sitting there.

I think that's a different beast. From what i understand, the TreeView is set up to expect one cell to be edited at a time. Having a whole bunch of editor widgets up in a treeview would be more like a spreadsheet widget than a treeview.

You could write your own RENDER that draws the cell with decorations that look like a SpinButton if you really like the look of it.

In some newer operating systems, time_t has been widened to 64 bits. In the negative direction, this goes back more than twenty times the age of the universe, and so suffices. In the positive direction, whether this range is sufficient to represent all possible times depends on the ultimate fate of the universe, but it can be expected to postpone overflow long enough for such implementation limits to be abolished.
  -- Wikipedia, on UNIX time.

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