|
- #include <gtk/gtk.h>
- static GtkWidget *window=NULL;
- static GdkPixmap *pixmap=NULL;
- int main(int argc, char* argv[]) {
- GtkWidget *vbox;
- GtkWidget *label_1;
- GtkWidget *frame_1;
- GtkWidget* frame;
- GtkWidget* da;
- gchar* title_1;
- gint s_width, s_height;
- gtk_init(&argc, &argv);
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- g_signal_connect(G_OBJECT(window),"delete_event",
- G_CALLBACK(gtk_main_quit),NULL);
- gtk_window_set_title(GTK_WINDOW(window),"GDK演示(部分)");
- s_width = gdk_screen_width();
- s_height=gdk_screen_height();
- gtk_window_set_default_size(GTK_WINDOW(window), s_width, s_height);
- /* 定义纵向盒子 */
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(vbox),8);
- gtk_container_add(GTK_CONTAINER(window), vbox);
- /* 添加标签 */
- label_1=gtk_label_new("GDK");
- gtk_label_set_justify(GTK_LABEL(label_1),GTK_JUSTIFY_LEFT);
- gtk_box_pack_start(GTK_BOX(vbox), label_1, TRUE, FALSE, 0);
- gtk_widget_show(window);
- gtk_main();
- return FALSE;
- }
复制代码
这段代码,我怎么弄也不显示出标签,真是想不出问题在那了。 |
|