]> uap-core.de Git - rssreader.git/commitdiff
rss reader gui prototype
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 15 Jul 2025 18:30:30 +0000 (20:30 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 15 Jul 2025 18:30:30 +0000 (20:30 +0200)
rss-application/src/main/kotlin/Main.kt [deleted file]
rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt [new file with mode: 0644]
rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt [new file with mode: 0644]

diff --git a/rss-application/src/main/kotlin/Main.kt b/rss-application/src/main/kotlin/Main.kt
deleted file mode 100644 (file)
index 4e66522..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package de.unixwork.rssreader
-
-//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
-// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
-fun main() {
-    val name = "Kotlin"
-    //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
-    // to see how IntelliJ IDEA suggests fixing it.
-    println("Hello, " + name + "!")
-
-    for (i in 1..5) {
-        //TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
-        // for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
-        println("i = $i")
-    }
-}
\ No newline at end of file
diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt
new file mode 100644 (file)
index 0000000..4d1b0a5
--- /dev/null
@@ -0,0 +1,16 @@
+package de.unixwork.rssreader
+
+import de.unixwork.ui.Application
+import de.unixwork.ui.Toolkit
+
+class App : Application {
+    override fun startup() {
+        val window = MainWindow()
+        window.show()
+    }
+}
+
+fun main() {
+    Toolkit.init("rssreader")
+    Toolkit.runApplication(App())
+}
diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt
new file mode 100644 (file)
index 0000000..4bab4e9
--- /dev/null
@@ -0,0 +1,38 @@
+package de.unixwork.rssreader
+
+import de.unixwork.ui.SubListItem
+import de.unixwork.ui.UiObject
+import de.unixwork.ui.kotlin.Toplevel
+import de.unixwork.ui.kotlin.sidebarWindow
+
+class MainWindow {
+    val window : Toplevel
+
+    init {
+        window = sidebarWindow("RSS Reader") {
+            sidebar {
+                sourcelist { elm: Object ->
+                    val item = SubListItem()
+                    item.label = "todo"
+                    item
+                }
+            }
+
+            hsplitpane(initialPosition = 300) {
+                vbox {
+                    listview<String>(varname = "items", fill = true) { elm, col ->
+                        "todo"
+                    }
+                }
+
+                vbox {
+                    webview(varname = "webview", fill = true)
+                }
+            }
+        }
+    }
+
+    fun show() {
+        window.show()
+    }
+}
\ No newline at end of file