Re: [gtkmm] editable cells



On Thu, 2003-01-16 at 12:45, Martin Wackenhut wrote:
> Ok,
> 
> here is the section in the documentation:
> http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08s02.html#id2843956
> look at: Implementing custom logic for editable cells.

Yes, and like it says you probably want to do something with the
CellRenderer.

> more precise:
> I read a data set. Herein the bool variable is set to 1.
> Lets say this is telling me that I already payed my electricity bill.
> 
> As I payed the gas bill today I want to set this flag to 1, too.
> So I want to click onto the editable cell containing this flag.
> As soon as I click there I also want a new calculation of the balance on
> my bank accout. If I unset the flag put the money back onto this account.
> 
> So for something like this I need to check if I clicked there or not.
> And if so I need to check what value the flag would be set to.
> It might be that setting this flag is forbidden for some weird reason.

So handle the CellRendererToggle's "toggled" signal:
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1CellRendererToggle.html#a8
And don't actually set that value in the model (or recalculate your
total, or whaever) if you don't want to.

See the implementation of append_column_editable() for some clues.

> I previously tried it with the changed signal.

The "changed" signal of what?

[snip] stuff that seems very wrong.

-- 
Murray Cumming
murray usa net
www.murrayc.com




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