Doug Coleman 2008-01-14 09:57:37 -10:00
commit e78aa37c77
13 changed files with 30 additions and 16 deletions

View File

@ -1,6 +1,6 @@
! -*-factor-*-
USING: kernel unix vars mortar slot-accessors
USING: kernel unix vars mortar mortar.sugar slot-accessors
x.widgets.wm.menu x.widgets.wm.unmapped-frames-menu
factory.commands factory.load ;

View File

@ -1,6 +1,6 @@
USING: kernel parser io io.files namespaces sequences editors threads vars
mortar slot-accessors
mortar mortar.sugar slot-accessors
x
x.widgets.wm.root
x.widgets.wm.frame

View File

@ -128,7 +128,7 @@ over object-class class-methods 1 head* assoc-stack call ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: new* ( class -- object ) <<- create ;
! : new* ( class -- object ) <<- create ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -136,13 +136,20 @@ IN: slot-accessors
IN: mortar
! : generate-slot-getter ( name -- )
! "$" over append "slot-accessors" create swap [ slot-value ] curry
! define-compound ;
: generate-slot-getter ( name -- )
"$" over append "slot-accessors" create swap [ slot-value ] curry
define-compound ;
"$" over append "slot-accessors" create swap [ slot-value ] curry define ;
! : generate-slot-setter ( name -- )
! ">>" over append "slot-accessors" create swap [ swap set-slot-value ] curry
! define-compound ;
: generate-slot-setter ( name -- )
">>" over append "slot-accessors" create swap [ swap set-slot-value ] curry
define-compound ;
define ;
: generate-slot-accessors ( name -- )
dup

View File

@ -0,0 +1,6 @@
USING: mortar ;
IN: mortar.sugar
: new* ( class -- object ) <<- create ;

View File

@ -1,5 +1,6 @@
USING: kernel namespaces arrays x11.xlib mortar slot-accessors x x.font ;
USING: kernel namespaces arrays x11.xlib mortar mortar.sugar
slot-accessors x x.font ;
IN: x.gc

View File

@ -1,5 +1,5 @@
USING: kernel arrays math.vectors mortar x.gc slot-accessors geom.pos ;
USING: kernel arrays math.vectors mortar mortar.sugar x.gc slot-accessors geom.pos ;
IN: x.pen

View File

@ -1,6 +1,6 @@
USING: kernel combinators math x11.xlib
mortar slot-accessors x.gc x.widgets.label ;
mortar mortar.sugar slot-accessors x.gc x.widgets.label ;
IN: x.widgets.button
@ -11,7 +11,7 @@ SYMBOL: <button>
{ "action-1" "action-2" "action-3" } accessors
define-simple-class
<button> "create" ( <button> -- button ) [
<button> "create" !( <button> -- button ) [
new-empty
<gc> new* >>gc ExposureMask ButtonPressMask bitor >>mask <- init-widget
] add-class-method

View File

@ -1,6 +1,6 @@
USING: kernel strings arrays sequences sequences.lib math x11.xlib
mortar slot-accessors x x.pen x.widgets ;
mortar mortar.sugar slot-accessors x x.pen x.widgets ;
IN: x.widgets.keymenu

View File

@ -1,5 +1,5 @@
USING: kernel x11.xlib mortar slot-accessors x.gc x.widgets ;
USING: kernel x11.xlib mortar mortar.sugar slot-accessors x.gc x.widgets ;
IN: x.widgets.label

View File

@ -1,6 +1,6 @@
USING: kernel combinators namespaces math.vectors x11.xlib x11.constants
mortar slot-accessors x x.gc x.widgets.wm.frame.drag ;
mortar mortar.sugar slot-accessors x x.gc x.widgets.wm.frame.drag ;
IN: x.widgets.wm.frame.drag.move

View File

@ -1,6 +1,6 @@
USING: kernel combinators namespaces math.vectors x11.xlib x11.constants
mortar slot-accessors geom.rect x x.gc x.widgets.wm.frame.drag ;
mortar mortar.sugar slot-accessors geom.rect x x.gc x.widgets.wm.frame.drag ;
IN: x.widgets.wm.frame.drag.size

View File

@ -2,7 +2,7 @@
USING: kernel io combinators namespaces quotations arrays sequences
math math.vectors
x11.xlib x11.constants
mortar slot-accessors
mortar mortar.sugar slot-accessors
geom.rect
x x.gc x.widgets
x.widgets.button

View File

@ -1,5 +1,5 @@
USING: kernel x11.constants mortar slot-accessors x.widgets.keymenu ;
USING: kernel x11.constants mortar mortar.sugar slot-accessors x.widgets.keymenu ;
IN: x.widgets.wm.menu