Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

NodeView does't show on win10 compile by vs2017 #256

Open
sarimoly opened this issue Jan 3, 2019 · 1 comment
Open

NodeView does't show on win10 compile by vs2017 #256

sarimoly opened this issue Jan 3, 2019 · 1 comment

Comments

@sarimoly
Copy link

sarimoly commented Jan 3, 2019

Steps to Reproduce

  1. I follow this tutorial on windows use vs2017
    https://www.mono-project.com/docs/gui/gtksharp/widgets/nodeview-tutorial-examples/
  2. download gtk-sharp-2.12.45.msi from https://www.mono-project.com/download/stable/
  3. create an empty project in vs2017, add 7 dll in my project, add following code, compile ok,
  4. the data in NodeView didn't show, just empty.
namespace Project1
{
    public class NodeViewExample : Gtk.Window
    {
        public NodeViewExample() : base("NodeView")
        {
            SetSizeRequest(200, 150);

            // Create our TreeView and add it as our child widget
            Gtk.NodeView view = new Gtk.NodeView(Store);
            Add(view);

            // Create a column with title Artist and bind its renderer to model column 0
            view.AppendColumn("Artist", new Gtk.CellRendererText(), "text", 0);

            // Create a column with title 'Song Title' and bind its renderer to model column 1
            view.AppendColumn("Song Title", new Gtk.CellRendererText(), "text", 1);
            view.ShowAll();
        }

        protected override bool OnDeleteEvent(Gdk.Event ev)
        {
            Gtk.Application.Quit();
            return true;
        }
        Gtk.NodeStore store;
        Gtk.NodeStore Store
        {
            get
            {
                if (store == null)
                {
                    store = new Gtk.NodeStore(typeof(MyTreeNode));
                    store.AddNode(new MyTreeNode("The Beatles", "Yesterday"));
                    store.AddNode(new MyTreeNode("Peter Gabriel", "In Your Eyes"));
                    store.AddNode(new MyTreeNode("Rush", "Fly By Night"));
                }
                return store;
            }
        }
        public static void Main()
        {
            Gtk.Application.Init();
            NodeViewExample win = new NodeViewExample();
            win.Show();
            Gtk.Application.Run();
        }
    }
}

Current Behavior

the NodeView is empty.

Expected Behavior

it should contain 3 row data and 1 line column header.

Artist Song Title
The Beatles Yesterday
Peter Gabriel In Your Eyes
Rush Fly By Night

On which platforms did you notice this

[ ] macOS
[ ] Linux
[*] Windows

win 10:

Stacktrace

Please paste the stack trace here if available.
@marek-safar marek-safar transferred this issue from mono/mono Jan 3, 2019
@sarimoly
Copy link
Author

no stack trace, the program didn't crash

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant