mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:57:44 +00:00
Base: Extend and improve the GML documentation
This is a bundle of changes to the "new" GML documentation that I just noticed two hours ago. - Fix a bunch of typos, wording and style - Rework layout object documentation (they're not widgets!) - Document most of the common properties - Finish (as for now) GML syntax documentation - Extend GML usage explanation - Add symlink "GML" so that man gml works - Add a categorized GML page list to the introduction man page - Cross-link much more Much of the editing of existing docs is clearing up incorrect or imprecise statements. Note that because of massive changes in some places, git won't recognize renames as such.
This commit is contained in:
parent
743922984c
commit
426a09ca4a
16 changed files with 430 additions and 113 deletions
|
@ -4,7 +4,17 @@ Library or Application Defined Widgets
|
|||
|
||||
## Description
|
||||
|
||||
Some applications and libraries find it useful to define their own **LibGUI** widgets.
|
||||
Some applications and libraries find it useful to define their own widgets.
|
||||
|
||||
This is done using `REGISTER_WIDGET()`, just as in **LibGUI**. The syntax of the macro is as follows:
|
||||
|
||||
```cpp
|
||||
REGISTER_WIDGET(namespace, class_name)
|
||||
```
|
||||
|
||||
This means that every registered widget has to be placed in a namespace. For applications that usually do not need their own namespace, a common approach is to use the application name as the namespace for these registered widgets.
|
||||
|
||||
Note that registered widgets need to be constructible without any arguments.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -17,9 +27,9 @@ Some applications and libraries find it useful to define their own **LibGUI** wi
|
|||
}
|
||||
```
|
||||
|
||||
They are defined using `REGISTER_WIDGET()`, just as they are in **LIbGUI**.
|
||||
|
||||
```cpp
|
||||
// OutOfProcessWebView.cpp
|
||||
|
||||
REGISTER_WIDGET(Web, OutOfProcessWebView)
|
||||
|
||||
...
|
||||
|
@ -34,3 +44,7 @@ OutOfProcessWebView::OutOfProcessWebView()
|
|||
|
||||
...
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [GML Define property(5)](help://man/5/GML-Define-property)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue