c# - Gtk# 应用程序未正确呈现 TreeView
问题描述
我正在尝试使用 gtk# 在 mac 上开发 gtk 应用程序。我像在教程中一样创建了一个树视图,但是箭头没有正确渲染,如下所示,没有箭头。我可以单击打开和关闭,但实际的箭头不起作用。
我复制粘贴了教程中的代码,它做了同样的事情,但这是我的代码在任何地方。我也验证了 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();
是否有某种图像资产在我的计算机上不存在?我将如何在mac上安装它?感谢您提供任何帮助。
解决方案
正如评论所建议的那样,使用brew install adwaita-icon-theme
解决了问题
推荐阅读
- ruby-on-rails - 定义知道自己的类并查找值的工厂
- amazon-web-services - 我需要使用秘密管理器秘密为 ec2 实例创建用户名和密码
- android - 如果从最近清除应用程序,BroadcastReceiver 在 2 或 3 分钟后不工作
- google-bigquery - 如何识别分区内的日期差异?
- time-series - 处理每日温度时间序列插值过程中的缺失数据
- firefox - 用户代理中的 gzip(gfe) 是什么
- jquery - jQuery 和 iOS 设备
- swift - 在集合视图中使用可重用单元格的问题
- java - environment.getProperty("property") 是否产生与 @Value("property") 相同的值
- javascript - 分配给不同容器时预加载的图像重新加载?