Hi Mark,
1) There are several ways to accomplish this, the simple answer is:
"Hello, world" <label> { 0 2 } <border>
"Testing" open-window
Longer answer, you can investigate ui.gadgets.grid and
ui.gadgets.corners for other layouts that allow more control, but a border
that expands in one direction might be a quick fix for you.
2) You can override user-input* to only allow strings that contain all
digits:
TUPLE: number-editor < editor ;
M: number-editor user-input*
over [ digit? ] all? [ call-next-method ] [ 2drop t ] if ;
if you wanted to constrain input to maximum length, you could probably
do a similar check for the contents of ``editor-string``.
3) Maybe if you gave me an example using your code and what you hope to
show, I could help. But two suggestions:
a) you should be able to click on the traceback and get a hint at where
the error is coming from
b) i think you mean do use ``assoc-each``, this might work better:
: show-drop-menu ( button assoc quot -- ) vertical <track>
'[ swap _ curry <roll-button> f track-add ] assoc-each show-menu ;
inline
: <drop-button> ( value assoc quot -- gadget )
[ [ at ] keep ] dip '[ _ _ show-drop-menu ] <roll-button> ;
Best,
John.
On Fri, Dec 19, 2014 at 4:59 PM, Mark Green <m...@antelope.nildram.co.uk>
wrote:
>
> Hi,
>
> Sorry to bother you again *sheepish*
>
> 1 - Is it possible to have a UI element adjust its positioning within the
> space it is allocated? For example, if a checkbox is allocated more space
> than it needs is it possible to specify it should be centered inside the
> space?
>
> 2 - Is it possible to create an <editor> that can only enter numbers or
> that can only enter a certain size of input?
>
> 3 - I have been trying to create a drop-down choice box. So far I have
> this:
>
> :: show-drop-menu ( button assoc quot -- ) vertical <track>
> [ button swap [ first ] [ second ] bi quot curry <roll-button> f
> track-add ] assoc each show-menu ; inline
>
> : <drop-button> ( value assoc quot -- gadget )
> [ drop at* drop ] 2keep '[ _ _ show-drop-menu ] <roll-button> ;
>
> However when the object is clicked on I get a nonsensical error message
> about "cannot load value into slot" which makes no sense since I'm not
> doing that anywhere in that code. Can anyone tell me what's wrong?
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk