Re: 3000 toggle buttons in a table?
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Sailaxmi korada <sai korada xilinx com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: 3000 toggle buttons in a table?
- Date: Mon, 10 Apr 2006 19:05:13 +0200
You do not set the renderer "active" property anywhere
except in the toggle_cell callback. Therefore it always
renders *all* the cells in the last state (active or
inactive) some cell was toggled to. You need either a cell
data func or to use gtk_tree_view_column_new_with_attributes()
to tell the renderer in which state it should render the
cells. The "active" propery is not set in any automagic
way, *something* must set it before the cell is rendered.
It seems all my previous advices were vain too. The tree
model should have exactly two columns: G_TYPE_STRING (the
label) and G_TYPE_UINT16 (the value), and you should use
a cell data function to set renderer properties to display
the guint16 value once as toggles, once as hex, in different
columns.
In fact, everything that the code sample I sent needs to add
to do *exactly* what you want is s/64/16/g, a hex-value
column (in the view, *not* in the model) + its cell data
function + its "cell-edited" callback. Of course, I can
write the missing bits too -- it would be shorter than this
mail -- but that would not teach you fishing.
Please read the Gtk+ Tree View Tutorial to learn the
concepts first.
Yeti
--
That's enough.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]