Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indirect object syntax #45

Merged
merged 1 commit into from
Jan 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Prima.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Prima - a perl graphic toolkit

use Prima qw(Application Buttons);

new Prima::MainWindow(
Prima::MainWindow->new(
text => 'Hello world!',
size => [ 200, 200],
)-> insert( Button =>
Expand Down Expand Up @@ -177,7 +177,7 @@ is finished.

The window is created by invoking

new Prima::MainWindow();
Prima::MainWindow->new();

or

Expand All @@ -189,7 +189,7 @@ of parameters is passed afterwards. These parameters are usually
represented in a hash syntax, although actually passed as an array.
The hash syntax is preferred for the code readability:

$new_object = new Class(
$new_object = Class->new(
parameter => value,
parameter => value,
...
Expand Down
2 changes: 1 addition & 1 deletion examples/calendar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ =head1 FEATURES
use Prima::Calendar;

my $cal;
my $w = new Prima::MainWindow(
my $w = Prima::MainWindow->new(
text => "Calendar example",
size => [ 200, 200],
designScale => [6,16],
Expand Down
2 changes: 1 addition & 1 deletion examples/dwm_blur.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sub dwm_reset
}});
}

my $w = new Prima::MainWindow(
my $w = Prima::MainWindow->new(
text => "Hello, world!",
backColor => cl::Black,
onSize => sub { dwm_reset(shift) },
Expand Down
2 changes: 1 addition & 1 deletion examples/generic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ =head1 FEATURES
use Prima;
use Prima::Application name => 'Generic';

my $w = new Prima::MainWindow(
my $w = Prima::MainWindow->new(
text => "Hello, world!",
onClose => sub {
$::application-> destroy;
Expand Down