日期:2014-05-16 浏览次数:21012 次
//这是微调实现代码 hadjustment = gtk_adjustment_new (5,0,10,-1,1,0); /*创建微调对象*/ vadjustment = gtk_adjustment_new (5,0,10,-1,1,0); /*创建微调对象*/ hscll = gtk_hscrollbar_new( GTK_ADJUSTMENT(hadjustment) );//水平滚动条 vscll = gtk_vscrollbar_new( GTK_ADJUSTMENT(vadjustment) );//垂直滚动条 gtk_layout_set_size(vadjustment,30,500); hbox = gtk_scrolled_window_new (NULL, NULL); vbox = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start(GTK_BOX(hbox),hscll ,TRUE,TRUE,0); /*将微调按纽加入组装盒*/ gtk_box_pack_start(GTK_BOX(vbox),vscll ,TRUE,TRUE,0); /*将微调按纽加入组装盒*/ gtk_widget_show(hscll); gtk_widget_show(vscll); gtk_table_attach(GTK_TABLE(base_window->table),GTK_WIDGET(hscll),0,1,1,2, GTK_EXPAND|GTK_FILL,GTK_EXPAND|GTK_FILL,0,0); gtk_table_attach(GTK_TABLE(base_window->table),GTK_WIDGET(vscll),1,2,0,1, GTK_EXPAND|GTK_FILL,GTK_EXPAND|GTK_FILL,0,0); //注册关闭函数 gtk_signal_connect(GTK_OBJECT(base_window),"destroy", GTK_SIGNAL_FUNC(SLOG_window_destroy),base_window); gtk_signal_connect(GTK_OBJECT(hadjustment),"value-changed", GTK_SIGNAL_FUNC(change_adj),base_window); gtk_signal_connect(GTK_OBJECT(vadjustment),"value-changed", GTK_SIGNAL_FUNC(change_adj),base_window);