From: ts Date: 2002-07-22T00:27:35+09:00 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