[sword-devel] Best way to work with Genbooks

David "Judah's Shadow" Blue yudahsshadow at gmx.com
Wed Mar 6 11:48:22 EST 2024


On Wednesday, March 6, 2024 10:01:38 AM EST Troy A. Griffitts wrote:
> Hey David,  glad you are making progress on the TOC.
> 
> Yes, assureKeyPath will create the full path if it doesn't exist.
> 
> If you would simply like to try to position a treekey to a path, you can
> set it like any other SWKey, by simply assigning it to a string value or
> using the setText() method.
> 
> Then you can check for error afterward, specifically it should be set to
> KEYERR_OUTOFBOUNDS if it doesn't exist.


Just treating it as a SWKey seems to work just fine. If the EarlyFathers module 
is any indication, giving an invalid key hits the first child after /TOC. The 
structure is a bit unwieldy for having to type out keys, but that I think is 
thet cost of not having a UI that allows for picking piece parts from the TOC. 
I might see if I can come up with a better way to interface with books later 
on. But what I have will suit my needs for the next release, at least.




More information about the sword-devel mailing list