[Gtk-sharp-list] Disable TreeView Row

Wolfgang Mauer W.Mauer at top-soft.info
Sat Jan 17 09:33:49 EST 2009


Hi all,
yes it works.
and also it is usefull to implement a TreeCellDataFunc th make the entrys sensitive.

void tree_cell_data_func(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
{
	object x = tree_model.GetValue(iter, 0);
	if (null != x)
	{
		if (.......)
		{
			cell.Sensitive = false;
		}
		else
		{
			cell.Sensitive = true;
		}
		((CellRendererText)cell).Text = x.ToString();
	}
}

/
Wolfgang

> That works but the user will still be able to select the row using the keyboard.
> 
> Check out TreeSelection.SelectFunction. You can write a handler that returns true if the row is allowed to be selected, false otherwise.
> 
> --anthony
> ________________________________________
> From: gtk-sharp-list-bounces at lists.ximian.com [gtk-sharp-list-bounces at lists.ximian.com] On Behalf Of Christian Hergert [christian.hergert at gmail.com]
> Sent: Friday, January 16, 2009 11:45 AM
> To: Wolfgang Mauer
> Cc: gtk-sharp-list at lists.ximian.com
> Subject: Re: [Gtk-sharp-list] Disable TreeView Row
> 
> You could try catching the button-press event. Translate the events
> X/Y to get the path to the selected row
> (gtk_tree_view_get_path_at_pos). Then look up the data in the row to
> see if you wish to disable it. If so, make sure the events RetVal is
> true to stop further signal emission (thus stopping the treeview's
> internal handler from receiving the event).
> 
> -- Christian
> 
> On Fri, Jan 16, 2009 at 10:03 AM, Wolfgang Mauer <W.Mauer at top-soft.info> wrote:
> > Hi all,
> > is it possible to disable a single row(can't be selected) in a treeview?
> >
> > Thanks for Help
> > Wolfgang
> >
> >
> > --
> > Top-Soft
> > Softwareentwicklung
> > Inhaber: Wolfgang Mauer
> > Reitersweg 9, 96103 Hallstadt
> > Tel.: +49 (0)951 / 2221520
> > Fax: +49 (0)951 / 2221521
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 
> The information contained in this email may be confidential and/or may be covered under the Privacy Act, 5 USC 552(a), and/or the Health Insurance Portability and Accountability Act (PL 104-191) and its various implementing regulations and must be protected in accordance with those provisions.. It has been sent for the sole use of the intended recipient(s). If the reader of this message is not an intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and destroy all copies of the original message. To contact our email administrator directly, send to an email message to helpdesk at medsphere.com. Thank you.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 



-- 
Top-Soft
Softwareentwicklung
Inhaber: Wolfgang Mauer
Reitersweg 9, 96103 Hallstadt
Tel.: +49 (0)951 / 2221520
Fax: +49 (0)951 / 2221521


More information about the Gtk-sharp-list mailing list