cominglately 2015-09-13 09:59 采纳率: 14.3%
浏览 2198
已采纳

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条回答 默认 最新

  • devmiao 2015-09-13 15:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 adb连接不到手机是怎么回事?
  • ¥15 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联
  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目