Hash :
d1e40886
Author :
Jeremy JEANNE
Date :
2024-12-16T14:52:42
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#!/usr/bin/env ikc3
defmodule Kmsg do
require Gtk4
require Gtk4.Application
require Gtk4.ApplicationWindow
require Gtk4.Box
require Gtk4.Button
require Gtk4.Frame
require Gtk4.ListBox
require Gtk4.Paned
require Gtk4.TextView
require Gtk4.Widget
require Gtk4.Window
def activate = fn (app) {
window = Gtk4.ApplicationWindow.new(app)
Gtk4.Window.set_title(window, "Kmsg")
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)
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)
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)
box2 = Gtk4.Box.new(:horizontal, 0)
Gtk4.Box.append(box1, box2)
Gtk4.Paned.set_end_child(paned, box1)
Gtk4.Window.set_child(window, paned)
text_view = Gtk4.TextView.new()
Gtk4.Widget.set_hexpand(text_view, true)
Gtk4.Box.append(box2, text_view)
button = Gtk4.Button.new_with_label("Send")
Gtk4.Box.append(box2, button)
Gtk4.Paned.set_position(paned, 240);
Gtk4.Window.present(window)
}
def main = fn () {
puts("Kmsg.main: starting, please wait...")
Gtk4.init()
app = Gtk4.Application.new("Kmsg", "io.kmx.kmsg")
Gtk4.signal_connect(app, "activate", Kmsg.activate)
status = Gtk4.Application.run(app)
puts("Kmsg.main: exiting: #{inspect(status)}")
Gtk4.Application.delete(app)
status
}
end
Kmsg.main()