Imagecache on LInux

Discuss GUI programming with the RapaGUI plugin here
Post Reply
evil
Posts: 129
Joined: Mon Jun 14, 2010 1:38 pm

Imagecache on LInux

Post by evil » Sun Jan 20, 2019 11:19 am

Hello again!

I Created a gui, which contains one listview. And three sliders.
Inside this listview are some entries, which contain images (brushes, which show just one color...)
The sliders will be used to change the colors of those listviewimages.
When I now change an image of an entry, the new image will be displayed correct on amiga.

Doing the same on linux will cause some other entries to change their images, too.
Could not test on Win/Mac....

Its difficult to discribe the problem, so here is a (not that) small code snippet:

Code: Select all

@REQUIRE "RapaGUI"
xml$=[[<?xml version="1.0" encoding="iso-8859-1"?>
    <application id="app">
        <window>
            <hgroup>
                <listview id="lv" notify="active">
                    <column icon="1"> </column>
                </listview>
                <slider id="red" horiz="0" notify="level" max="255" reverse="1"/>
                <slider id="green" horiz="0" notify="level" max="255" reverse="1"/>
                <slider id="blue" horiz="0" notify="level" max="255" reverse="1"/>
                <rectangle/>
            </hgroup>
        </window>
    </application>]]

color={r=0,g=0,b=0}
lvcolor={0,0,0,0,0,0}
Function p_eventfunc(msg)
    Switch msg.class
    Case "Slider"
        color.r=moai.get("red","level")
        color.g=moai.get("green","level")
        color.b=moai.get("blue","level")
        lvcolor[activeentry]=color.r*65536+color.g*256+color.b
            moai.set("lv","quiet","1")
            moai.domethod("lv","remove",activeentry)
            moai.FreeImage(activeentry)
            CreateBrush(activeentry,30,20,lvcolor[activeentry])
            moai.DoMethod("lv","insert",activeentry,activeentry,hexstr(lvcolor[activeentry]))
            moai.set("lv","active",activeentry)
            moai.set("lv","quiet","0")
 
    Case "Listview"
        activeentry=moai.get("lv","active")
        moai.set("red","level",red(lvcolor[activeentry]),"nonotify","1")
        moai.set("green","level",green(lvcolor[activeentry]),"nonotify","1")
        moai.set("blue","level",blue(lvcolor[activeentry]),"nonotify","1")
    EndSwitch
EndFunction

InstallEventHandler({Rapagui=p_eventfunc})

moai.createapp(xml$)

for t=0 to 5
    CreateBrush(t,30,20,#Black)
    moai.DoMethod("lv","insert","bottom",t,0)
Next

activeentry=0 moai.set("lv","active",activeentry)

Repeat
    WaitEvent()
Forever
Do I have a logical problem, or is it a bug??

Best regards

George

evil
Posts: 129
Joined: Mon Jun 14, 2010 1:38 pm

Re: Imagecache on LInux

Post by evil » Sun Jan 20, 2019 11:52 am

Ok, I think I got it...

Using listview.forcemode with attribute dataview, seems to solve the problem..

Best regards

George

User avatar
airsoftsoftwair
Posts: 3110
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Imagecache on LInux

Post by airsoftsoftwair » Wed Jan 23, 2019 5:31 pm

Looks still like a bug, using data view mode is a good workaround then, though :)

Post Reply