【发布时间】:2013-08-28 15:32:58
【问题描述】:
我是单声道 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();
}
}
我想改变窗口的背景颜色或固定的颜色。我们该怎么做?请帮忙?
【问题讨论】:
标签: c# gtk monodevelop