From 278ab26fa580ff34fe07ca56682fb020b75107ee Mon Sep 17 00:00:00 2001 From: slava Date: Fri, 17 Mar 2006 08:21:54 +0000 Subject: [PATCH] Removing global world dependencies and cleaning up UI listener --- library/bootstrap/boot-stage1.factor | 2 +- library/cocoa/ui.factor | 13 +++--- library/ui/listener.factor | 24 ++++------- library/ui/menus.factor | 16 ++++--- library/ui/world.factor | 63 +++++++++++++--------------- 5 files changed, 55 insertions(+), 63 deletions(-) diff --git a/library/bootstrap/boot-stage1.factor b/library/bootstrap/boot-stage1.factor index 2a65732c59..9420b05f2b 100644 --- a/library/bootstrap/boot-stage1.factor +++ b/library/bootstrap/boot-stage1.factor @@ -170,13 +170,13 @@ vectors words ; "/library/ui/theme.factor" "/library/ui/hand.factor" "/library/ui/frames.factor" - "/library/ui/world.factor" "/library/ui/borders.factor" "/library/ui/labels.factor" "/library/ui/buttons.factor" "/library/ui/line-editor.factor" "/library/ui/sliders.factor" "/library/ui/scrolling.factor" + "/library/ui/world.factor" "/library/ui/menus.factor" "/library/ui/editors.factor" "/library/ui/splitters.factor" diff --git a/library/cocoa/ui.factor b/library/cocoa/ui.factor index 5b47e5e9cb..0896ff507d 100644 --- a/library/cocoa/ui.factor +++ b/library/cocoa/ui.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2006 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays cocoa freetype gadgets-layouts gadgets-listener -hashtables kernel lists math namespaces objc objc-NSApplication -objc-NSEvent objc-NSObject objc-NSOpenGLView objc-NSView -objc-NSWindow sequences ; +gadgets-panes hashtables kernel lists math namespaces objc +objc-NSApplication objc-NSEvent objc-NSObject objc-NSOpenGLView +objc-NSView objc-NSWindow sequences threads ; ! Cocoa backend for Factor UI @@ -41,7 +41,7 @@ H{ } clone views set-global ] keep [frame] NSRect-h swap - 0 3array ; : send-mouse-moved ( event view -- ) - mouse-location move-hand ; + [ mouse-location ] keep view move-hand ; : button ( event -- n ) #! Cocoa -> Factor UI button mapping @@ -158,9 +158,10 @@ IN: shells : ui [ [ - { 600 700 0 } world set + { 600 700 0 } >r r> world set world get ui-title - listener-application + [ clear listener-thread ] in-thread + pane get request-focus finish-launching event-loop ] with-cocoa diff --git a/library/ui/listener.factor b/library/ui/listener.factor index 81383fb462..8a68bd2254 100644 --- a/library/ui/listener.factor +++ b/library/ui/listener.factor @@ -52,15 +52,13 @@ SYMBOL: browser-pane listener ] with-stream* ; -M: label set-message ( string/f status -- ) - set-label-text* ; - : ( -- gadget ) ""