Handbook
Glossary
set-image ( gadget object -- gadget )
Vocabulary
images
.
viewer
Inputs
gadget
an
image-gadget
object
a
pathname
, a
string
, or an
image
Outputs
gadget
an
image-gadget
Word description
Sets the image of this gadget. This word loads the image from disk if the input is a string or a pathname. If the input is a model, gadget has to be an
image-control
.
Definition
IN:
images.viewer
GENERIC:
set-image
( gadget object -- gadget )
Methods
USING:
accessors
images
images.viewer
;
M:
image
set-image
>>image
;
USING:
accessors
images.viewer
kernel
models
;
M:
model
set-image
[
value>>
>>image
drop
]
[
>>model
]
2bi
;
USING:
accessors
images.loader
images.viewer
io.pathnames
;
M:
pathname
set-image
string>>
load-image
>>image
;
USING:
accessors
combinators.short-circuit
images.http
images.loader
images.viewer
kernel
sequences
strings
;
M:
string
set-image
dup
{
[
"https://"
head?
]
[
"https://"
head?
]
}
1||
[
load-http-image
]
[
load-image
]
if
>>image
;
USING:
accessors
images.http
images.viewer
urls
;
M:
url
set-image
protocol>>
load-http-image
>>image
;