Re: embedding xpm images in your perl scripts



On Sun, 2003-11-30 at 16:00, Dov Grobgeld wrote:

[Please don't append the whole body of the message you reply to if you
don't refer to it.]

In one of my good old Tk programs I have the following code:

    [...]
    $killicon = $w::top->Pixmap(-data=>$pix{dynamite});
    
I.e. it remains the xpm files exactly as they are including the C-syntax.
As far as perl is concerned it is just a string without any specific
structure. Changing it to Perl-syntax would make the data not adher to
the XPM format anymore... Btw, I think we should also be able to do 
inline of png images. These are preferably stored in perl in uuencoded 
format...

The problem is that the gdk-pixbuf library doesn't provide a function
that takes inline data in the original XPM format, i.e. the whole
declaration.  See [1].

From a C point of a view that makes perfect sense: XPM files are C
variable declarations -- so if you have them *in* your program, you're
going to use the thus declared variables.  If you don't have them *in*
your program, there's only one other alternative: you have separate
files.  So gdk-pixbuf only provides two kinds of functions: ones that
operate on files and ones that take the *content* of variables declared
in XPM files.

Bye,
-Torsten

[1]
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-creating.html




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