Wx::Scintilla(3pm)
π NAME π
Wx::Scintilla β a Scintilla source code editing component for wxWidgets. bestie, it's a whole text editor engine in your Perl app π
β¨ SYNOPSIS β¨
okay so here's your very first scintilla Wx editor, no cap:
#----> My first scintilla Wx editor :)
package My::Scintilla::Editor;
use strict;
use warnings;
# Load Wx::Scintilla
use Wx::Scintilla (); # replaces use Wx::STC
use base 'Wx::Scintilla::TextCtrl'; # replaces Wx::StyledTextCtrl
use Wx qw(:everything);
use Wx::Event;
# Override the constructor to Enable Perl support in the editor
sub new {
my ( $class, $parent ) = @_;
my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] );
# Set the font
my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL );
$self->SetFont($font);
$self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font );
$self->StyleClearAll();
# Set the various Perl lexer colors
$self->StyleSetForeground( 0, Wx::Colour->new( 0x00, 0x00, 0x7f ) );
$self->StyleSetForeground( 1, Wx::Colour->new( 0xff, 0x00, 0x00 ) );
$self->StyleSetForeground( 2, Wx::Colour->new( 0x00, 0x7f, 0x00 ) );
$self->StyleSetForeground( 3, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) );
$self->StyleSetForeground( 4, Wx::Colour->new( 0x00, 0x7f, 0x7f ) );
$self->StyleSetForeground( 5, Wx::Colour->new( 0x00, 0x00, 0x7f ) );
$self->StyleSetForeground( 6, Wx::Colour->new( 0xff, 0x7f, 0x00 ) );
$self->StyleSetForeground( 7, Wx::Colour->new( 0x7f, 0x00, 0x7f ) );
$self->StyleSetForeground( 8, Wx::Colour->new( 0x00, 0x00, 0x00 ) );
$self->StyleSetForeground( 9, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) );
$self->StyleSetForeground( 10, Wx::Colour->new( 0x00, 0x00, 0x7f ) );
$self->StyleSetForeground( 11, Wx::Colour->new( 0x00, 0x00, 0xff ) );
$self->StyleSetForeground( 12, Wx::Colour->new( 0x7f, 0x00, 0x7f ) );
$self->StyleSetForeground( 13, Wx::Colour->new( 0x40, 0x80, 0xff ) );
$self->StyleSetForeground( 17, Wx::Colour->new( 0xff, 0x00, 0x7f ) );
$self->StyleSetForeground( 18, Wx::Colour->new( 0x7f, 0x7f, 0x00 ) );
$self->StyleSetBold( 12, 1 );
$self->StyleSetSpec( Wx::Scintilla::SCE_H_TAG, "fore:#0000ff" );
# set the lexer to Perl 5
$self->SetLexer(Wx::Scintilla::SCLEX_PERL);
return $self;
}
#----> DEMO EDITOR APPLICATION
# First, define an application object class to encapsulate the application itself
package DemoEditorApp;
use strict;
use warnings;
use Wx;
use base 'Wx::App';
# We must override OnInit to build the window
sub OnInit {
my $self = shift;
my $frame = Wx::Frame->new(
undef, # no parent window
-1, # no window id
'My First Scintilla Editor!', # Window title
);
my $editor = My::Scintilla::Editor->new(
$frame, # Parent window
);
$frame->Show(1);
return 1;
}
# Create the application object, and pass control to it.
package main;
my $app = DemoEditorApp->new;
$app->MainLoop;
π¦ DESCRIPTION π¦
okok so here's the tea, bestie. we already had a pretty decent scintilla editor component situation happening with Wx::StyledTextCtrl in Perl, but lowkey we were stuck on an older scintilla package, which meant our Perl support in the wildly popular Wx Scintilla component was lagging behind. tragic. π«
and like β wxWidgets <http://wxwidgets.org> has a very slow release timeline, fr fr. Scintilla is a contributed project, which means by the time a new wxWidgets distribution drops it is not going to be the latest. and on the scintilla front itself? the Perl 5 lexer isn't even 100% bug free, and we have literally zero Perl 6 support in Scintilla. not a single crumb. π
so the ambitious goal of this whole project is to bring fresh Perl 5 support β and maybe 6 β into Wx, while keeping compatibility with Wx::StyledTextCtrl, and then continuously contribute all of it back to the Scintilla project. giving back to the community, we love to see it. π«Ά
β οΈ Note: you cannot loadWx::STCandWx::Scintillain the same application. they are mutually exclusive, periodt. thewxSTC_...events get handled by one library or the other, so pick your fighter and commit. π
Scintilla 2.28 is now bundled and enabled by default. iconic behavior honestly. β¨
π MANUAL π
if you want more API documentation, go consult Wx::Scintilla::Manual. it's giving encyclopedia but make it cute. π
π PLATFORMS π
right now, the supported platforms are:
- Linux β Debian, Ubuntu, Fedora, CentOS
- Windows β Strawberry and ActivePerl
my next goal is to support more platforms, so please let me know if you can help out :) π₯Ί
on Debian/Ubuntu, you need to install the following via:
sudo apt-get install libgtk2.0-dev
on MacOS 64-bit, by default you need to install a 32-bit Perl in order to install wxWidgets 2.8.x. yes bestie, that's the situation, we don't make the rules. π please refer to <http://wiki.wxperl.info/w/index.php/Mac_OS_X_Platform_Notes> for more information.
π HISTORY π
wxWidgets 2.9.1 and development have Scintilla 2.03 so far. I went digging through the scintilla history looking for Perl lexer changes, and here is what we will be getting when we upgrade to 2.26+. prepare yourself, it's a glow-up arc. β¨
Release 2.26
- Perl folding folds
"here doc"s and adds optionsfold.perl.at.elseandfold.perl.comment.explicit. - Fold structure for Perl fixed.
Release 2.20
- Perl folder works for array blocks, adjacent package statements, nested PODs, and terminates package folding at
DATA,DandZ.
Release 1.79
- Perl lexer bug fixed where previous lexical states persisted, causing
"/"special case styling and subroutine prototype styling to not be correct.
Release 1.78
- Perl lexer fixes problem with string matching caused by line endings.
Release 1.77
- Perl lexer update.
Release 1.76
- Perl lexer handles defined-or operator
"".
Release 1.75
- Perl lexer enhanced for handling minus-prefixed barewords, underscores in numeric literals and vector/version strings,
DandZsimilar toEND, subroutine prototypes as a new lexical class, formats and format blocks as new lexical classes, and'/'suffixed keywords and barewords.
Release 1.71
- Perl lexer allows UTF-8 identifiers and has some other small improvements.
π«Ά ACKNOWLEDGEMENTS π«Ά
- Neil Hudgson for creating and maintaining the excellent Scintilla project <http://scintilla.org>. Thanks!
- Robin Dunn <http://alldunn.com/robin/> for the excellent scintilla contribution that he made to wxWidgets. This work is based on his codebase. Thanks!
- Mark dootson <http://search.cpan.org/~mdootson/> for his big effort to make
Wx::Scintillacompilable on various platforms. Big thanks! - Heiko Jansen and Gabor Szabo <http://szabgab.com> for the idea to backport the Perl lexer for
wxWidgets 2.8.10<http://padre.perlide.org/trac/ticket/257>, and all of#padremembers for the continuous support and testing. Thanks!
π SUPPORT π
bugs should always be submitted via the CPAN bug tracker:
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wx-Scintilla>
for other issues, contact the maintainer. we don't bite, promise. π
π AUTHOR π
- Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
- Mark Dootson <http://www.wxperl.co.uk>
π SEE ALSO π
Wx::Scintilla ManualWx::Scintilla::Manual- wxStyledTextCtrl Documentation <http://www.yellowbrain.com/stc/index.html>
- Scintilla edit control for
Win32::GUIWin32::GUI::Scintilla
π COPYRIGHT AND LICENSE π
Copyright 2011 Ahmad M. Zawawi.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
License for Scintilla
Included Scintilla source is copyrighted 1998-2011 by Neil Hodgson <neilh@scintilla.org>
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.
NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
and that's the whole page bestie, we ate and left no crumbs π this gorgeous little number was brought to you by perl v5.42.3, dated 2026-08-21, and it lives its best life as Wx::Scintilla(3pm). go forth and edit some source code, you absolute main character. π
β¨π
π¦ where this page comes from
- ubuntu stonking: libwx-scintilla-perl 0.39-6build13 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms