Page 2 of 2

Re: Treeview active is one place off

Posted: Thu Sep 29, 2022 3:23 am
by SamuraiCrow
@emeck

The test_mui.hws listing in your previous post is not what it should be. ;)

Re: Treeview active is one place off

Posted: Thu Sep 29, 2022 6:56 am
by emeck
@SamuraiCrow

:oops: Right, thank you

test.xml:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app_test" base="APPTEST">
    <window id="win_test" title="Listtree" muiid="MAIN" notify="closerequest">
        <hgroup>
            <listtree id="lt_test" notify="active">
                <node id="nd1" name="node1"></node>
                <node id="nd2" name="node2"></node>
                <node id="nd3" name="node3"></node>
            </listtree>
        </hgroup>
    </window>
</application>
test.hws:

Code: Select all

@DISPLAY {Hidden = True}

Function p_EventHandler(msg)
    Switch msg.Class
    Case "Window":
        Switch msg.Attribute
        Case "CloseRequest":
            End()
        EndSwitch
    Case "Listtree":
        Switch msg.Attribute
        Case "Active":
            DebugPrint(mui.Get("lt_test", "active"))
        EndSwitch
    EndSwitch
EndFunction

InstallEventHandler({MUIRoyale = p_EventHandler})
mui.CreateGUI(FileToString("test.xml"))

Repeat
    WaitEvent
Forever

Re: Treeview active is one place off

Posted: Sat Oct 01, 2022 10:06 pm
by airsoftsoftwair
Ok, looks like a bug. Will be fixed.

Re: Treeview active is one place off

Posted: Tue Aug 13, 2024 10:13 pm
by airsoftsoftwair
So actually this is a bug in MorphOS MUI. I already reported it to them back in May 2021 but in December 2021 they said they won't fix it for fear of breaking existing apps. So I've now added a workaround specifically for MorphOS to RapaGUI:

Code: Select all

- Change [MorphOS]: Added a workaround for a bug in MorphOS' listtree class that caused notifications on
  Listtree.Active to return the wrong items

Re: Treeview active is one place off

Posted: Wed Aug 14, 2024 9:37 am
by emeck
Thanks for the fix Andreas