Padre::Current - convenient access to current objects within Padre
my $main = Padre::Current->main; ...
Padre uses lots of objects from different classes. And one needs to have access to the current object of this sort or this other to do whatever is need at the time.
Instead of poking directly with the various classes to find the object you need, Padre::Current provides a bunch of handy methods to retrieve whatever current object you need.
Padre::Current
# Vanilla constructor Padre::Current->new; # Seed the object with some context Padre::Current->new( document => $document );
The new constructor creates a new context object, it optionally takes one or more named parameters which should be any context the caller is aware of before he calls the constructor.
new
Providing this seed context allows the context object to derive parts of the current context from other parts, without the need to fall back to the last-resort Padre->ide singleton-fetching method.
Padre->ide
Many objects in Padre that are considered to be part of them context will have a current method which automatically creates the context object with it as a seed.
current
Returns a new Padre::Current object.
ide
Return the Padre singleton for the IDE instance.
config
Returns the current Padre::Config configuration object for the IDE.
main
Returns the Padre::Wx::Main object for the main window.
notebook
Returns the Padre::Wx::Notebook object for the main window.
document
Returns the active Padre::Document document object.
editor
Returns the Padre::Editor editor object for the active document.
filename
Returns the file name of the active document, if it has one.
title
Return the title of current editor window.
project
Return the Padre::Project project object for the active document.
Padre::Project
text
Returns the selected text, or a null string if nothing is selected.
Copyright 2008-2010 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Padre, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Padre
CPAN shell
perl -MCPAN -e shell install Padre
For more information on module installation, please visit the detailed CPAN module installation guide.