[guiserver-02] refresh image-label

Started by newdep, June 08, 2007, 04:52:35 AM

Previous topic - Next topic

newdep

Hi Lutz,



How can i update an image-label with a new image...?



I trief enable disable refesh etc...



Im unable to get the image refreshed...



Btw..it would be nice if the icon-path would also be a i.e. (read-file ....) action...

instead of reading from disk it reads from text directly..



Regards,

Norman.
-- (define? (Cornflakes))

Lutz

#1
This worked for me:


(gs:frame 'TestFrame 100 100 250 200 "Test")
(gs:panel 'ThePanel)
(gs:image-label 'aImage "/local/newLISP128.png")
(gs:toggle-button 'Toggle 'toggle-action "toggle")
(gs:add-to 'ThePanel 'aImage 'Toggle)
(gs:add-to 'TestFrame 'ThePanel)
(gs:set-visible 'TestFrame true)

(define (toggle-action id flag)
    (if flag
        (gs:set-icon 'aImage "/local/newLISP32.png")
        (gs:set-icon 'aImage "/local/newLISP128.png"))
)


Lutz

newdep

#2
Aha oke.. Im just wondering if the set-icon does a refresh of the label

or if the toggle button does this... I tried this yesterday but not with

a toggle button..could not get is working... Ill try it again...





Nope.. the set-icon only does not refresh the image-label...

This is odd...



The problem is.. My image is every 5 seconds different but with

the same name ;-) So i want an update of the image every 5 seconds

without user interaction...



Norman.
-- (define? (Cornflakes))

Lutz

#3
Wait until the 2D graphics stuff is implemented. It gives better control for animating and otherwise handling images.



My example works beccause pressing the toggle button fources a repaint of the window, which fources a repaint of the label. With the 2D stuff you will have repaint behaviour under program control.



The currently implemented facilities aren't really meant for this.



Lutz