如何在 vala 的类中创建 Gtk 小部件?
我有一个继承按钮的类,它看起来像这样:
public class MyButton : Button {
Gtk.Image image; // This doesn't work
}
我需要启动一个属于“MyButton”类的 GTK Widget。然而,我真的做不到。谢谢!
I have a class that inherits button and it looks like this:
public class MyButton : Button {
Gtk.Image image; // This doesn't work
}
I need to initiate a GTK Widget that belongs to the class "MyButton". However, I can't really do it. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难说你到底想做什么......如果你想设置 GtkButton 的图像属性(请参阅 http://developer.gnome.org/gtk/stable/GtkButton.html#GtkButton--image),一些东西像这样应该工作:
It's hard to tell what exactly you're trying to do... If you're trying to set the image property of the GtkButton (see http://developer.gnome.org/gtk/stable/GtkButton.html#GtkButton--image), something like this should work: