splitter layout fix

cvs
Slava Pestov 2005-07-14 01:28:23 +00:00
parent 867dfe7ac9
commit 841edc21c8
3 changed files with 19 additions and 9 deletions

View File

@ -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 ;

View File

@ -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

View File

@ -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 -- )