[Gtk-sharp-list] How to highlight the first

Wolfgang Mauer W.Mauer at top-soft.info
Tue Jul 4 01:41:37 EDT 2006


Hi,
i use this to select the first line

this.treeview.SetCursor(new Gtk.TreePath("0"), this.treeview.Columns[0], 
false);

/Wolfgang

>Am Dienstag, 4. Juli 2006 05:12 schrieb Julien Sobrier:
> Brad Taylor wrote:
> > Hey,
> >
> >> I'm trying to highlight the first row of a TreeView. I tried several
> >> variations around this ode, but none of them has any effect:
> >
> > Probably the best way to do this is the following:
> >
> > TreeIter iter;
> > if (your_model.GetIterFirst (out iter)) {
> > 	your_treeview.Selection.SelectIter (iter);
> > }
> >
> > This allows for the case when there is no first iter (empty model).  It
> > will also work in the TreeStore and ListStore case.
> >
> > Hope this helps.
> >
> > -Brad
>
> Thank you
> I don't see any row highlighted. I've checked that the treeview is not
> empty when I use the code:
> log4net.Info("number of rows highlighted: " +
> this.Selection.CountSelectedRows() -> 1
> this.Model.IterNChildren() -> 3
>
> If I click on the first item, or if I push the bottom arrow key, then
> the first row is highlighted.
>
> I've also tried to highlight all the rows:
> this.Selection.Mode = SelectionMode.Multiple;
> this.Selection.SelectAll();
>
> The value of this.Selection.CountSelectedRows() is 3, but I still don't
> see any highlight!
>
> Julien
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list


More information about the Gtk-sharp-list mailing list