Re: Diabling an entry in TreeView

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

 



Pramod Patangay wrote:

Hi,

I have a treestore and corresponding model and treeview. I would like
to disable a particular entry in the treeview. How can I do this?

If you have access to source codes you may look at gtkcellrenderertext.c file for function: gtk_cell_renderer_text_render(). There you should see that "state = GTK_STATE_INSENSITIVE" is what you are looking for. I guess, the simplest way is to code your CellRenderer derived from GtkCellRendererText, and reimplement function render, so, it should look at some CellRenderer::property and decide what state should be set for current cell. Actually, you only need to reset "render" function for GtkCellRedndererClass this way:

static void my_gtk_cell_renderer_text_render(...)
{
...
}

some_function()
{
...
GtkCellRenderer *text_render = gtk_cell_renderer_text_new();
GtkCellRendererClass *render_class = GTK_CELL_RENDERER_GET_CLASS( text_render );
render_class->render = my_gtk_cell_renderer_text_render;
...
}

Regards,
-andrew

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux