summaryrefslogtreecommitdiff
path: root/Base/usr/share/man/man5/GML-Define-widget.md
diff options
context:
space:
mode:
authorelectrikmilk <brandonjordan124@gmail.com>2022-02-09 18:11:07 -0500
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-03-03 14:59:00 -0800
commit58a865f34967c750dab86929bcdaf603ce0cde3e (patch)
treeb82d696f291be37b53759837b22ef2281003c441 /Base/usr/share/man/man5/GML-Define-widget.md
parentd01d754b83a03beb372046e5db24644289341516 (diff)
downloadserenity-58a865f34967c750dab86929bcdaf603ce0cde3e.zip
Base+Manpages: Add basic GML documentation
First draft of GML documentation, just to get things started.
Diffstat (limited to 'Base/usr/share/man/man5/GML-Define-widget.md')
-rw-r--r--Base/usr/share/man/man5/GML-Define-widget.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/Base/usr/share/man/man5/GML-Define-widget.md b/Base/usr/share/man/man5/GML-Define-widget.md
new file mode 100644
index 0000000000..4628104c1e
--- /dev/null
+++ b/Base/usr/share/man/man5/GML-Define-widget.md
@@ -0,0 +1,36 @@
+## Name
+
+Library or Application Defined Widgets
+
+## Description
+
+Some applications and libraries find it useful to define their own **LibGUI** widgets.
+
+## Examples
+
+```gml
+@Web::OutOfProcessWebView {
+ name: "web_view"
+ min_width: 340
+ min_height: 160
+ visible: false
+}
+```
+
+They are defined using `REGISTER_WIDGET()`, just as they are in **LIbGUI**.
+
+```cpp
+REGISTER_WIDGET(Web, OutOfProcessWebView)
+
+...
+
+OutOfProcessWebView::OutOfProcessWebView()
+{
+ set_should_hide_unnecessary_scrollbars(true);
+ set_focus_policy(GUI::FocusPolicy::StrongFocus);
+
+ create_client();
+}
+
+...
+```