/ Published in: R
URL: http://rebol.wik.is/Code_Samples/Systray.r
Expand |
Embed | Plain Text
REBOL [ Title: "Systray Example" File: %systray.r Purpose: { Installs a tray icon (Windows only) and then starts a forever loop } Date: 28-Nov-2008 Version: 0.0.1 History: [ abstracted from Gabriele's clips.r ] ] set-tray: has [menu] [ menu: compose [ restore: "Restore" bar quit: "Quit" ] set-modes system/ports/system compose/deep/only [ tray: [ add main [ help: "S3Backup" menu: (menu) ] ] ] ] system/ports/system/awake: func [port /local msg] [ while [msg: pick port 1] [ if find/match msg [tray main menu] [ msg: last msg switch/default msg [ restore [ inform layout [ across vh2 "Title" gold return btn "Close" [hide-popup] ] set-tray ] quit [ set-modes port [tray: [remove main]] quit ] ] [ print "an undefined message was received" ] ] ] false ] insert tail system/ports/wait-list system/ports/system set-tray forever [ wait 5 print "doing something" ]
You need to login to post a comment.
