linux 下图形界面编程gtk_layout_new()参数的设置是怎么发挥效用的呢?
GtkWidget*gtk_layout_new(GtkAdjustment*hadjustment,GtkAdjustment*vhadjustment);

     参数hadjustment,vadjustment设置怎么发挥影响?


    下面的列子(layout里放置一个按钮)怎么没有影响
     1  #include<gtk/gtk.h>
 2  int main(int argc,char**argv)
 3  {
 4    GtkObject*adjustment;
 5    GtkWidget*button;
 6    GtkWidget*window;
 7    GtkWidget*layout;
 8    GtkObject*adjustment2;
 9    gtk_init(&argc,&argv);
10    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
11    gtk_window_set_default_size(GTK_WINDOW(window),400,200);
12    layout=gtk_layout_new(GTK_ADJUSTMENT(adjustment),GTK_ADJUSTMENT(adjustment2));
13    //layout=gtk_layout_new(NULL,NULL);
14    adjustment=gtk_adjustment_new(200,100,300,50,50,100);
15  /*
16    GtkAdjustment*gtk_adjustment_new(gdouble value,gdouble lower,gdouble upper,gdouble step_increment,gdouble page_increment,gdouble page_size);
17    create a new GtkAdjustment
18  */
19    button=gtk_button_new_with_label("Private");
20    adjustment2=gtk_adjustment_new(200,100,300,50,50,100);
21    gtk_layout_put(GTK_LAYOUT(layout),button,100,100);
22  /*void gtk_layout_put(GtkLayout*layout,GtkWidget*widget);
23    add child GtkLayout to position(x,y) */
24    gtk_container_add(GTK_CONTAINER(window),layout);
25    gtk_widget_show_all(window);
26    gtk_main();
27    return 0;
28  }

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐