Commit 7ff3ce92c391114db61aac6a78e305f87c8210d6

Thomas de Grivel 2024-12-16T14:54:30

gtk4: scrolled_window

diff --git a/gtk4/scrolled_window.c b/gtk4/scrolled_window.c
new file mode 100644
index 0000000..5e95a59
--- /dev/null
+++ b/gtk4/scrolled_window.c
@@ -0,0 +1,28 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include "scrolled_window.h"
+
+GtkWidget ** kc3_gtk4_scrolled_window_new (GtkWidget **dest)
+{
+  GtkWidget *tmp;
+  if (! (tmp = gtk_scrolled_window_new()))
+    return NULL;
+  *dest = tmp;
+  return dest;
+}
+
+void kc3_gtk4_scrolled_window_set_child (GtkScrolledWindow **sw,
+                                         GtkWidget **child)
+{
+  gtk_scrolled_window_set_child(*sw, *child);
+}
diff --git a/gtk4/scrolled_window.h b/gtk4/scrolled_window.h
new file mode 100644
index 0000000..aea1591
--- /dev/null
+++ b/gtk4/scrolled_window.h
@@ -0,0 +1,25 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef KC3_GTK4_SCROLLED_WINDOW_H
+#define KC3_GTK4_SCROLLED_WINDOW_H
+
+#include "types.h"
+
+/* Heap-allocation functions. */
+GtkWidget ** kc3_gtk4_scrolled_window_new (GtkWidget **dest);
+
+/* Operators. */
+void kc3_gtk4_scrolled_window_set_child (GtkScrolledWindow **sw,
+                                         GtkWidget **child);
+
+#endif /* KC3_GTK4_SCROLLED_WINDOW_H */
diff --git a/lib/kc3/0.1/gtk4/scrolled_window.kc3 b/lib/kc3/0.1/gtk4/scrolled_window.kc3
new file mode 100644
index 0000000..bd237bf
--- /dev/null
+++ b/lib/kc3/0.1/gtk4/scrolled_window.kc3
@@ -0,0 +1,8 @@
+defmodule Gtk4.ScrolledWindow do
+
+  def new = cfn Ptr "kc3_gtk4_scrolled_window_new" (Result)
+
+  # set_child(scrolled_window, widget) -> void
+  def set_child = cfn Void "kc3_gtk4_scrolled_window_set_child" (Ptr, Ptr)
+
+end