Hi All !

the more I look into Factor the more amazing I find it..both the language
and the libraries.

I have some UI-related questions.

I have written a program which I have simplified in the code below.
It lists 100 records, along with the square of each value.
When you double click on a row, it displays a <pane> with the value.

Could you please tell me how to detect when a value <pane> is already opened
so that I don't open a second one ? How would I give it focus ? I have seen
the find-window word but I have not been able to do it.

Another question : for app distribution, can all the factor internal goodies be
turned off ( inspect, Prettyprint, etc ... ) ?

And finally, is there somewhere a file explorer widget ?

I would like to thank everybody for all the work that has gone into making
factor what it is today !

Thanks !

Manuel


! ---------------------------------------------------------
USING: accessors colors.constants kernel math math.parser
math.ranges models present sequences ui ui.gadgets.scrollers
ui.gadgets.tables ui.gadgets.panes ;

IN: sgui

: make-sqseq ( val -- seq )
    dup string>number sq present { } 2sequence ;

SINGLETON: seq-renderer

M: seq-renderer filled-column drop 1 ;
M: seq-renderer column-titles drop { "Value" "Value squared" } ;
M: seq-renderer row-columns drop make-sqseq ;
M: seq-renderer row-color 2drop "black" named-color ;
M: seq-renderer row-value drop ;

: row-action ( val -- )
    <pane> t >>scrolls? <scroller> { 150 150 } >>pref-dim
    swap present open-window ;

: <sgui> ( -- table )
    100 [1,b] [ present ] map <model>
    seq-renderer
    <table>
        8 >>gap
        COLOR: dark-gray >>column-line-color
        { 100 400 } >>pref-dim
        [ row-action ] >>action ;

 MAIN-WINDOW: sgui { { title "Simple GUI" } } <sgui> <scroller> >>gadgets ;

! ---------------------------------------------------------


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to