简体   繁体   English

Gtk# 应用程序未正确呈现 TreeView

[英]Gtk# application is not rendering TreeView Properly

I am trying to develop a gtk application on mac using gtk#.我正在尝试使用 gtk# 在 mac 上开发 gtk 应用程序。 I created a tree view just like in the tutorial but the arrows are not rendering properly as seem below, there are no arrows.我像在教程中一样创建了一个树视图,但是箭头没有正确渲染,如下所示,没有箭头。 I can click to open and close but the actual arrows aren't working.我可以单击打开和关闭,但实际的箭头不起作用。

图片

I copy pasted the code from the tutorial and It did the same thing, but here is my code anywhere.我复制粘贴了教程中的代码,它做了同样的事情,但这是我的代码在任何地方。 I have also verified view.ShowExpanders is set to true我也验证了 view.ShowExpanders 设置为 true

        Application.Init();

        Window window = new Window("Editor Window");

        window.SetPosition(WindowPosition.Center);
        window.HeightRequest = 800;
        window.WidthRequest = 1200;

        TreeView view = new TreeView();

        view.WidthRequest = 500;

        TreeViewColumn column = new TreeViewColumn();
        column.Title = "Heirarchy";

        CellRendererText cell = new CellRendererText();

        column.PackStart(cell, true);

        view.AppendColumn(column);

        column.AddAttribute(cell, "text", 0);

        TreeStore store = new TreeStore(typeof(string));

        TreeIter i = store.AppendValues("Project");
        i = store.AppendValues(i,"Room1");
        i = store.AppendValues(i, "Item");
        store.AppendValues(i, "Attribute");
        store.AppendValues(i, "Attribute");
        store.AppendValues(i, "Attribute");


        view.ShowExpanders = true;

        view.Model = store;
        view.ShowExpanders = true;

        window.Add(view);

        window.DeleteEvent += ExitWindow;

        window.ShowAll();

        Application.Run();

Is there some sort of image asset that doesn't exist on my computer?是否有某种图像资产在我的计算机上不存在? How would I install that on mac?我将如何在mac上安装它? Thank you for any help you can provide.感谢您提供任何帮助。

As a comment suggested, using brew install adwaita-icon-theme fixed the problem正如评论所建议的那样,使用brew install adwaita-icon-theme解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM