From: Maggie Xiao Date: 2002-07-23T00:36:28+09:00 Subject: Re: How to use "new" method of TkImage Thank you very much.Now I know why I cannot find any example of how to use TkImage. Maggie ----- Original Message ----- From: "ts" To: "ruby-talk ML" Cc: ; Sent: Sunday, July 21, 2002 9:27 AM Subject: Re: How to use "new" method of TkImage > >>>>> "M" == Maggie Xiao writes: > > >> Thanks,I know how to create a photoimage, but I don't know how to use > M> Image.new;can it create a new image?According to the Rdoc, should be > M> "new(keys=nil)".Thanks again. > > The best is to do like ruby, i.e. to create a subclass of TkImage to > define @type and then call super. For example, TkPhotoImage do > > class TkPhotoImage < TkImage > def initialize(*args) > @type = 'photo' > super > end > # etc > end > > There is only one problem : in tcl/tk it exist *only* 2 types of Image > defined by tk : > * 'photo' defined by TkPhotoImage > * 'bitmap' defined by TkBitmapImage > > This mean that if you want to use an Image, you must fatally use > TkImagePhoto or TkBitmapImage. TkImage is useless for you except if you > use an tcl/tk extensions which define its own image type. > > > Guy Decoux > > > >