[Glade-users] a question about GtkImage
Tristan Van Berkom
tristan.van.berkom at gmail.com
Wed Jan 16 08:27:17 EST 2008
2008/1/16 wubei83 <wubei83 at 163.com>:
> Hello,
> I need some information about GtkImage .In my application, I attach a
> GtkImage in the GtkTable which is attached in the top window. The program
> is as follows:
>
> GtkWidget *image;
> image = create_pixmap (image,"sine.png");
> pix1 = gtk_image_get_pixbuf (GTK_IMAGE(image));
> pix2 = gdk_pixbuf_scale_simple(pix1, 205, 82, GDK_INTERP_BILINEAR);
> gtk_image_set_from_pixbuf (GTK_IMAGE(image), pix2);
> g_object_unref (pix2);
> gtk_widget_show (image);
> gtk_table_attach (GTK_TABLE(table), image, 3, 16, 0, 8,
> (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL),
> (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL), 0, 0);
>
>
> Now, I want to realize the function that when I click the button,
> there will be a arrow displayed on the fixed pisition of the image. But I do
> not know how to do.
> Any information is appreciated. Thanks.
>
Sure, you should probably be using a GtkDrawingArea widget, handle the
expose event and start by blitting on the background image (possibly from
a prefabricated GdkPixmap), and then using cairo drawing routines to
draw shapes and lines onto your drawing area.
I think the scribble example in the gtk+ sources should be a good start
for you.
Cheers,
-Tristan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20080116/1162f9cd/attachment.html
More information about the Glade-users
mailing list