/
CppTrial-pg081.pl
42 lines (33 loc) · 1.13 KB
/
CppTrial-pg081.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl
# CppTrial-pg081.pl
# Cross-Platform GUI Programming with wxWidgets - Smart, Hock, & Csomor
# C++ Example from pg 81 - Splitter Window Example
# Ported to wxPerl by James M. Lynes Jr. - Last Modified 9/23/2012
use 5.010;
use strict;
use warnings;
use Wx qw(:everything);
# create the WxApplication
my $app = Wx::SimpleApp->new;
my $frame = Wx::Frame->new(undef, -1,
'CppTrial-pg081.pl',
wxDefaultPosition, wxDefaultSize);
SplitterWindow($frame);
$frame->Show;
$app->MainLoop;
# Example specific code
sub SplitterWindow {
my ( $self ) = @_;
my $splitterWindow = Wx::SplitterWindow->new($self, -1,
Wx::Point->new(0, 0), Wx::Size->new(400, 400),
wxSP_3D);
my $leftWindow = Wx::ScrolledWindow->new($splitterWindow);
$leftWindow->SetScrollbars(20, 20, 50, 50);
$leftWindow->SetBackgroundColour(wxRED);
$leftWindow->Show(1);
my $rightWindow = Wx::ScrolledWindow->new($splitterWindow);
$rightWindow->SetScrollbars(20, 20, 50, 50);
$rightWindow->SetBackgroundColour(wxCYAN);
$rightWindow->Show(0); # Right Window is Hidden
$splitterWindow->Initialize($leftWindow);
}