Paste: weird UI behaviour
Author: | ben |
Mode: | factor |
Date: | Mon, 15 Dec 2008 20:07:17 |
Plain Text |
: main ( -- )
<gadget> { 200 200 } >>dim dup "UI Test" open-window
"Click me!" [ drop ] <bevel-button> { 50 50 } >>loc add-gadget ;
Author: | ben |
Mode: | text |
Date: | Mon, 15 Dec 2008 20:08:28 |
Plain Text |
Problem is, the window opens allright but instead of a bevel-button, there is just the text "Click me!" without any reaction to mouse movement. What am I missing?
Author: | ben |
Mode: | text |
Date: | Mon, 15 Dec 2008 20:13:14 |
Plain Text |
Ah, forgot to give the button a dimension. Stupid stupid me. Well, posting it helped apparently.
Author: | slava |
Mode: | factor |
Date: | Mon, 15 Dec 2008 21:59:15 |
Plain Text |
Ben, look into using layout gadgets instead of giving dimensions to gadgets manually. Eg,
<pile>
"Hi" [ drop ] <bevel-button> add-gadget
"Bye" [ drop ] <bevel-button> add-gadget
"Test" open-window
Author: | ben |
Mode: | text |
Date: | Wed, 17 Dec 2008 14:03:20 |
Plain Text |
But what if I want to implement a new layout-gadget? Then I neet to give the dimensions or am I misunderstanding something? (The code was just a simplified example, since I didn't want to push all my convoluted stuff in here. I'm working on a hex-grid.)
Author: | ben |
Mode: | text |
Date: | Wed, 17 Dec 2008 14:03:27 |
Plain Text |
But what if I want to implement a new layout-gadget? Then I neet to give the dimensions or am I misunderstanding something? (The code was just a simplified example, since I didn't want to push all my convoluted stuff in here. I'm working on a hex-grid.)
Author: | ben |
Mode: | factor |
Date: | Wed, 17 Dec 2008 14:03:55 |
Plain Text |
But what if I want to implement a new layout-gadget? Then I neet to give the dimensions or am I misunderstanding something? (The code was just a simplified example, since I didn't want to push all my convoluted stuff in here. I'm working on a hex-grid.)
New Annotation