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
14 adjustment=gtk_adjustment_new(200,100,300,50,50,100);
15
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
24 gtk_container_add(GTK_CONTAINER(window),layout);
25 gtk_widget_show_all(window);
26 gtk_main();
27 return 0;
28 }