Hi there!
I'm trying to build a new plugin for Serna, and just can't get the hang of the correct usage of the .spd files. To be more specific, I can't seem to get TabWidget to work. I've been reading the API guide [1] and the GUI Items guide [2], but the first one didn't cover TabWidgets and the second one is fairly ... general about their usage. I also searched the web about it, and didn't find anything, and the guiItems.xsd is also not really giving me specific details.
I'll now post my specific code, to let you get some hang of what I'm trying to do.
Code:
<uiItems>
<MainWindow>
<Widget>
<properties>
<name>widget1</name>
</properties>
<ListView>
<properties>
<name>foo1</name>
<parent>widget1</parent>
</properties>
<ListViewItem>
<properties>
<name>bar1</name>
<data>
<column>
<text>testing 1</text>
</column>
</data>
<parent>foo1</parent>
</properties>
</ListViewItem>
<ListViewItem>
<properties>
<name>bar2</name>
<data>
<column>
<text>testing 1+1</text>
</column>
</data>
<parent>foo1</parent>
</properties>
</ListViewItem>
</ListView>
</Widget>
</MainWindow>
</uiItems>
This way, everything is fine. I have a widget, though it may be ugly and misplaced, but its .. there. Now, when I change <Widget> to <TabWidget>; (this is just the same code as before, just substituted <Widget> with <TabWidget>, but maybe it's clearer that way)
Code:
<uiItems>
<MainWindow>
<TabWidget>
<properties>
<name>widget1</name>
</properties>
<ListView>
<properties>
<name>foo1</name>
<parent>widget1</parent>
</properties>
<ListViewItem>
<properties>
<name>bar1</name>
<data>
<column>
<text>testing 1</text>
</column>
</data>
<parent>foo1</parent>
</properties>
</ListViewItem>
<ListViewItem>
<properties>
<name>bar2</name>
<data>
<column>
<text>testing 1+1</text>
</column>
</data>
<parent>foo1</parent>
</properties>
</ListViewItem>
</ListView>
</TabWidget>
</MainWindow>
</uiItems>
... it suddenly stops showing anything. So now based on the documentation I came up with a few guesses. It says "TabWidget organizes its children as a stack with one child visible at a time. Current (visible) item can be chosen via tab bar at a top (or bottom - depending on properties) of TabWidget." in [2] (although I didn't find the property to change the visible item either), so I thought it would just take every sole children (in the xml-way) of itself, create a tab out if it, name it after the <inscription> element and be done with it, but apparently it isn't that way. I also tried stuff like munching it into other <Widget>s or something, but that wouldn't work either. I even tried reading out Custom Views or .spds from other plugins, but it occured to me that <TabWidget> was never really used, except for the Preferences dialog, from which I can't access the 'Save View' - Option, and the 'Search & Replace' - Dialog, which doesn't tell me its using <TabWidget>s either.
Sooo, please, if you have any hints for me how to properly make a Tab appear, tell me. It would be greatly appreciated!
Best Regards, Steph.
[1]
Using Serna API
[2]
Serna GUI Item Reference Guide