Treeview and XML

Discuss GUI programming with the RapaGUI plugin here
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Treeview and XML

Post by papiosaur »

Hello,

is there functions to load a XML file in a window with Treeview class, do modifications then save the XML file?

Thanks for your answer.
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Treeview and XML

Post by plouf »

yes, there is XML plugin who can parse xml documents

however you then manually insert data to treeview or anywhere else
Christos
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

Thanks plouf, i will investigate about this XML plugin.
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

Hello,

i read documentation of XML plugin but unfortunnaly i understand how to edit a value in a treeview...

My colums are editable (editablenodes="true") but when double-clicking, nothing append... (under MorphOS).

it work in listview mode.

Thanks for your help.
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

New question, is it possible to have a selection gadget in a treeview (and listview)?

Thanks for your answer.
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

i have a strange thing:

When i click on a button 'Edit', i get the entries of a line in "textentry" cases.

If the same lines of code by clicling on the line of the treeview with:

Case "Active"
Switch msg.id
Case "treeview"
...

I get "Cannot find MOAI object "Off"!"

What is this object "Off"?
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Treeview and XML

Post by plouf »

papiosaur wrote: Fri Jan 26, 2024 10:12 am i read documentation of XML plugin but unfortunnaly i understand how to edit a value in a treeview...
XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
papiosaur wrote: Fri Jan 26, 2024 10:12 am My colums are editable (editablenodes="true") but when double-clicking, nothing append... (under MorphOS).
example ?
papiosaur wrote: Fri Jan 26, 2024 12:34 pm New question, is it possible to have a selection gadget in a treeview (and listview)?
what is a "selection gadget" ? , if you mean to have some kind of excel style "blue border" i think not,

papiosaur wrote: Fri Jan 26, 2024 1:50 pm i have a strange thing:

When i click on a button 'Edit', i get the entries of a line in "textentry" cases.

If the same lines of code by clicling on the line of the treeview with:

Case "Active"
Switch msg.id
Case "treeview"
...

I get "Cannot find MOAI object "Off"!"

What is this object "Off"?
Example... most probably you have a typograph error and you have create an object "off" , while you think you set an option off somewhere.. womehow
Last edited by plouf on Fri Jan 26, 2024 2:28 pm, edited 1 time in total.
Christos
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
Yes, but how to edit data in a treeview please?
its editable , not editablenodes
it's "editable" for colums option but "editablenodes" for treeview class
what is a "selection gadget" ?
i speak about the choice class, sorry.
Example... most probably you have a typograph error and you have create an object "off" , while you think you set an option off somewhere.. womehow
i will search... but bizarre it work with "Edit" button and not when i click on the row...
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Treeview and XML

Post by plouf »

papiosaur wrote: Fri Jan 26, 2024 2:26 pm
XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
Yes, but how to edit data in a treeview please?
its editable , not editablenodes
it's "editable" for colums option but "editablenodes" for treeview class
in the past, i have confuse this query again :)
btw is this not selecteable in Morphos ? i double click My tasts or Open tast and it does
(ps i manualy enable editing in "Tasks" to see if it works

Code: Select all

xml$ = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
					
	<window id="win" title="Tasks" height="400" width="400">
		<vgroup>
			<treeview id="tv" height="250" notify="active" EditableNodes="true">
				<column title="first "/>
				<column title="Second"/>
				
				<node id="tasks" name="My Tasks" >
					<node id="open" name="Open Tasks" >
			
					</node>	
				</node>
			</treeview>
	
		</vgroup>
	</window>
</application>
]]

@REQUIRE "RapaGUI"

moai.CreateApp(xml$)


InstallEventHandler({RapaGUI = p_EventFunc})

moai.DoMethod("tv", "open", "root", True)
;Open Tasks
moai.DoMethod("tv", "insertleaf", 0 , "open", "Tail", "1-1", "1-2" )
moai.DoMethod("tv", "insertleaf", 1 , "open", "Tail", "1-2","2-2")
moai.DoMethod("tasks", "Edit")

; main loop!
Repeat
	WaitEvent
Forever
Christos
papiosaur
Posts: 161
Joined: Fri Mar 31, 2023 1:34 pm

Re: Treeview and XML

Post by papiosaur »

When i execute your code, it write: Cannot find MOAI object "tasks"' error line 34

I have tried to change object name but he don't find any object...

Maybe Edit mode is "Off" on MorphOS :-)
Post Reply