Skip to content

VUI Menu Can Not Be Removed or Switched From The Stack Like Other Widgets #603

@Wajinn

Description

@Wajinn

V version:

V 0.4.10 87f92b1

UI version:

V UI 0.0.4

OS:

Ubuntu 20.04

What did you do?

// If stack contain menu or is menu, will crash. Other widget types will succeed.

fn btn_click(btn &ui.Button) {
	mut stack := btn.ui.window.child()
	if mut stack is ui.Stack {
        stack.remove()
		stack.add(children:[new_stack()]) 
	}
	btn.ui.window.update_layout()
}

What did you expect to see?

No errors

What did you see instead?

/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:36361: at ui__MenuItem_set_menu_root_menu: RUNTIME ERROR: invalid memory access
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:36122: by ui__Menu_propagate_connection
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:36087: by ui__Menu_init
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:37193: by ui__Stack_init
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:37193: by ui__Stack_init
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:38035: by ui__Stack_add
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:43625: by main__btn_click
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:30064: by ui__btn_click
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:15782: by eventbus__Publisher_T_string_publish_T_string
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:15764: by eventbus__EventBus_T_string_publish_T_string
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:42979: by ui__window_click_or_touch_tap
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:43022: by ui__window_click_or_touch_tap_and_swipe
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:42714: by ui__on_event
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:21808: by gg__gg_event_fn
/ten/v/thirdparty/sokol/sokol_app.h:3099: by _sapp_call_event
/ten/v/thirdparty/sokol/sokol_app.h:10903: by _sapp_x11_mouse_event
/ten/v/thirdparty/sokol/sokol_app.h:11183: by _sapp_x11_on_buttonrelease
/ten/v/thirdparty/sokol/sokol_app.h:11382: by _sapp_x11_process_event
/ten/v/thirdparty/sokol/sokol_app.h:11596: by _sapp_linux_run
/ten/v/thirdparty/sokol/sokol_app.h:11655: by sapp_run
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:20435: by sokol__sapp__run
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:21987: by gg__Context_run
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:42173: by ui__run
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:43639: by main__main
/tmp/v_1000/demo_radio_menu.01JQX2SKY01VDHVBDP1WCZJZ5A.tmp.c:43887: by main

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions