; ; This little application pops up a launcher menu. ; ; @ANO_SCRIPT_NAME gui_deskmenu ; @ANO_SCRIPT_VERSION 0.0.6 ; @ANO_SCRIPT_DESCRIPTION Simple application launcher menu ; ; @ANO_FLAGS_VAR_NAME_SUBS [x] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2025, Jani Salonen ; All rights reserved. ; main { ; Initialize windowing system... ; gui_enabled { window_init ; ...and 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_save_yourself: 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") } } _WINCB_OPEN_ callback cb_open (_hnd) { ; Window is the topmost window ; _hnd.set_attrs(\ attribute: ALWAYS_ABOVE, \ attribute_value: SET_ON) ; Get borders off ; _hnd.set_attrs(\ attribute: SET_BORDER, \ attribute_value: SET_OFF) ; Ask for fetching menu settings and saving them back, consumer_name ; is defined in key column in menu definitions table ; settings_enabled { ; This is for Backlight -radio group... ; settings_register (\ consumer_name: "blight", \ consumer_class: SETTINGS_MENU) ; ...and this is for Save settings -check item ; settings_register (\ consumer_name: "saving", \ consumer_class: SETTINGS_MENU) } ; Map window ; _hnd.map() } _WINCB_DESTROY_ callback cb_destroy (_hnd) { _hnd.destroy() exit } _WIDGETCB_BUTTON_ callback cb_button_press (_hnd, _x, _y, _x_root, _y_root, _state, _button) { } _MENUCB_ITEM_ callback cb_exit (_item, _position, _tag, _flag) { exit } _MENUCB_ITEM_ 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") ; X Tools menu ; if _tag == 20 : &cb_launch_it ("xcalc") if _tag == 21 : &cb_launch_it ("xclock") if _tag == 22 : &cb_launch_it ("xterm") if _tag == 23 : &cb_launch_it ("xkill") if _tag == 30 : &cb_launch_30 (_flag) } function cb_launch_it (_app) { ; Execute the application ; exec (_app) } function cb_launch_30 (_flag) { ; Adjust 0-9 to 10-100 ; mul _flag (10) add _flag (10) ; Number to string for exec() ; ntos _flag exec ("xbacklight", "-set", _flag) }