程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> gtk+-linux 下圖形界面編程gtk_layout_new()參數的設置是怎麼發揮效用的呢?

gtk+-linux 下圖形界面編程gtk_layout_new()參數的設置是怎麼發揮效用的呢?

編輯:編程綜合問答
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  }

最佳回答:


http://aijuans1.iteye.com/blog/1536675

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved