Hi,

I've just spent some time getting to grips with the rebar control - and I 
didn't get very far:) 

I must be missing something simple, because I can't work out how to use this 
control. I've gone through the perl/XS code and MS docs and I'm still clueless. 
The example below (when run in the samples folder) creats a rebar, with 3 
bands. Each band has a text string and image. You can resize the rebar, move 
the bands by dragging and it all seems to work - but how do you add other 
buttons/controls? Calling the BandInfo method causes a crash.

Cheers jez.

===============

#!perl -w
use Win32::GUI;
use strict;

my $W = new GUI::Window(
    -title    => "Win32::GUI::Rebar test",
    -left     => 100, 
    -top      => 100, 
    -width    => 300, 
    -height   => 200,
    -name     => "Window",
);

#create an image list

my $IL = new GUI::ImageList(16, 16, 8, 3, 10);
my $IMG_ONE   = $IL->Add("one.bmp");
my $IMG_TWO   = $IL->Add("two.bmp");
my $IMG_THREE = $IL->Add("three.bmp");

#create a rebar control

my $rebar = $W->AddRebar(
    -name   => "Rebar",
    -bandborders => 1,
    -varheight => 1,
    -imagelist => $IL,
);

$rebar->InsertBand (-text => 'one' , -image => 0);
$rebar->InsertBand (-text => 'two' , -image => 1);
$rebar->InsertBand (-text => 'thee', -image => 2);

#Below will crash...
#$rebar->BandInfo(0);

$W->Show;

Win32::GUI::Dialog;



Reply via email to