[guiserver-02] refresh image-label

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

[guiserver-02] refresh image-label

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

This worked for me:

Code: Select all

(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
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

Locked