Home

Awesome

MUI - A Cross-Platform UI Library for V & C

MUI Demo

Supports Windows, Linux, Android<sup>1</sup> & Web<sup>2</sup> (Experimental). Not tested on MacOS<sup>3</sup>.

1: System themes & map widget not working on Android now. If you interested with compiling for android, look here

2: With Emscripten. System themes & map widget not working now. If you interested with compiling for web, look here

3: All critical processes (like Widget drawing, click handling etc.) should work on MacOS. But themes and screen reader won't work, and could be include MacOS-only bug.

Example

import malisipi.mui as m

fn increase_count(event_details m.EventDetails,mut app &m.Window, mut app_data voidptr){
	unsafe {
		app.get_object_by_id("count")[0]["text"].str = (app.get_object_by_id("count")[0]["text"].str.int() + 1).str()
	}
}

mut app := m.create(title:"Counter - MUI Example", height:100, width:400)

app.label(id:"count", x:"5%x", y:"5%y", width:"45%x", height:"90%y" text:"0")
app.button(id:"count_button", x:"# 5%x", y:"5%y", width:"45%x", height:"90%y", text:"Count", onclick:increase_count)

app.run()

You can find more examples in ./examples/ folder. Also you can visit Gallery that lists applications screenshots uses MUI.

You can test MUI easily from here.

Abilities

To see all created and planned features, look up To-Do List

Thirdparty Widgets/Plugins

You can make your MUI applications more powerful with plugins.

Browse MUI plugin list

Installation

To install, run v install https://github.com/malisipi/mui

To remove, run v remove malisipi.mui

Compile-Time Flags

FlagsDescription
-d show_fpsShow FPS of the window
-d no_emojiDisable emoji support and font embedding
-d emscriptenCompile for emscripten (use with -os wasm32-emscripten)
-d dont_clipFor debugging purposes, it disables clipping the widgets area. (Not recommend)
-d power_saveEnables power save mode. It's recommend if your application require more resource or you're running the application on low-hardware computer. Some drawing lags would be appeared with the flag, please report them.
-d support_japanese_inputSupport basic japanese input

Compile for android

Compile with emscripten

How to compile demo.v with emscripten:

[~/.vmodules/malisipi/mui/examples]$ v -d emscripten -d no_emoji -gc none -os wasm32-emscripten demo.v -o emscripten_.c

[~/.vmodules/malisipi/mui/examples]$ cat emscripten_.c | sed 's/waitpid(p->pid, &cstatus, 0);/-1;/g' | sed 's/waitpid(p->pid, &cstatus, WNOHANG);/-1;/g' | sed 's/wait(0);/-1;/g' &> emscripten.c

[path/to/dir/v]$ emcc -fPIC -Wimplicit-function-declaration -w  thirdparty/stb_image/stbi.c -I/usr/include/gc/   -Ithirdparty/stb_image -Ithirdparty/fontstash -Ithirdparty/sokol -Ithirdparty/sokol/util    -DSOKOL_GLES2 -DSOKOL_NO_ENTRY   -DNDEBUG -O3   -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ALLOW_MEMORY_GROWTH -s MODULARIZE -s ASSERTIONS=1 ~/.vmodules/malisipi/mui/examples/emscripten.c -o ~/.vmodules/malisipi/mui/examples/app.js --embed-file ~/.vmodules/malisipi/mui/assets/noto.ttf@/noto.ttf --embed-file ~/.vmodules/malisipi/mui/examples/v-logo.png@v-logo.png

How to Compile Programs that use malisipi.mui.webview?

Known Bugs

For Windows;

If you have a problem/question or feature request about MUI, you can create a issue.

FAQ

<details><summary><b>How to use TCC on Windows</b></summary> </details> <details><summary><b>MUI is freezing with blank window and crashing with `gg error: WGL: ARB_create_context_profile required!` error (For Windows OS)</b></summary>

Probably, it's a issue about your drivers. You will need to ensure that you have downloaded and installed a recent driver for your graphics hardware. If your system does not contain a GPU, or the GPU vendor delivers graphics drivers providing OpenGL support that's so old as to be useless to you, you might want to consider installing the Mesa3D OpenGL library on your system.

Installing Mesa3D on Windows

Also you can download pre-built library from here

</details> <details><summary><b>MUI not working with old-V versions</b></summary>

V is still beta and MUI require to break support of V's old versions to supporting latest.

or

</details> <details><summary><b>What is operating system of test devices?</b></summary> </details> <details><summary><b>Can I have tray library for MUI?</b></summary>

VTray library is created for this goal. So we don't require an built-in tray library for MUI. If you see any issue about MUI interoperability with this library, please report it to fix it.

</details>

Suggestions

License

Documentation

You can read documentation from these links.