diff options
| author | Julian Hurst <julian.hurst92@gmail.com> | 2022-06-15 10:46:03 +0200 |
|---|---|---|
| committer | Julian Hurst <julian.hurst92@gmail.com> | 2022-06-15 10:46:03 +0200 |
| commit | a95fcb445bbc9299eb1d974ce34db8cf24622c10 (patch) | |
| tree | c88fee737c02c8f8894f2e08c35d85fa9a45dfd7 /libui/layout | |
| parent | aa288b25a00385e8b034735838f3d5cc512df93f (diff) | |
| download | ilhare-a95fcb445bbc9299eb1d974ce34db8cf24622c10.tar.gz | |
Externalize modules and add .gitignore
Diffstat (limited to 'libui/layout')
| -rw-r--r-- | libui/layout/layout.ha | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/libui/layout/layout.ha b/libui/layout/layout.ha deleted file mode 100644 index c15626f..0000000 --- a/libui/layout/layout.ha +++ /dev/null @@ -1,44 +0,0 @@ -use libui; -use libui::widget; -use io; -use unix::tty; -use fmt; -use os; - -export type layout = struct { - widgets: []*widget::widget, -}; - -// Create and return a new layout from a list of widgets. [[finishall]] must be -// called to properly free the widget's nad layout's resources. -export fn newlayout(widgets: *widget::widget...) layout = { - return layout { - widgets = widgets, - }; -}; - -// Display all the widgets contained in the given layout. -export fn print(layout: layout) (void | widget::error) = { - libui::clear(layout.widgets[0].ui); - for (let i = 0z; i < len(layout.widgets); i += 1) { - match (layout.widgets[i].print) { - case null => - return; - case let f: *widget::print => - f(layout.widgets[i])?; - }; - }; -}; - -// Finish and free the widgets in the given layout. -export fn finishall(layout: *layout) void = { - for (let i = 0z; i < len(layout.widgets); i += 1) { - match (layout.widgets[i].finish) { - case null => - return; - case let f: *widget::finish => - f(layout.widgets[i]); - }; - }; - free(layout.widgets); -}; |
