Update gtk4-test-2

This commit is contained in:
daleclack 2021-02-05 08:49:05 +08:00
parent 9c38c93968
commit 05cc79e851
4 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -8,8 +8,8 @@ static void gtkmain(GtkApplication *app,gpointer user_data){
window=gtk_application_window_new(app);
pixbuf=gdk_pixbuf_new_from_xpm_data(winpe);
sized=gdk_pixbuf_scale_simple(pixbuf,480,360,GDK_INTERP_BILINEAR);
image=gtk_image_new_from_pixbuf(sized);
gtk_widget_set_size_request(image,400,300);
image=gtk_picture_new_for_pixbuf(sized);
//gtk_widget_set_size_request(image,400,300);
gtk_box_append(GTK_BOX(box),image);
gtk_window_set_child(GTK_WINDOW(window),box);
gtk_widget_show(window);

Binary file not shown.

View File

@ -38,7 +38,7 @@ static void gtkmain(GtkApplication *app,gpointer user_data){
GdkPixbuf *pixbuf=gdk_pixbuf_new_from_xpm_data(winpe);
GdkPixbuf *sized=gdk_pixbuf_scale_simple(pixbuf,480,360,GDK_INTERP_BILINEAR);
background=gtk_picture_new_for_pixbuf(sized);
//gtk_widget_set_size_request(background,480,360);
gtk_widget_set_size_request(background,480,360);
gtk_fixed_put(GTK_FIXED(fixed),background,0,0);
//GtkButton
button=gtk_button_new_with_label("Change Background");