{"slug": "tourbillon-watch-desktop-widget-for-windows-8-red-programming-language", "title": "Tourbillon Watch Desktop Widget for Windows 8+ (Red Programming Language)", "summary": "A developer using the Red programming language created a Tourbillon Watch desktop widget for Windows 8 and later, inspired by Hiiamboris's Cellestial Clock and assisted by Gemini AI. The widget features a realistic tourbillon mechanism with animated gears, hands, and sub-dials for month and weekday display.", "body_md": "| Red [ | |\n| title: \"Tourbillon Watch Desktop Widget for Windows 8+\" | |\n| author: \"hinjolicious\" | |\n| note: { | |\n| Idea: @hiiamboris work on \"Cellestial Clock\". | |\n| Collaborator: Gemini AI | |\n| Tested: on Red Toolchain v0.66 in Windows 11 | |\n| June 13th, 2026 | |\n| } | |\n| needs: 'view | |\n| ] | |\n| w8+?: not find get in os-info 'name \"Windows 7\" | |\n| ; >> os-info | |\n| ;== make object! [ | |\n| ; name: \"Windows 11\" | |\n| ; arch: 'x86-64 | |\n| ; version: 10.0.0 | |\n| ; build: 22621 | |\n| ;] | |\n| ;>> find get in os-info 'name \"Windows\" | |\n| ;== \"Windows 11\" ==> return true if not windows 7 | |\n| on-over: [if event/down? [w/offset: w/offset + event/offset]] ; to drag app window | |\n| w-flags: [no-title no-border all-over] | |\n| ; --- Visual Assets Definitions --- | |\n| back-plate: [pen coal line-width 1 circle 200x200 190] | |\n| pin-s: [circle 0x0 5] | |\n| pin: [circle 0x0 15] | |\n| scales-s: compose append/dup [] [line-width 1 pen gray [rotate 1 0x0 line 0x-185 0x-190]] 360 | |\n| scales-m: compose append/dup [] [line-width 1 pen gray [rotate 6 0x0 line 0x-165 0x-190]] 100 | |\n| scales-h: compose append/dup [] [rotate 30 0x0 shape [move 0x-150 line 4x-150 4x-180 -4x-180 -4x-150 close]] 12 | |\n| h-sec: [rot-sec: rotate 0 0x0 shape [ | |\n| move 0x-185 line | |\n| 1x-183 1x-135 8x-110 2x-103 5x50 | |\n| -5x50 -2x-103 -8x-110 -1x-135 -1x-183 close]] | |\n| h-min: [rot-min: rotate 0 0x0 shape [move 0x-165 line 5x-155 5x0 -5x0 -5x-155 close]] | |\n| h-hour: [rot-hour: rotate 0 0x0 shape [move 0x-130 line 5x-120 5x0 -5x0 -5x-120 close]] | |\n| twelve: [shape [move 0x-135 line 12x-180 -12x-180 close]] | |\n| shadow: [translate (4, 4) pen off fill-pen 0.0.0.150] | |\n| ; left sub-dial (month) | |\n| months: compose append/dup [][line-width 2 pen gray [rotate 30 0x0 line 0x-45 0x-55]] 12 | |\n| h-month: [rot-mon: rotate 0 0x0 shape [move 1x-35 line 5x5 -5x5 -1x-35 close]] | |\n| ; right sub-dial (weekday) | |\n| dow: compose append/dup [][line-width 2 pen gray [rotate 51.42857142857143 0x0 line 0x-45 0x-55]] 7 | |\n| h-dow: [rot-dow: rotate 0 0x0 shape [move 1x-35 line 5x5 -5x5 -1x-35 close]] | |\n| ; tourbillon gears | |\n| escape-wheel-teeth: compose append/dup [][ | |\n| rotate 18 0x0 shape [move -1x-18 line 6x-27 7x-26 5x-23 7x-18 close]] 20 | |\n| escape-wheel: compose [rot-escape-wheel: rotate 0 0x0 | |\n| pen off fill-pen gray | |\n| (escape-wheel-teeth) | |\n| box -2x-19 2x19 box -19x-2 19x2] | |\n| hairspring: collect [repeat r 30 [if r % 3 = 0 [keep compose [circle 0x0 (r)]] ]] | |\n| hairspring-scale: compose [ | |\n| pen gray line-width 1 | |\n| scale-hairspring: scale 1 1 (hairspring)] | |\n| ; balance wheel | |\n| ballance-wheel-screws: compose append/dup [][rotate 90 0x0 box -3x-45 3x-35] 4 | |\n| ballance-wheel: compose [rot-balance-wheel: rotate 0 0x0 | |\n| pen off fill-pen linear gold 0.0 black 1.5 | |\n| (ballance-wheel-screws) | |\n| rotate 45 box -4x-40 4x40 | |\n| pen linear gold 0.0 black 3.5 line-width 5 fill-pen off circle 0x0 40 | |\n| ] | |\n| deep-gear-teeth: compose append/dup [][rotate 5 0x0 shape [move 0x-40 line 2x-35 -2x-35 close]] 72 | |\n| deep-gear: compose [ | |\n| pen off fill-pen linear coal 0.0 black 1.5 | |\n| (deep-gear-teeth) | |\n| circle 0x0 35] | |\n| cage-spokes: compose append/dup [] [rotate 120 0x0 | |\n| fill-pen linear silver 0.0 black 1.5 | |\n| box -5x-55 5x0 | |\n| circle 0x-55 8 | |\n| fill-pen #3333aa circle 0x-55 6 | |\n| ;fill-pen blue circle 0x-60 5 | |\n| ] 3 | |\n| cage-spokes-shadow: compose append/dup [] [rotate 120 0x0 | |\n| box -5x-55 5x0 | |\n| circle 0x-55 8 | |\n| ] 3 | |\n| top-cage: compose/deep/only [ | |\n| fill-pen off line-width 5 | |\n| pen linear silver 0.0 black 1.5 shape [move -48x28 arc 48x28 55 55 240 sweep large] | |\n| pen off [(cage-spokes)] | |\n| pen off fill-pen linear silver 0.0 black 1.5 circle 0x0 12 | |\n| fill-pen linear #ffaaff 0.0 #aa00aa 1.5 circle 0x0 8 | |\n| ;fill-pen pink circle 0x0 7 | |\n| ] | |\n| top-cage-shadow: compose/deep/only [ | |\n| [(cage-spokes-shadow)] | |\n| circle 0x0 10 | |\n| ] | |\n| cage: compose/deep/only [rot-cage: rotate 0 0x0 | |\n| ; no pallet fork yet! | |\n| translate 0x38 [(escape-wheel)] | |\n| push [ | |\n| translate 0x38 | |\n| line-width 8 pen linear silver 0.0 black 1.5 line 0x0 0x-38 | |\n| pen off fill-pen linear silver 0.0 black 1.5 circle 0x0 9 | |\n| fill-pen linear #ffaaff 0.0 #aa00aa 1.5 circle 0x0 6 | |\n| ;fill-pen pink circle 0x0 5 | |\n| ] | |\n| push (ballance-wheel) | |\n| push (hairspring-scale) | |\n| push [(shadow) (top-cage-shadow)] push (top-cage) | |\n| ] | |\n| drawing: compose/deep/only [ | |\n| scale 1.0 1.0 | |\n| push [pen off | |\n| fill-pen linear 10.10.10 0.5 silver 3.5 circle 200x200 197 | |\n| fill-pen 20.20.20 circle 200x200 145] | |\n| ; brand | |\n| push [translate 200x200 | |\n| font (make font! [size: 20 style: 'normal]) pen red text -25x-116 \"RED\" | |\n| font (make font! [size: 12 style: 'italic]) pen gray text -44x-85 \"The Reducer\" | |\n| font (make font! [size: 10 style: 'normal]) text -47x-65 \"PROFESSIONAL\"] | |\n| ; Left sub-dial | |\n| push [pen off | |\n| fill-pen linear 10.10.10 0.5 silver 3.5 circle 115x200 59 | |\n| fill-pen 20.20.20 circle 115x200 40] | |\n| push [translate 115x200 | |\n| push (months) | |\n| fill-pen linear white 0.0 black 1.5 | |\n| push [(shadow) (h-month)] push (h-month) | |\n| pen gray text -15x-35 \"Month\" | |\n| font (make font! [size: 12 style: 'normal]) text -36x-12 (form now/day)] | |\n| ; Right sub-dial | |\n| push [pen off | |\n| fill-pen linear 10.10.10 0.5 silver 3.5 circle 285x200 59 | |\n| fill-pen 20.20.20 circle 285x200 40] | |\n| push [translate 285x200 | |\n| push (dow) | |\n| fill-pen linear white 0.0 black 1.5 | |\n| push [(shadow) (h-dow)] push (h-dow) | |\n| pen gray text -20x-35 \"Weekday\" | |\n| font (make font! [size: 12 style: 'normal]) text 12x-12 (form either now/time > 12:0:0 [\"PM\"][\"AM\"]) | |\n| ] | |\n| ; Scales | |\n| push [translate 200x200 pen off | |\n| push (scales-s) push (scales-m) | |\n| fill-pen linear silver 0.0 black 1.5 | |\n| push [(shadow) (scales-h)] push (scales-h) | |\n| push [(shadow) (twelve)] push (twelve)] | |\n| ; Tourbillon window | |\n| push [ | |\n| fill-pen linear black 0.0 silver 1.5 circle 200x300 70 | |\n| fill-pen black circle 200x300 65] | |\n| ; Tourbillon core | |\n| push [translate 200x300 | |\n| push (deep-gear) | |\n| push (cage)] | |\n| ; Hands Layer | |\n| push [translate 200x200 | |\n| line-join bevel pen off | |\n| fill-pen linear white 0.0 black 1.5 | |\n| push [(shadow) (h-hour)] push (h-hour) | |\n| push [(shadow) (h-min)] push (h-min) (pin) | |\n| fill-pen linear red 0.0 black 1.5 | |\n| push [(shadow) (h-sec)] push (h-sec) (pin-s) | |\n| ] | |\n| ] | |\n| app-body: compose [ | |\n| title \"Tourbillon\" | |\n| backdrop black | |\n| box: box 400x400 | |\n| draw drawing | |\n| rate 99 on-time [ | |\n| ftime: to-float time: now/time/precise | |\n| ; main dial calculations | |\n| rot-sec/2: ftime % 60 * 6 | |\n| rot-min/2: ftime % 3600 / 10 | |\n| rot-hour/2: ftime / 120 | |\n| ; left sub-dial | |\n| mo: now/month rot-mon/2: mo % 12 * 30 | |\n| ; right sub-dial | |\n| wd: now/weekday rot-dow/2: wd % 7 * 51.42857142857143 | |\n| ; tourbillon | |\n| ; --- HIGH-REALISM, BUTTERY-SMOOTH TOURBILLON ENGINE --- | |\n| rot-cage/2: rot-sec/2 | |\n| ; 1. Smooth Balance Wheel Oscillation | |\n| ; Dropping from 1000.0 to 12.0 slows down the raw radian velocity | |\n| ; to a perfectly rhythmic, hardware-frame-locked 3.8Hz beat. | |\n| ; We use 80.0 degrees to ensure smooth frame steps on 60Hz displays. | |\n| balance-angle: 80.0 * sin (ftime * 12.0) | |\n| rot-balance-wheel/2: balance-angle | |\n| ; 2. Fluid Escape Wheel Transmission | |\n| ; Keeps the rapid step-vibration look but anchors it tightly to the cage rotation | |\n| ;rot-escape-wheel/2: (rot-sec/2 * 4.0) + (4.0 * sin (ftime * 12.0)) | |\n| rot-escape-wheel/2: (rot-sec/2 * 4.0) + (2.0 * sin (ftime * 12.0)) | |\n| ; 3. Phase-Locked Hairspring Breathing | |\n| ; Tied perfectly to the new smooth angle matrix | |\n| scale-hairspring/2: 1.0 - (balance-angle / 600.0) | |\n| scale-hairspring/3: scale-hairspring/2 | |\n| show box | |\n| ;print [mold sizing copy/part face/draw 3] | |\n| ] | |\n| ] | |\n| app-options: compose/deep [ ; win 8+ | |\n| draw: [fill-pen coal box 10x10 20x20] ; draw anchor dot, needed for dragging!!! | |\n| actors: object [ | |\n| on-over: func [face event] [(on-over)] | |\n| on-alt-down: func [face event] [ ; right click | |\n| mouse-pos: event/offset | |\n| if all [mouse-pos/x >= 10 mouse-pos/x <= 20 mouse-pos/y >= 10 mouse-pos/y <= 20][ | |\n| view/flags [title \"What?\" panel [ | |\n| below | |\n| button \"Full\" [drawing/2: 1.0 drawing/3: 1.0 show box] | |\n| button \"Half\" [drawing/2: 0.5 drawing/3: 0.5 show box] | |\n| button \"Third\" [drawing/2: 0.33 drawing/3: 0.33 show box] | |\n| button \"Quit\" [quit] | |\n| ]][modal popup] | |\n| ] | |\n| ] | |\n| ] | |\n| ] | |\n| w-body: compose/deep pick [ | |\n| [(app-body)] ;w8+ | |\n| [all-over on-over [(on-over)]] ;w7 | |\n| ] w8+? | |\n| w-options: compose/deep pick [ | |\n| [(app-options)] ;w8+ | |\n| [] ; w7 (empty!) | |\n| ] w8+? | |\n| w: view/tight/no-wait/flags/options w-body w-flags w-options | |\n| ; --- Native OS API Hooks --- | |\n| #system [#import [\"user32.dll\" stdcall [ | |\n| GetActiveWindow: \"GetActiveWindow\" [ | |\n| return: [handle!] | |\n| ] | |\n| SetWindowLong: \"SetWindowLongW\" [ | |\n| hWnd [handle!] | |\n| nIndex [integer!] | |\n| dwNewLong [integer!] | |\n| return: [integer!] | |\n| ] | |\n| SetLayeredWindowAttributes: \"SetLayeredWindowAttributes\" [ | |\n| hWnd [handle!] | |\n| crKey [integer!] | |\n| bAlpha [integer!] | |\n| dwFlags [integer!] | |\n| return: [integer!] | |\n| ] | |\n| SetWindowPos: \"SetWindowPos\" [ | |\n| hWnd [handle!] | |\n| hWndInsertAfter [integer!] ; Can accept special constants like -1 | |\n| X [integer!] | |\n| Y [integer!] | |\n| cx [integer!] | |\n| cy [integer!] | |\n| uFlags [integer!] | |\n| return: [integer!] | |\n| ] | |\n| ]]] | |\n| hack-it-w7: routine [hred [handle!] /local hwnd [handle!]] [ | |\n| hwnd: as handle! hred/value | |\n| SetWindowLong hwnd -20 00080000h | |\n| SetLayeredWindowAttributes hwnd 0 0 2 | |\n| SetWindowPos hwnd -1 0 0 0 0 0043h ; -1 = HWND_TOPMOST | |\n| ] | |\n| hack-it-w8+: routine [hred [handle!] /local hwnd [handle!]] [ | |\n| hwnd: as handle! hred/value | |\n| SetWindowLong hwnd -20 00080000h | |\n| SetLayeredWindowAttributes hwnd 0 0 1 | |\n| SetWindowPos hwnd -1 0 0 0 0 0043h ; -1 = HWND_TOPMOST | |\n| ] | |\n| hack-it: function [f [object!]] [ | |\n| h: f/state/1 | |\n| either w8+? [hack-it-w8+ h][hack-it-w7 h] | |\n| ] | |\n| hack-it w | |\n| do-events |", "url": "https://wpnews.pro/news/tourbillon-watch-desktop-widget-for-windows-8-red-programming-language", "canonical_source": "https://gist.github.com/hinjolicious/51373238dbd91d7ee567a1c62adaaed5", "published_at": "2026-06-13 14:57:30+00:00", "updated_at": "2026-07-10 18:40:07.388624+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Red", "Gemini AI", "hinjolicious", "Hiiamboris", "Windows 11", "Windows 8"], "alternates": {"html": "https://wpnews.pro/news/tourbillon-watch-desktop-widget-for-windows-8-red-programming-language", "markdown": "https://wpnews.pro/news/tourbillon-watch-desktop-widget-for-windows-8-red-programming-language.md", "text": "https://wpnews.pro/news/tourbillon-watch-desktop-widget-for-windows-8-red-programming-language.txt", "jsonld": "https://wpnews.pro/news/tourbillon-watch-desktop-widget-for-windows-8-red-programming-language.jsonld"}}