I am trying to write a program to maintain several SQLite3 databases, I have come across an issue that i can not solve.
Code: Select all
/*** This script requires the RapaGUI plugin*/
@REQUIRE "RapaGUI"
/*** Setup GUI ********************************************************************************************/
moai.CreateApp([[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="dbwin" title=" SQL Database Mender " width="1440" height="1024" notify="closerequest">
<vgroup>
<pageview id="tab" fontsize="Big">
<vgroup title=" Database Data ">
<listview id="dblist">
<column title="Row ID" id="rowid">
</column>
</listview>
</vgroup>
<vgroup title=" Database Record " id="econtainer">
<vgroup id="container" frame="true" weight="50">
<rectangle/>
</vgroup>
</vgroup>
</pageview>
</vgroup>
</window>
</application>]])
/*** RAPAGUI Events ****************************************************************************************/
Function Rapa_Events(msg)
Switch msg.action
Case "RapaGUI"
Switch msg.attribute
Case "CloseRequest"
End
EndSwitch
EndSwitch
EndFunction
/*** listen to these events ********************************************************************************/
InstallEventHandler({RapaGUI = Rapa_Events})
; 10 could be from 1 to 60 depending on the Database columns found
Xml$ = ""
For t = 0 To 10
xml$ = xml$ .. "<hgroup><text id=\"col"..StrStr(t) .. "\"> Col "..StrStr(t) .. "</text> <text id=\"col"..StrStr(t) .. "text\">xx</text></hgroup>"
Next
moai.CreateObject("<vgroup id=\"rlist\">"..xml$.."</vgroup>", "container")
moai.DoMethod("container", "initchange")
moai.DoMethod("container", "append", "rlist")
moai.DoMethod("container", "exitchange", False)
/*** main loop ********************************************************************************************/
Repeat
WaitEvent
Forever
Not sure that I am doing something wrong or missed a command to refresh the screen.
Can anyone show me a better way of achieving this.
Edit : it may have something to do with the Pageview object?
Thanks
Leo