splitter layout fix
parent
867dfe7ac9
commit
841edc21c8
|
|
@ -165,3 +165,9 @@ M: hashtable hashcode ( hash -- n )
|
|||
] [
|
||||
pick rot >r >r call dup r> r> set-hash
|
||||
] ifte* ; inline
|
||||
|
||||
: ?hash ( key hash/f -- value/f )
|
||||
dup [ hash ] [ 2drop f ] ifte ;
|
||||
|
||||
: ?set-hash ( value key hash/f -- hash )
|
||||
[ 1 <hashtable> ] unless* [ set-hash ] keep ;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@
|
|||
IN: gadgets
|
||||
USING: generic io kernel listener math namespaces styles threads ;
|
||||
|
||||
SYMBOL: stack-display
|
||||
|
||||
: <stack-display>
|
||||
;
|
||||
|
||||
: init-world
|
||||
global [
|
||||
<world> world set
|
||||
|
|
@ -21,15 +26,13 @@ USING: generic io kernel listener math namespaces styles threads ;
|
|||
|
||||
<plain-gadget> add-layer
|
||||
|
||||
<pane> dup
|
||||
<pane> dup pane set <scroller>
|
||||
<pane> dup stack-display set <scroller>
|
||||
3/4 <y-splitter> add-layer
|
||||
|
||||
<scroller> "Stack display goes here" <label> 3/4 <y-splitter> add-layer
|
||||
[ pane get [ clear print-banner listener ] with-stream ] in-thread
|
||||
|
||||
[ [ clear print-banner listener ] with-stream ] in-thread
|
||||
|
||||
dup request-focus
|
||||
|
||||
pane set
|
||||
pane get request-focus
|
||||
] bind ;
|
||||
|
||||
SYMBOL: first-time
|
||||
|
|
|
|||
|
|
@ -45,13 +45,14 @@ C: splitter ( first second split vector -- splitter )
|
|||
{ 1 0 0 } <splitter> ;
|
||||
|
||||
: splitter-part ( splitter -- vec )
|
||||
dup splitter-split swap shape-dim n*v divider-size 1/2 v*n v- ;
|
||||
dup splitter-split swap shape-dim
|
||||
n*v divider-size 1/2 v*n v- ;
|
||||
|
||||
: splitter-layout ( splitter -- [ a b c ] )
|
||||
[
|
||||
dup splitter-part ,
|
||||
divider-size ,
|
||||
dup shape-dim swap splitter-part v- ,
|
||||
dup shape-dim divider-size v- swap splitter-part v- ,
|
||||
] make-list ;
|
||||
|
||||
M: splitter layout* ( splitter -- )
|
||||
|
|
|
|||
Loading…
Reference in New Issue