Fork me on GitHub

2009/12/04

Recent entries from same category

  1. GoでGoogle翻訳出来るライブラリ書いた。 Hatena
  2. VimでGoがautocomplete出来るgocodeがいい感じ Hatena
  3. Go本が出るらしい。 Hatena
  4. GoでJSDeferred書いてみた。 Hatena
  5. Go本出てるよ。 Hatena

GtkTreeModelとか面倒くさい部分に差し掛かってます。でもこれないとコンボボックスもツリーもリストも作れないんすよね。
go-gtk-20091204
いまんところこんな感じ。
イベントクロージャが内包出来てJavaScriptを書いているかの様にGTKプログラミングが出来ています。
    //--------------------------------------------------------
    // GtkButton
    //--------------------------------------------------------
    button := gtk.ButtonWithLabel("Button with label");
    button.Clicked(func(w *gtk.GtkWidget, args []unsafe.Pointer) {
        print("button clicked: ", button.GetLabel(), "\n");
        dialog := gtk.MessageDialog(
            button.GetTopLevelAsWindow(),
            gtk.GTK_DIALOG_MODAL,
            gtk.GTK_MESSAGE_INFO,
            gtk.GTK_BUTTONS_OK,
            entry.GetText()
        );
        dialog.Response(func(w *gtk.GtkWidget, args []unsafe.Pointer) {
            println("Dialog OK!")
        }, nil);
        dialog.Run();
        dialog.Destroy();
    }, nil);
    buttons.Add(button);
完成はまだまだ先です。頑張ります。
Posted at 00:30 in ソフトウェア::lang::go | Edit
Tagged as: go, golang, gtk
Bookmarks: add to hatena add to hatena | add to delicious.com | add to livedoor.clip add to livedoor.clip

blog comments powered by Disqus