App-GUI-Notepad
view release on metacpan or search on metacpan
lib/App/GUI/Notepad/Frame.pm view on Meta::CPAN
}
# This is the constructor for the object.
# It creates:
# - the menubar
# - the textctrl which is where the text that is being edited is
# is stored
# - the status bar where non modal messages can be sent to the
# user
# It associates actions to the various menu options, sets the application
# icon and sets the font for displaying the file to a fixed width font.
sub new {
my ($class) = shift;
my ($title, $position, $size) = @_;
my ($this) = $class->SUPER::new( undef, -1, $title, $position, $size );
$this->SetIcon( Wx::GetWxPerlIcon() );
$this->{menubar} = App::GUI::Notepad::MenuBar->new();
$this->SetMenuBar( $this->{menubar}->menubar() );
lib/App/GUI/Notepad/Frame.pm view on Meta::CPAN
$this->{textctrl} = Wx::TextCtrl->new(
$this,
-1,
"",
[ 0, 0 ],
[ 100, 100 ],
wxTE_MULTILINE | wxTE_RICH,
);
# Set the font of the new text control to a fixed width font Courier New
# This font was chosen because of it's availablity on different platforms.
my $font = Wx::Font->new(10, wxMODERN, wxNORMAL, wxNORMAL, 0, "Courier New");
my $black = Wx::Colour->new(255,255,255);
my $white = Wx::Colour->new(0,0,0);
my $textattr = Wx::TextAttr->new($white, $black, $font);
$this->{textctrl}->SetDefaultStyle($textattr);
#Create the statusbar
$this->CreateStatusBar(2);
return $this;
}
( run in 1.045 second using v1.01-cache-2.11-cpan-5735350b133 )