import dui.All;
public:
class HelloWorld : MainWindow
{
this()
{
super("TitleName");
add(new Label("Hello World"));
show();
}
}
void main(char[][] args)
{
DUI dui = DUI.dui(args);
new HelloWorld();
dui.go();
}
参考
以前のものは ×ボタン押してもウインドウを消せませんでしたが、現在はデフォルトでできるようです。
以前はイベントを受け取る必要がありました。
ポイント:: DUI.dui.stop();でイベントループを終了する。 bit windowDeleteCallback( Window window,Event event) は たしか?falseを返すようにする。罰ボタンを押すと呼ばれる bit windowDestroyCallback( Window window ,Event event)は たしか?falseを返すようにする
import dui.All;
public:
class HelloWorld : MainWindow , WindowListener
{
private:
public :
this()
{
super("Start GUI Programing");
add(new Label("Kyoro Kyoro"));
setSizeRequest(100,100);
show();
Dispatcher dis = new Dispatcher();
dis.addWindowListener(this,this);
}
bit windowDeleteCallback( Window window,Event event)
{
if(true =this.exit(0,true))
{
DUI.dui.stop();
return false;
}
return true;
}
bit windowDestroyCallback( Window window ,Event event)
{
return false;
}
}
void main(char [][]args)
{
DUI dui = DUI.dui(args);
new HelloWorld();
dui.go();
}
戻る 無料ホームページ 楽天モバイル[UNLIMITが今なら1円]
海外格安航空券 海外旅行保険が無料!