Antwort: Re: [Glade-users] how to display images?



On Wed, 18 Jul 2001 f parzefall multitest de wrote:

Thanks for the input, but that not quite what I wanted to do. GtkPixmap
put a pixmap at startup. But according to the manual it not possible
to use it during runtime because the image is stored on the X-server.
Anyway, I already tried this functions and had the same effect as you
describe. Seems to be a bug...

I do not quite understand what it is you want to do.  First, you might be
wanting to display a static image, that is, you load it once, and it stays
that way for all the time it is on the screen.  To do this, a GtkPixmap
will work well, by "stored on the X server" the manual means that when the
X server goes to display the image, it uses a local copy.  Second, you may
mean you want to update an image regularly.  There are several ways to do
this, the way I would recommend most of the time is to use a
GtkDrawingArea.  See http://users.bigpond.net.au/mlm/planner/ for an
example of an application using a GtkDrawingArea (and also a GtkPixmap).
You may prefer to use a GtkImage, which displays a GdkImage that you can
update.

See http://users.bigpond.net.au/mlm/libglade/ for a tutorial I once wrote
on using libglade.  It covers building a simple GtkDrawingArea application
and may be clearer than the (largely uncommented) source code for the
above application.  I have some code using a GdkImage to display a
scrolling text animation, if you wish to see that.

-- 
bje






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]