Tk and O-O
Tk
is a Perl package for building graphical user interfaces.
Originally written for the low-level functionality of Unix X Windows.
A fellow Perl programmer added a generic porting layer and a Perl wrapper in the object-oriented module
Tk.pm
O-O Review
An
object
is a predefined data structure.
Methods
are subroutines that operate on this data.
Invoke them with the
->
arrow notation.
Class methods
are ordinary subroutines.
They do not operate on a particular instance of the object.
$obj = Package::new();
$top = MainWindow->new();
or
$top = new MainWindow
Instance methods
operate on a particular instance of the object.
$label = $top->Label(text => 'hello world!');