On 4-Mar-08, at 6:08 AM, Ben Schlingelhof wrote:

> I managed to paint a nice square on the screen:
>
>  : display ( -- )
>  blue gl-color
>  { 30 30 } { 100 100 } gl-fill-rect
>  ;
>
>  : test-window ( -- )
>  [
>     [ display ] <slate>
>     { 600 600 } over set-slate-dim
>     "Test" open-window
>  ] with-ui ;
>
>  MAIN: test-window.
>
>  How do I get it to move? I had a look at the timers, confusion.

Timers need a method to be defined on a custom class, so they can't  
be used with slates, however it is easy enough to make a custom gadget:

TUPLE: my-gadget ;

: <my-gadget> my-gadget construct-gadget ;

M: my-gadget draw-gadget* ... ;

M: my-gadget tick ... relayout-1 ;

M: my-gadget graft* 100 100 add-timer ;

M: my-gadget ungraft* remove-timer ;

>  Second question: Is there a possibility to disable the alt-5  
> shortcut?

Yes. Find this form in extra/ui/tools/tools.factor:

workspace "tool-switching" f {
     { T{ key-down f { A+ } "1" } com-listener }
     { T{ key-down f { A+ } "2" } com-browser }
     { T{ key-down f { A+ } "3" } com-inspector }
     { T{ key-down f { A+ } "5" } com-profiler }
} define-command-map

Comment out the last line, go into the Factor UI and press F2.

Slava

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to