Thanks,I know how to create a photoimage, but I don't know how to use
Image.new;can it create a new image?According to the Rdoc, should be
"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.
Thanks,I know how to create a photoimage, but I don’t know how to use
Image.new;can it create a new image?According to the Rdoc, should be
“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.