vlang / ui

A cross-platform UI library written in V
MIT License
2.32k stars 154 forks source link

The examples are compiled, but not run. #484

Closed Keyn1 closed 1 year ago

Keyn1 commented 1 year ago

V version: 0.3.1 UI version: last *OS:windows 10*

What did you do? The examples are compiled, but not run.

What did you expect to see? File: C:/V/v-master/thirdparty/sokol/sokol_gfx.h Line: 15461 Expression: _sg.valid

What did you see instead?

tehando commented 1 year ago

All "ui" examples give the same output for Arch based Linux/GNU platform = Linux-6.0.2-arch1-1-x86_64-with-glibc2.36

...examples]$ ./slider V panic: toml.checker.Checker.check_number numbers like "0." (float) can not end with . in ...radius = 0.\nbg_color... v hash: d781396 /tmp/v_1000/slider.7555115272680828670.tmp.c:23643: at _v_panic: Backtrace /tmp/v_1000/slider.7555115272680828670.tmp.c:60629: by uiparse_style_toml_file /tmp/v_1000/slider.7555115272680828670.tmp.c:60681: by uiUI_load_style_from_file /tmp/v_1000/slider.7555115272680828670.tmp.c:60676: by uiUI_load_styles /tmp/v_1000/slider.7555115272680828670.tmp.c:58063: by ui__window /tmp/v_1000/slider.7555115272680828670.tmp.c:2464: by mainmain /tmp/v_1000/slider.7555115272680828670.tmp.c:3386: by main

Bellisario commented 1 year ago

Same problem for me

igrekus commented 1 year ago

Reproduces on Ubuntu 20.04 also.

frpaulas commented 1 year ago

same on pop 22.04

vaaski commented 1 year ago

Same on macOS Monterey

spytheman commented 1 year ago

I could not reproduce the problem with latest V and latest ui.

Please anyone who can reproduce it, try if the following fixes it:

mv ~/.vmodules/ui ~/.vmodules/old_ui
v up
v install ui
v run ~/.vmodules/ui/examples/slider.v
spytheman commented 1 year ago

I found the problem - I had a preexisting ~/.vui/styles/ folder containing valid .toml files. Latest V or UI, not sure yet, produces invalid .toml files, if they are missing.

spytheman commented 1 year ago

A preliminary fix (just ignoring the invalid .toml files is in latest ui 95d98d8).

frpaulas commented 1 year ago

looks good, 10Q

tehando commented 1 year ago

Examples are ok, you can close this issue.

Keyn1 commented 1 year ago

Downloaded the latest versions: v + ui

work ok: demo_canvaslayout.exe , demo_radio.exe , slider.exe , grid.exe

error: change_title.exe , child_window.exe , group2_resizable.exe , users.exe

C:\Users\Keyn.vmodules\ui\examples>Unhandled Exception 0xC0000005 ↑ C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:23692: at print_backtrace_skipping_top_frames_tcc: Backtraceны C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:23659: by print_backtrace_skipping_top_frames C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:23717: by unhandled_exception_handler 7ffe7f088b9c : by ??? 7ffe7d6943d7 : at ???: RUNTIME ERROR: invalid memory access C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:54969: by uiStack_draw_device C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:54969: by ui__Stack_draw_device C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:54942: by uiStack_draw C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:55596: by uiframe C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:40819: by gggg_frame_fn C:/V/v-master/thirdparty/sokol/sokol_app.h:2630: by _sapp_call_frame C:/V/v-master/thirdparty/sokol/sokol_app.h:2833: by _sapp_frame C:/V/v-master/thirdparty/sokol/sokol_app.h:7198: by _sapp_win32_run C:/V/v-master/thirdparty/sokol/sokol_app.h:11234: by sapp_run C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:39393: by sokolsapp__run C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:41053: by ggContext_run C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:59253: by ui__run C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:65372: by main__main C:/Users/Keyn/AppData/Local/Temp/v_0/users.1061303563581735944.tmp.c:789: by wWinMain 006ea08f : by ??? 006ea1f0 : by ??? 7ffe7d347034 : by ???