#23 UpDown control -range doesn't work at creation.


When I create an updown control, and use the -range
option at creation time, it doesn't work.

However the method does work after creation
works fine.

So, either the doc needs to be modified to reflect that
range is only usefull after creation, or the bug needs to
be fixed so that works all the time.


A smattering of code follows: Comment out the
UpDown->Range(1,50); and it will break.

use Win32::GUI;
#use strict;
# Create the window.
$Window = new GUI::Window(
-name => "Window",
-text => "John's Client Email Generator",
-width => 500,
-height => 450,
-left => 100,
-top => 50,

-name => "Parse_Field",
-left => 100,
-top => 8,
-text => "1",
-width => 40,
-height => 22,

my $updown = $Window->AddUpDown(
-name => "Parse_Field_UpDown",
-base => 10,
-buddy => "Parse_Field",
-range => [1,50],



  • Rocher Laurent

    Rocher Laurent - 2004-03-27
    • assigned_to: nobody --> lrocher
    • status: open --> closed-works-for-me
  • Rocher Laurent

    Rocher Laurent - 2004-03-27

    Logged In: YES

    Those options didn't exists for AddUpDown method.
    -base => 10,
    -buddy => "Parse_Field",
    -range => [1,50],

    You must set it using method call after creation.

    Where did you see in documentation those UpDown options
    exist ?
    I can't find it for fix. I find it as method but not option.

  • Nobody/Anonymous

    Logged In: NO

    I have seen three different sets of documentation for the
    win32::GUI. So, I can't tell you which one I looked at. I
    was under the impression that every method that worked for
    an option was also available as an option for the addxxx
    method. I've seen at least one case where it was specifically
    documented that a particular option didn't work.

    I was hoping that the either it could be added to the
    addupdown method, or that the documentation could
    actually reflect the three you mention. However, -buddy
    seems to work... it does attach itself to the textfield that I
    list as the -buddy in the example given. Or is that just an
    artifact, it's attaching itself to the immediatly previously
    created object?


  • Rocher Laurent

    Rocher Laurent - 2004-03-28

    Logged In: YES

    Win32::GUI isn't well documented ;o)

    -buddy => option doesn't exist but UpDown control have
    autobuddy set by default.
    This option automataticly associate UpDown control with
    previous control (your textfield ;o)
    I think base is 10 by default too.

    If you don't want autobudy, you can remove it by using -
    autobudy => 0. And use Buddy() method. You must pass
    control reference and not control name.
    Something like that :


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks