[Gtk-sharp-list] [Mono GTK#] Bind Class object to TreeView

jaymarvels jacob.spencer80 at googlemail.com
Thu Sep 19 11:06:11 UTC 2013


Alright..

I have got it to work..

I placed a fixed container widget down and then added the treeview to the
container widget..

For some reason it didn't like being added to a notebook page..

On a side note..

Any idea how to change the treeview header font size and/or set the column
widths?


On 19 September 2013 10:56, Alex Willmy [via Mono] <
ml-node+s1490590n4660917h37 at n4.nabble.com> wrote:

> Am 18.09.2013 17:41, schrieb jaymarvels:
>
>
> > I can't even make any headers appear when doing;
> >
> >
> > teamListView = new Gtk.TreeView ();
> > //add in cols
> > Gtk.TreeViewColumn fNamecol = new Gtk.TreeViewColumn ();
> > fNamecol.Title = "First Name";
> > Gtk.TreeViewColumn sNamecol = new Gtk.TreeViewColumn ();
> > fNamecol.Title = "Second Name";
> >
> > teamListView.AppendColumn (fNamecol);
> > teamListView.AppendColumn (sNamecol);
> >
> > Gtk.ListStore nameListStore = new Gtk.ListStore (typeof(string),
> > typeof(string));
> > teamListView.Model = nameListStore;
> >
> >
> > Its blank..nothing..i'd expect at the minimum to see 2 column headers.
>
>
> You have to add the TreeView to a parent widget and then call ShowAll()
> on the parent (or the top level widget). For example if the parent is an
> Gtk.HBox you do it like this:
>
> teamListView = new Gtk.TreeView ();
> hbox1.Add (teamListView);
>
> // Setting up your model and columns
>
> hbox1.ShowAll ();
>
> More info on TreeViews in C# can be found here:
>
> http://www.mono-project.com/GtkSharp_TreeView_Tutorial
>
> _______________________________________________
> Gtk-sharp-list maillist  -  [hidden email]<http://user/SendEmail.jtp?type=node&node=4660917&i=0>
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://mono.1490590.n4.nabble.com/Mono-GTK-Bind-Class-object-to-TreeView-tp4660910p4660917.html
>  To unsubscribe from [Mono GTK#] Bind Class object to TreeView, click here<http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660910&code=amFjb2Iuc3BlbmNlcjgwQGdvb2dsZW1haWwuY29tfDQ2NjA5MTB8OTg5MTAwMjg=>
> .
> NAML<http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://mono.1490590.n4.nabble.com/Mono-GTK-Bind-Class-object-to-TreeView-tp4660910p4660919.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20130919/1c211cef/attachment.html>


More information about the Gtk-sharp-list mailing list