negative numbers in ask_double

edited September 2014 in Ruby Scripting
I have been unable to input negative numbers into InputDialog::ask_double.
I am using the windows version of Klayout. The '-' shows up and no input is allowed beyond that.

Comments

  • edited September 2014

    Hi,

    you're right. That was not intended. The lower limit is 0 instead of allowing negative values too.

    Fortunately there is a simple workaround. The "ask_double_ex" method allows specifying a longer and upper limit. Just set that to some useful values, i.e. -1000 to 1000, and the dialog will allow specification of negative values too:

    puts RBA::InputDialog::ask_double_ex("Title", "label", 0.0, -1000.0, 1000.0, 3)
    

    Matthias

Sign In or Register to comment.