; ; This little application pops up a launcher menu. ; ; @ANO_SCRIPT_NAME gui_deskmenu ; @ANO_SCRIPT_VERSION 0.0.4 ; @ANO_SCRIPT_DESCRIPTION Simple application launcher menu ; ; @ANO_FLAGS_VAR_NAME_SUBS [x] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2024, Jani Salonen ; All rights reserved. ; main { ; Global uninitialized variables var [handle] handle_window_main ; Initialize windowing system window_init ; Open main window window_open (\ title_name: NULL, \ title_charset: NULL, \ parent_handle: NOPARENT, \ widget_stack_id: 1, \ widget_set: 0, \ window_refresh_divider: PASSIVE_REFRESH, \ position_x: POS_CENTERED, \ position_y: POS_CENTERED, \ size_width: 200, \ size_height: 40, \ cb_main_loop: NULL, \ cb_expose: NULL, \ cb_key_press: NULL, \ cb_key_release: NULL, \ cb_button_press: NULL, \ cb_button_release: NULL, \ cb_client_message: NULL, \ cb_configure_notify: NULL, \ cb_destroy_notify: "cb_destroy", \ cb_motion_notify: NULL, \ cb_map_notify: NULL, \ cb_unmap_notify: NULL, \ cb_open_notify: "cb_open") } callback cb_open (_hnd) { mov handle_window_main (_hnd) ; Window to above all others window_set_attrs (handle_window_main, ALWAYS_ABOVE, SET_ON) ; Window border off window_set_attrs (handle_window_main, SET_BORDER, SET_OFF) ; Map main window window_map (handle_window_main) } callback cb_destroy { window_close (handle_window_main) exit } callback cb_button_press (_x, _y, _x_root, _y_root, _state, _button) { } callback cb_exit (_item, _position, _tag, _flag) { ; It's okay to jump around to another table jmp "cb_destroy" } callback cb_launch (_item, _position, _tag, _flag) { ; Internet menu if _tag == 1 : &cb_launch_it ("firefox") if _tag == 2 : &cb_launch_it ("opera") ; Multimedia menu if _tag == 10 : &cb_launch_it ("vlc") } function cb_launch_it (_app) { ; Execute the application exec (_app) }