2009-07-27 5 views
0

왜 내 버튼이 상자 패널의 0x0에 있지 않습니까?Rebol 레이아웃 문제

main: layout [ 
    size 680x400 
    origin 0x0 
    space 0x0 
    pad 0x0 
    at 0x0 

    across  
    Menu1: box brick 200x200 
    return  
    Menu2: box blue 200x300 
] 


Menu1-items: layout [ 
    origin 0x0 
    space 0x0 
    at 0x0 
    button "1" 
    button "2" 
    button "Quit" [quit] 
] 

Menu2-items: layout [ 
    origin 0x0 
    space 0x0 
    at 0x0 
    button "3" 
    button "4" 
]  
Menu1/pane: Menu1-items 
Menu2/pane: Menu2-items 
Show Menu1 
Show Menu2 

View Main 

답변

1

menu1-items 레이아웃 자체에는 기본 오프셋이 있습니다. menu2-item에 대한 내용입니다.

두 가지 방법으로 해결할 수 있습니다. 나는 menu1-item과 menu2-item에 대해 하나의 방법을 사용했습니다. 하나를 선택 당신이 선호 :

main: layout [ 
    size 680x400 
    origin 0x0 
    space 0x0 
    pad 0x0 
    at 0x0 

    across  
    Menu1: box brick 200x200 
    return  
    Menu2: box blue 200x300 
] 


Menu1-items: layout/offset [ ;; added /offset 
    origin 0x0 
    space 0x0 
    at 0x0 
    b1: button "1" 
    button "2" 
    button "Quit" [quit] 
] 0x0       ;; added 0x0 for value of /offset refinement 

Menu2-items: layout [ 
    origin 0x0 
    space 0x0 
    at 0x0 
    button "3" 
    button "4" 
]  

menu2-items/offset: 0x0   ;; inserted setting of /offset variable 
Menu1/pane: Menu1-items 
Menu2/pane: Menu2-items 
Show Menu1 
Show Menu2 


View Main 
+0

안녕하십니까. 내 평판이 15 세 이하이지만 최대한 빨리 투표 할 수있게 해주셔서 감사합니다. :) –

1

또 다른 유사 솔루션과 같은 레이아웃의/단단한 정제를 사용하는 것입니다

Menu1-items: layout/tight [ 
    space 0x0 
    button "1" 
    button "2" 
    button "Quit" [quit] 
] 

Menu2-items: layout/tight [ 
    space 0x0 
    button "3" 
    button "4" 
] 

또 다른 방법은 하위를 가진 대신 BOX의 패널 요소를 사용하는 것 하나의 큰 블록에 인라인 된 레이아웃.