我是单声道 C# Gtk 的新手。我用以下代码制作了一个带有两个按钮的窗口:
using Gtk;
using Gdk;
class FirstScreen : Gtk.Window
{
public FirstScreen() : base("Buttons")
{
SetDefaultSize(250, 200);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate { Application.Quit(); };
Fixed fix = new Fixed();
Button btn1 = new Button("Take Photo");
Button btn2 = new Button("Take Video");
Gdk.Color col = new Gdk.Color();
Gdk.Color.Parse("red", ref col);
fix.(StateType.Normal, col);
fix.Put(btn1,30, 80);
fix.Put(btn2, 130, 80);
Add(fix);
ShowAll();
}
public static void Main()
{
Application.Init();
new FirstScreen();
Application.Run();
}
}
我想要改变窗口的背景颜色或固定的颜色。我们怎么能做到这一点请帮忙?