Commit 1d42880fdb12a74b63da6b8ab61f297e3536b996

Thomas de Grivel 2024-12-16T15:44:48

kmsg mockup

diff --git a/kmsg/kmsg.kc3 b/kmsg/kmsg.kc3
index 890261b..736d2e2 100755
--- a/kmsg/kmsg.kc3
+++ b/kmsg/kmsg.kc3
@@ -8,6 +8,7 @@ defmodule Kmsg do
   require Gtk4.Box
   require Gtk4.Button
   require Gtk4.Frame
+  require Gtk4.Label
   require Gtk4.ListBox
   require Gtk4.Paned
   require Gtk4.TextView
@@ -20,19 +21,32 @@ defmodule Kmsg do
     Gtk4.Window.set_default_size(window, (Uw) 640, (Uw) 480)
     paned = Gtk4.Paned.new(:horizontal)
     Gtk4.Widget.set_size_request(paned, 200, 200);
-    # frame1 = Gtk4.Frame.new("Frame 1")
-    list_box1 = Gtk4.ListBox.new()    
-    Gtk4.Paned.set_start_child(paned, list_box1)
+    scrolled_window1 = Gtk4.ScrolledWindow.new()
+    list_box1 = Gtk4.ListBox.new()
+    labels1 = List.map(List.count(20), fn (x) {
+      label = Gtk4.Label.new("Label")
+      Gtk4.Widget.set_halign(label, :start)
+      Gtk4.ListBox.append(list_box1, label)
+      label
+    })
+    Gtk4.ScrolledWindow.set_child(scrolled_window1, list_box1)
+    Gtk4.Paned.set_start_child(paned, scrolled_window1)
     Gtk4.Paned.set_resize_start_child(paned, true)
     Gtk4.Paned.set_shrink_start_child(paned, false)
-    Gtk4.Widget.set_size_request(frame1, 50, 50)
     box1 = Gtk4.Box.new(:vertical, 0)
-    frame2 = Gtk4.Frame.new("Frame 2")
-    Gtk4.Widget.set_vexpand(frame2, true)
+    scrolled_window2 = Gtk4.ScrolledWindow.new()
+    list_box2 = Gtk4.ListBox.new()
+    Gtk4.Widget.set_vexpand(list_box2, true)
+    labels2 = List.map(List.count(200), fn (x) {
+      label = Gtk4.Label.new("thodg: message")
+      Gtk4.Widget.set_halign(label, :start)
+      Gtk4.ListBox.append(list_box2, label)
+      label
+    })
     Gtk4.Paned.set_resize_end_child(paned, false)
     Gtk4.Paned.set_shrink_end_child(paned, false)
-    Gtk4.Widget.set_size_request(frame2, 50, 50)
-    Gtk4.Box.append(box1, frame2)
+    Gtk4.ScrolledWindow.set_child(scrolled_window2, list_box2)
+    Gtk4.Box.append(box1, scrolled_window2)
     box2 = Gtk4.Box.new(:horizontal, 0)
     Gtk4.Box.append(box1, box2)
     Gtk4.Paned.set_end_child(paned, box1)