class App : Application {
override fun startup() {
val window = MainWindow()
+
+ val data = FeedSourceList()
+ window.window.ui.attach(data)
+
window.show()
}
--- /dev/null
+package de.unixwork.rssreader
+
+
+class Feed(uri: String) {
+ val uri = uri
+}
--- /dev/null
+package de.unixwork.rssreader
+
+import de.unixwork.ui.Document
+
+class FeedCollection(name: String) : Document() {
+ private val name = name
+ private val items = list<Item>("items")
+}
\ No newline at end of file
--- /dev/null
+package de.unixwork.rssreader
+
+import de.unixwork.ui.Document
+import de.unixwork.ui.SubList
+
+class FeedSourceList : Document() {
+ val feeds = this.sourcelist("feeds")
+
+ init {
+ // testcode
+ val sublist1 = SubList<FeedCollection>()
+ sublist1.header = "Test 1"
+ val sublist1data = list<FeedCollection>("sublist1data")
+ val col1 = FeedCollection("Test Feed")
+ sublist1data.add(col1)
+ feeds.add(sublist1)
+ }
+}
\ No newline at end of file
--- /dev/null
+package de.unixwork.rssreader
+
+class Item {
+ val title: String? = null
+ val link: String? = null
+}
\ No newline at end of file
import de.unixwork.ui.SubListItem
import de.unixwork.ui.UiObject
+import de.unixwork.ui.UiSourceList
import de.unixwork.ui.kotlin.Toplevel
import de.unixwork.ui.kotlin.sidebarWindow
init {
window = sidebarWindow("RSS Reader") {
-
sidebar {
vbox(fill = true) {
- sourcelist(fill = true) { elm: Object ->
+ sourcelist(fill = true, varname = "feeds") { elm: Object ->
val item = SubListItem()
item.label = "todo"
item
}
hbox(margin = 4) {
- button(icon = "list-add")
+ button(icon = "list-add") {
+
+ }
}
}
}
}
}
+
+
fun show() {
window.show()
}