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 }
http://aijuans1.iteye.com/blog/1536675