Thank for embedding the code Jon,
but the listener and the help browser immediately kill.
If I give f as initial value of checkbox model, just nothing happens!


On 16/09/2011 16.41, Jon Harper wrote:
> Oh sorry, here's the content of the paste:
>
> USING:  kernel accessors namespaces models ui ui.gadgets models.arrow
>         ui.gadgets.packs ui.gadgets.buttons ;
> FROM: system => exit ;
>
> IN: gui
>
> <pile> { 10 10 } >>gap
>
> t <model>
>     [ "Enable QUIT" <checkbox> add-gadget ]
>     [ "Quit" swap [ value>> [ 0 exit ] when drop ] curry
> <border-button> add-gadget ] bi
>
> "" open-window
>
> Also, it's normal for the listener to close, that's what exit does. If
> you just want to close the created window, use to close-window word:
> http://docs.factorcode.org/content/word-close-window,ui.html
>
> Jon
>
> On Fri, Sep 16, 2011 at 4:30 PM, Michele Pes <mp8...@rambler.ru> wrote:
>> Thank you Joe!
>> I'm so curious to see your post, but my boss added the factorcode site
>> to the black list
>> so I'm forced to attach code to email, I'm very sorry!
>> This week-end I'll try to understand.
>> Thank you and good week-end to all!
>>
>> P.S.:
>> The listener dies when I click on the quit button.
>> I use the 0.94 version on vista32
>>
>>
>>
>> On 16/09/2011 15.53, Jon Harper wrote:
>>> When running your code in the listener, it doesn't get killed
>>> immediately here. What version are you using ?
>>>
>>> Also, a better way to share code on this list is to use the pastebin:
>>> http://paste.factorcode.org/
>>>
>>> As for your checkbox problem, I think you have 2 issues:
>>> - variable scope: the quotations run by the UI thread (when you click
>>> on the checkbox) are executed in a different scope than the one where
>>> you declare the variable var. var is not accessible there. You could
>>> use global variable.
>>> - the checkbox will toggle the arrow model, and that doesn't run your
>>> quotation. you would need to toggle the base model for that.
>>>
>>> A possible fix would be not to use a variable and arrow, but instead
>>> pass the model directly to the quotation for the button:
>>> http://paste.factorcode.org/paste?id=2345
>>>
>>> Cheers,
>>> Jon
>>>
>>> On Fri, Sep 16, 2011 at 3:23 PM, Michele Pes <mp8...@rambler.ru> wrote:
>>>> Hi to all factorers!
>>>> I was trying to develop a trivial gui example.
>>>> Of course my code is bugged but when I execute this 6-line script
>>>> the listener kill immediately.
>>>>
>>>> 1) Can you tell me how to avoid this?
>>>> 2) Can you tell me how to make the button work according to the checkbox ?
>>>>
>>>> Thank you very much,
>>>> michele pes
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>>> http://p.sf.net/sfu/rim-devcon-copy2
>>>> _______________________________________________
>>>> Factor-talk mailing list
>>>> Factor-talk@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>>
>>>>
>>> ------------------------------------------------------------------------------
>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>> http://p.sf.net/sfu/rim-devcon-copy2
>>> _______________________________________________
>>> Factor-talk mailing list
>>> Factor-talk@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>> ------------------------------------------------------------------------------
>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>> http://p.sf.net/sfu/rim-devcon-copy2
>> _______________________________________________
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to