[rkward-devel] Show element depending on spinbox value

Birk Diedenhofen mail at birkdiedenhofen.de
Wed Jul 31 13:03:38 UTC 2013


Hi Thomas,

This works as expected.
Thanks for your help!


Regards,
Birk

On 30.07.2013 20:03, Thomas Friedrichsmeier wrote:
> Hi!
>
> On Tuesday 30 July 2013 16:45:21 Birk Diedenhofen wrote:
>> I ran into the following issue with my rkward plugin. I'm trying to show
>> and hide GUI elements depending on the value of a spinbox. If the
>> spinbox value is zero, the text element stating "spinbox value is zero"
>> should be shown on the following wizard page (see code example below).
>> If the spinbox value is not zero, the text element stating "spinbox
>> value is not zero" should be shown. However, irrespective of the spinbox
>> value, I always get "spinbox value is not zero".
>
> It's a rounding / floating point precision issue. One of the zeros is not
> quite the same as the other, for some reason. For the moment, the best
> workaround will be to use
>
>    value.is.zero.convert <-
>    rk.XML.convert(sources=list(real=spinbox.value),
>    mode=c(min=-0.0000001, max=0.0000001),
>    id.name="value_is_zero_convert")
>
> Probably for real-mode equality comparisons something along these lines should
> be done automatically, internally.
>
> BTW: No need to define complementary converts. Simply use
>
>    rk.XML.connect(governor=value.is.zero.convert, not=TRUE,
>    client=spinbox.value.is.not.zero, set="visible")
>
> (For those not using rkwarddev: This uses the ".not" sub-property of the
> governor.)
>
> Regards
> Thomas
>
>
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> RKWard-devel mailing list
> RKWard-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rkward-devel
>





More information about the Rkward-devel mailing list