我使用NodeView对象以这种方式向用户输出数据(Gtk#tutorial):
[Gtk.TreeNode (ListOnly=true)]
public class MyTreeNode : Gtk.TreeNode {
string song_title;
public MyTreeNode (string artist, string song_title)
{
Artist = artist;
this.song_title = song_title;
}
[Gtk.TreeNodeValue (Column=0)]
public string Artist;
[Gtk.TreeNodeValue (Column=1)]
public string SongTitle {get { return song_title; } }
}
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")); …Run Code Online (Sandbox Code Playgroud) 我的Gtk#应用程序中有2个全屏窗口,主要和辅助.我有第二种形式的buttonClose,click事件处理程序必须关闭此窗口并进行一些操作:
protected void OnButtonClose_Clicked (object sender, EventArgs e)
{
//some operation
this.Dispose ();
}
Run Code Online (Sandbox Code Playgroud)
但是窗户没关!如果我在主窗口中使用此代码,该窗口将关闭,应用程序将终止.为什么此代码适用于主窗口而不适用于辅助窗口?如何关闭辅助窗口?