JeeBee.. cool you're doing this, it will indeed be something usefull.. although 
you asked me over msn, 
and I wasn't there so couldn't answer, and now you're offline (so I'm writing 
this mail).. I'll give 
you a better way to do it in a few secs..
first, I wanted to say to Phil that I'm proud of you.. you realized yourself 
that you were agressive.. 
too bad, I wanted to tell you "relax" myself :P I didn't look at the code, but 
seeing that there was 
no photo_name passed, yes, it would have been an ugly hack!
Now.. Jeebee.. I suggest you go to amsn SF page, go to 'browse CVS', look in 
the attic of the msn/ 
module, and look at the code of anigif.tcl there's a way there to retreive the 
number of frames of an 
animated gif, and there's a way to get a certain frame directly... 
Yes, it would mean going reverse, but if it's available, then use it... What I 
mean by 'going reverse' 
is that you can do it but you need to tell Tk to bypass cximage and use Tk's 
library for gif files.. 
Let's view it this way : tkcximage is used to display images, if they are 
animated, it will display 
the anigif and that's it.. but you want a 'special feature', something that 
TkCximage wasn't written 
for, so you could use Tk's gif implementation instead of TkCximage without your 
code having a 'design 
flaw'... 
To bypass tkcximage, you have to specify '-format gif86' when creating the 
image.. and to get your 
image, use the -index option.. so it would be :
image create photo my_hangman_img $filename -format gif86 -index $image_index 
and you got it.. 
Assuming you know enough Tk, I wouldn't go into too much details about using 
the same name and doing a 
n image create photo would overwrite your image, instead of creatng [image 
create photo temp] then do 
a [my_hangman_img copy temp] or something...
Apart from that, to get the number of frames, I think in anigif.tcl we used to 
open the file, read the 
GIF86 header and get the number of frames using a binary scan.. not sure, 
you'll have to check it out!
good luck, have fun, etc... :)
Advantage : you'll avoid wroking on tkcximage, avoid introducing new bugs in 
it, faster development, 
no need to recompile tkcximage, will still be compatible with 0.95...
Disadvantage : you won't use TkCximage.. but you don't really need it since you 
don't use png, or want 
an animated gif to play continuously...

By the way, answer this : why is your plugin not compatible with 0.95 but only 
0.96 ?

KaKaRoTo


On Thu, Feb 16, 2006 at 11:56:16PM +0100, Le Philousophe - Phil wrote:
> Sorry to be too aggressive...
> Anyway, I didn't receive your second mail pointing the same problem that me...
> Phil
> 
> Le Thursday 16 February 2006 23:26, Jonne Zutt a ?crit?:
> > Yes, yes, I know, sorry.
> > Trying to do it in a better way.
> >
> > JeeBee.
> >
> > > Hey !
> > > What is this ugly hack !
> > > I don't want that in an OO library....
> > > What will happen if we load two images in the same time in two different
> > > branches of aMsn ??
> > > Phil
> > >
> > > Le Thursday 16 February 2006 22:23, Jonne Zutt a ??crit? :
> > >> Hi All - and especially Youness this time,
> > >>
> > >> I made some changes to TkCximage, which you hopefully like.
> > >> Added:
> > >> - ::CxImage::NumberOfFrames
> > >>   - returns the number of frames
> > >> - ::CxImage::JumpToFrame <frame index>
> > >>   - Jumps to <frame index>
> > >>
> > >> I changed demo.tcl for illustration/testing.
> > >> (It works fine each time for my Hangman animated gif, but seems not to
> > >> work sometimes for the animated gif in the demo directory, if anyone can
> > >> tell me why that would be great :)
> > >>
> > >> As a result, my Hangman images are much smaller. I put them in 1
> > >> animated gif and I guess that compression is much better in some way
> > >> (the pictures are a like, so I thought this made sense).
> > >>
> > >> Anyways, it can be usefull in other cases I'd suppose, and it's a small
> > >> change.
> > >>
> > >> JeeBee.
> > >>
> > >> ps > If anyone decides to commit this, he/she can contact me for the
> > >> Hangman animated gif, just to have another nice animated gif example in
> > >> the demo directory.
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > files
> > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > > http://sel.as-us.falkag.net/sel?cmd______________________________________
> > >_________ Amsn-devel mailing list
> > > Amsn-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > files for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
> > _______________________________________________
> > Amsn-devel mailing list
> > Amsn-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to