Steve Loughran wrote:
I am writing an application that is used on a touch screen, and would like to implement a slider, but it appears that there is no control over the size of the slider bar "button" to make it "fat" enough to accurately place a finger on the screen and select it.

Does anyone have any suggestions as to what I should be looking at as a replacement? Or pointers to implement my own slider or even scrollbar objects?

You can do this with the standard TrackBar/Slider object:
- use the -fixedlength => 1 option. This option sets a style that tells the control that you are going to set the width of the thumb.
- then use the SetThumbLength() method to set the size as bitg as you need.

Regards,
Rob.

#!perl -w
use strict;
use warnings;

use Win32::GUI();

my $mw = Win32::GUI::Window->new(
        -title    => 'Big Thumb',
        -size     => [400,300],
);

$mw->AddSlider(
        -name        => 'Slider',
        -size        => [$mw->ScaleWidth(), $mw->ScaleHeight()],
        -fixedlength => 1,
        -both        => 1,
        -selrange    => 0,
);

# Set the Thumb to be 3 times it's original size
my $thumb_factor = 3;
$mw->Slider->SetThumbLength($thumb_factor * $mw->Slider->GetThumbLength());

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


Reply via email to