Use Pageview class with Treeview class ?
Use Pageview class with Treeview class ?
Hello,
i would like to do a GUI with a treeview on the left and pageview class on the right.
i would like to open a new page for each treeview entry.
Is possible?
Thanks for your answer
i would like to do a GUI with a treeview on the left and pageview class on the right.
i would like to open a new page for each treeview entry.
Is possible?
Thanks for your answer
- airsoftsoftwair
- Posts: 5557
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Use Pageview class with Treeview class ?
Sure it is. Just set Pageview.Active to the desired page whenever the user clicks a treeview item.
Re: Use Pageview class with Treeview class ?
Thanks Andreas!
My problem was the creation of this new group.
I have inserted a new vertical group "Pageview" after the Treeview group and it work fine!
I can start now
My problem was the creation of this new group.
I have inserted a new vertical group "Pageview" after the Treeview group and it work fine!
I can start now
Re: Use Pageview class with Treeview class ?
I have a problem to open a specific page when i click on specific entry of the treeview...
Do you have an example please?
Thanks!
Do you have an example please?
Thanks!
- airsoftsoftwair
- Posts: 5557
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Use Pageview class with Treeview class ?
Here you go:
Code: Select all
@REQUIRE "RapaGUI"
Function p_EventFunc(msg)
If (msg.attribute = "Active") And StartsWith(msg.triggervalue, "item") Then moai.Set("pv", "active", Val(UnrightStr(msg.triggervalue, 4)) - 1)
EndFunction
xml$ = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="win" title="Tasks" height="400" width="400">
<vgroup>
<hgroup>
<treeview id="tv" height="250" notify="active">
<column title="Column"/>
<node id="tasks" name="My Tasks" >
<leaf id="item1">
<item>One</item>
</leaf>
<leaf id="item2">
<item>Two</item>
</leaf>
<leaf id="item3">
<item>Three</item>
</leaf>
</node>
</treeview>
<pageview id="pv">
<vgroup title="Page 1">
<listview>
<column>
<item>Entry</item>
</column>
</listview>
</vgroup>
<vgroup title="Page 2">
<texteditor/>
</vgroup>
<vgroup title="Page 3">
<button id="btn">Click me</button>
</vgroup>
</pageview>
</hgroup>
</vgroup>
</window>
</application>
]]
moai.CreateApp(xml$)
InstallEventHandler({RapaGUI = p_EventFunc})
; main loop!
Repeat
WaitEvent
Forever
Re: Use Pageview class with Treeview class ?
Thanks a lot Andreas!
Just tested and it confirm my problem with Treeview on MorphOS on this thread:
viewtopic.php?t=3878
This is a snapshot:
Seems first line of the Treeview is "Off"
When i execute the code, i get "Entry" page.
If i click on "Two" entry then "Three" entry i get "TextEditor", Hollywood show the page of the previous item each time...
I hope it could help you.
Just tested and it confirm my problem with Treeview on MorphOS on this thread:
viewtopic.php?t=3878
This is a snapshot:
Seems first line of the Treeview is "Off"
When i execute the code, i get "Entry" page.
If i click on "Two" entry then "Three" entry i get "TextEditor", Hollywood show the page of the previous item each time...
I hope it could help you.
Re: Use Pageview class with Treeview class ?
By testing more, if there is only 1 column, i have the graphic bug, if 2 columns are sets, the show is correct.
Re: Use Pageview class with Treeview class ?
I also had the graphical bug on the treeview titles with a single column example code. It shows underlaying windows/desktop where it should show the title.. and then it flickers with random graphic data when you resize the window. The same thing that can be seen in the above screenshot.
- airsoftsoftwair
- Posts: 5557
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Use Pageview class with Treeview class ?
Yeah, but that is clearly a MUI bug. RapaGUI doesn't do any drawing at all, this is all done by MUI. So that title thing is a MUI bug, the wrong entry that is returned is likely a RapaGUI bug. Even though it works on OS3, I have an idea what could be causing this on MorphOS. I'll check.jPV wrote: ↑Tue Feb 06, 2024 3:21 pm I also had the graphical bug on the treeview titles with a single column example code. It shows underlaying windows/desktop where it should show the title.. and then it flickers with random graphic data when you resize the window. The same thing that can be seen in the above screenshot.
- airsoftsoftwair
- Posts: 5557
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Use Pageview class with Treeview class ?
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