diff options
author | Benjamin Otte <otte@redhat.com> | 2010-08-27 17:05:48 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:11:30 +0200 |
commit | f74f9b276658b2c4cdcaca4b19e7c860e70e0491 (patch) | |
tree | e06b49e3d25fb3314a5390945b6633ea9c234829 /examples | |
parent | cadcd029a1dad1d508fb0019d7e4697ac2513d51 (diff) | |
download | gtk+-f74f9b276658b2c4cdcaca4b19e7c860e70e0491.tar.gz |
gdk: Remove GdkPixmap
All iusers of it are gone, so it's now time to let go.
cairo_surface_t is a full replacement, combined with
gdk_window_create_similar_surface().
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pixmap/pixmap.c | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/examples/pixmap/pixmap.c b/examples/pixmap/pixmap.c deleted file mode 100644 index 7bb3850219..0000000000 --- a/examples/pixmap/pixmap.c +++ /dev/null @@ -1,89 +0,0 @@ - -#include "config.h" -#include <gtk/gtk.h> - - -/* XPM data of Open-File icon */ -static const char * xpm_data[] = { -"16 16 3 1", -" c None", -". c #000000000000", -"X c #FFFFFFFFFFFF", -" ", -" ...... ", -" .XXX.X. ", -" .XXX.XX. ", -" .XXX.XXX. ", -" .XXX..... ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" .XXXXXXX. ", -" ......... ", -" ", -" "}; - - -/* when invoked (via signal delete_event), terminates the application. - */ -gint close_application( GtkWidget *widget, - GdkEvent *event, - gpointer data ) -{ - gtk_main_quit (); - return FALSE; -} - - -/* is invoked when the button is clicked. It just prints a message. - */ -void button_clicked( GtkWidget *widget, - gpointer data ) { - g_print ("button clicked\n"); -} - -int main( int argc, - char *argv[] ) -{ - /* GtkWidget is the storage type for widgets */ - GtkWidget *window, *pixmapwid, *button; - GdkPixmap *pixmap; - GdkBitmap *mask; - GtkStyle *style; - - /* create the main window, and attach delete_event signal to terminating - the application */ - gtk_init (&argc, &argv); - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (window, "delete-event", - G_CALLBACK (close_application), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - gtk_widget_show (window); - - /* now for the pixmap from gdk */ - style = gtk_widget_get_style (window); - pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, - &style->bg[GTK_STATE_NORMAL], - (gchar **)xpm_data); - - /* a pixmap widget to contain the pixmap */ - pixmapwid = gtk_image_new_from_pixmap (pixmap, mask); - gtk_widget_show (pixmapwid); - - /* a button to contain the pixmap widget */ - button = gtk_button_new (); - gtk_container_add (GTK_CONTAINER (button), pixmapwid); - gtk_container_add (GTK_CONTAINER (window), button); - gtk_widget_show (button); - - g_signal_connect (button, "clicked", - G_CALLBACK (button_clicked), NULL); - - /* show the window */ - gtk_main (); - - return 0; -} |