|
楼主 |
发表于 2006-6-7 21:40:56
|
显示全部楼层
谢谢,现在可以输入汉字啦。
不过声音问题还没搞定。仍然是下图的。
而显示的
HorizSync 30.0 - 71.0
VertRefresh 50.0 - 110.0
也没有效,相信不是FVWM的问题,因为当初我进入gnome是也是1600*1200@60Hz的。
不过可以输入中文已经向桌面应用迈了一大步了。
对啦,要在arch下学习gtk编程需要安装什么软件啊?我pacman -S gcc gdb make glib gtk2了,不过这样的程序还是编译不过。c++是怎样pacman的?我试过g++, gmm,gcc-c++都不行。
#include<glib.h>
#include<gtk/gtk.h>
gint close_application(GtkWidget *widget, GdkEvent *event, gpointer data){
gtk_main_quit();
return FALSE;
}
int main(int argc, char *argv[]){
GtkWidget *window = NULL, *box1, *box2, *button, *separator;
GSList *group;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(close_application), NULL);
gtk_window_set_title(GTK_WINDOW(window), "Radio Buttons");
gtk_container_set_border_width(GTK_CONTAINER(window), 0);
box1 = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), box1);
gtk_widget_show(box1);
box2 = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(box2), 10);
gtk_box_pack_start(GTK_BOX(box1), box2, TRUE, TRUE, 0);
gtk_widget_show(box2);
button = gtk_radio_button_new_with_label(NULL, "button 1");
gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0);
gtk_widget_show(button);
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
button = gtk_radio_button_new_with_label(group, "button 2");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0);
gtk_widget_show(button);
button = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(button), "button 3");
gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0);
gtk_widget_show(button);
separator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(box1), separator, FALSE, TRUE, 0);
gtk_widget_show(separator);
box2 = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(box2), 10);
gtk_box_pack_start(GTK_BOX(box1), box2, FALSE, TRUE, 0);
gtk_widget_show(box2);
button = gtk_button_new_with_label("Close");
g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(close_application), window);
gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
gtk_widget_show(button);
gtk_widget_show(window);
gtk_main();
return 0;
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|