Re: GtkListStore with None values




Hi Martin,

Em 20-03-2012 08:27, Martin Pitt escreveu:
(...)

This is a consequence of fixing
https://bugzilla.gnome.org/show_bug.cgi?id=671610 .

You cannot really put "NULL"/None values into a tree model for many
data types; Gtk silently puts in the default value for that data type
if you pass None (e. g. 0 for int).

So in C programs you'd get the same bug.

However, I realize that we can actually improve this to restore the
previous behaviour that cells which have a None value in the passed
row list just don't get set at all. Would you mind filing a bug about
it?

Not at all! :)

https://bugzilla.gnome.org/show_bug.cgi?id=672463

(...)

It does, it just complains about them instead of silently ignoring
them. In many cases that's actually better I think, but in the
interest of avoiding console spam we could restore the silent
behavioud, as I said above.

(...)

You can just put the actual default value there instead of None.

The problem is that, in the case of foreground/background colors,
I think None *is* the default value, meaning "use whatever you
would use if I don't specify a color".

In the case of a combobox, it means "use the menu colors when
opened and button colors when closed". So it's more complex than
simply setting a color because the color varies according to
whether the combobox is open or not, or if its menuitem is
selected.

Plus, I don't even know what those colors are unless I introspect
the menu and button StyleContexts, which implies connecting to
theme changes if I want to keep them updated...

Marcelo


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