root/gtkimageview/tests/ex-mini.c

Revision 110, 0.7 kB (checked in by bjourne, 6 years ago)

Add a gboolean parameter reset_fit to the gtk_image_view_set_pixbuf(). This change replaces the no good
gtk_image_view_set_pixbuf_no_repaint() method. The reset_fit argument should almost always be TRUE, but when FALSE it serves the same
purpose that the no_repaint() method did. Since the change affected "stable" API, I decided to bump the minor version number.

Line 
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*-
2  *
3  * This program demonstrates the minimum necessary code needed to use
4  * GtkImageView.
5  **/
6 #include <src/gtkimageview.h>
7
8 int
9 main (int argc, char *argv[])
10 {
11     gtk_init (&argc, &argv);
12     GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
13     GtkWidget *view = gtk_image_view_new ();
14     char *fname = "tests/gnome_logo.jpg";
15     GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (fname, NULL);
16     gtk_image_view_set_pixbuf (GTK_IMAGE_VIEW (view), pixbuf, TRUE);
17     gtk_container_add (GTK_CONTAINER (window), view);
18     gtk_widget_show_all (window);
19     gtk_main ();
20 }
21
Note: See TracBrowser for help on using the browser.