gpt4 book ai didi

c# - GTK# : What should the parameter of ListStore be ?

转载 作者:行者123 更新时间:2023-11-30 22:34:29 25 4
gpt4 key购买 nike

我正在尝试创建一个 ListStore,以便在输入字段中将其设置为完成模型。

ListStore store = new ListStore(string);

输出:错误 CS1526:意外符号 )',期待 。' (CS1526)(练习)

在 PyGTK 中,它是这样完成的:store = gtk.ListStore(str)

我是 C# 的新手,但将 Gtk 与 Python 结合使用。如果这是一个愚蠢的问题,请原谅我:)

谢谢。

最佳答案

ListStore 构造函数将列类型作为参数。您可以使用 typeof从名称中获取类型实例的运算符:

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

关于c# - GTK# : What should the parameter of ListStore be ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7808023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com