[Gtk-sharp-list] Using ListViews/TreeViews in Gtk#?

Charles-Louis charlouis.mono@wanadoo.be
05 Mar 2003 17:16:18 +0100


Thanks, it works!

Le mer 05/03/2003 à 16:13, Lee Mallabone a écrit :
> On Wed, 2003-03-05 at 15:05, Charles-Louis wrote:
> > Do I have to add the TreeStore manually into the Glade XML file?
> 
> No, the Glade XML file is purely for the user interface, nothing to do
> with your model.
> 
> > I think the problem is coupled to the fact that I have the instruction
> > 
> > TreeView tv = new TreeView(myStore)
> > 	--> maybe Glade did already create the TreeView, but did not attach it
> > to the store, so the 'new' TreeView was not added to the window?
> 
> If you've named your treeview in glade as 'myTreeView' then you can do the following:
> 
> Glade.XML xml = new Glade.XML(..... you've done this already);
> 
> TreeView myTV = xml.GetWidget("myTreeView") as TreeView;
--> I forgot to initialize my component... ;-)

> myTV.Model = myStore;
> 
> There are nicer ways to do this using the [GladeWidget] attribute, but in the interests of getting up and running quickly, the above will hopefully put you on the right path.
> 
> Hope that helps,
> 
> Lee.
> 
-- 
Charles-Louis <charlouis.mono@wanadoo.be>