下面是我的Glade窗口的图像(也在这里的另一个问题中使用),在那里你可以看到仅在一小部分而不是整个窗口中看到的蓝色背景。为什么会这样?我做了什么?
小部件堆栈如下:
- 的GtkWindow
GtkVerBox:
1.GtkHorButtonBox(其中有1个简单按钮和4个单选按钮)
2的 GtkHorBox:
a.GtkScrollWin-> GtkViewport-> GtkFrameBox-> GtkVerButtonBox-> GtkButtons
B'强> GtkViewport-> GtkVerBox:
GtkViewport-> GtkHorButtonBox(2个单选按钮)
GtkViewport-> GtkHorBox-> GtkLabels
我的代码如下!
void Second_Window()
{
GtkBuilder*builder;
GError *error = NULL;
/*Initialize Gtk*/
gtk_init( NULL, NULL );
/*Inialize a builder to call the glade window created*/
builder = gtk_builder_new();
if( ! gtk_builder_add_from_file( builder, "/home/ub/Desktop/myGUI.glade", &error ) )
{
g_warning( "%s", error->message );
g_free( error );
}
/*Create and find the window*/
secondWindow = GTK_WIDGET( gtk_builder_get_object( builder, "secondWindow" ) );
gtk_window_set_title(GTK_WINDOW (secondWindow), "IPC_Settings!!!" );
/*The Background Image*/
secondImage = load_pixbuf_from_file ("dlm.jpg");
gdk_pixbuf_render_pixmap_and_mask (secondImage, &background2, NULL, 0);
style2 = gtk_style_new ();
style2->bg_pixmap [0] = background2;
gtk_widget_set_style (GTK_WIDGET(secondWindow), GTK_STYLE (style2));
/*For Buttons In Second Window*/
sW_VBbox = gtk_vbutton_box_new();
sW_VBbox = GTK_WIDGET( gtk_builder_get_object( builder, "v_button_box2") );
}
我有点要疯来解决这个问题。非常欢迎立即的帮助和建议。提前致谢!