You probably want to use "unparent" to remove the current children from the
viewport instead of just changing the children slot (it does a few
bookkeeping things).
Also, viewports seem to require the children>> slot to have at least one
child in it or they throw an exception in layout.
It's maybe not as nice as you'd like, but this will "work":
<a> <scroller> dup gadget.
: replace-children ( viewport newchild -- )
add-gadget children>> but-last [ unparent ] each ;
dup viewport>> "foo" <label> replace-children
dup viewport>> <a> replace-children
We should fix the bug to make viewports allow zero children so you don't
have to "add then remove others", but this works fine I think.
Best,
John.
On Thu, Dec 27, 2012 at 9:37 AM, Samuel Proulx <proulxsam...@gmail.com>wrote:
> Hi,
>
> I just made the following scroller containing two radio-buttons:
>
> SYMBOL: model f <model> model set
> : <a> ( -- test ) model get { "True" "False" } <enum> <radio-buttons> { 4
> 4 } <border> ;
> <a> <scroller> dup gadget.
>
> It works fine when I click on the buttons. Although, If I try to change
> the viewport of the scroller (even to the exact same thing), the buttons
> suddently stop working:
>
> dup viewport>> <a> 1vector >>children relayout
>
> What did I do wrong ?
>
> Thanks in advance,
> Samuel
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk