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

closed-works-for-me
None
5
2004-03-27
2004-03-25
No

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
$Window->UpDown->Range(0,50);
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.

John_Schlick@Hotmail.com

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,
);

$Window->AddTextfield(
-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],
);
$updown->Pos(1);
$updown->Range(1,50);

$Window->Show();
Win32::GUI::Dialog();

Discussion

  • 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
    user_id=142891

    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?

    John.

     
  • Rocher Laurent

    Rocher Laurent - 2004-03-28

    Logged In: YES
    user_id=142891

    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 :
    $updown->Buddy($Window->{Parse_Field});

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks