在 Tcl 里面创建一个 Gtk+ 窗口…

Ma Kai posted @ Mar 07, 2016 12:19:03 AM in 编程 with tags gtk tcl , 798 阅读

This may sound ridiculous, but that's actually happening...

package require critcl
foreach item [exec pkg-config --cflags gtk+-3.0] {
	critcl::cheaders $item
}
foreach item [exec pkg-config --libs gtk+-3.0] {
	critcl::clibraries $item
}
critcl::ccode {
#include <gtk/gtk.h>
}
critcl::cproc gtk {} void {
	gtk_init(NULL, NULL);
	GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_widget_show(win);
	gtk_main();
}
gtk

"apt-get install critcl libgtk3.0-dev", and be sure to kill it using C-c.

Critcl is amazing, isn't it?


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter