Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Draw-a-pixel/Raku/draw-a-pixel.raku
Normal file
22
Task/Draw-a-pixel/Raku/draw-a-pixel.raku
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use GTK::Simple;
|
||||
use GTK::Simple::DrawingArea;
|
||||
use Cairo;
|
||||
|
||||
my $app = GTK::Simple::App.new(:title('Draw a Pixel'));
|
||||
my $da = GTK::Simple::DrawingArea.new;
|
||||
gtk_simple_use_cairo;
|
||||
|
||||
$app.set-content( $da );
|
||||
$app.border-width = 5;
|
||||
$da.size-request(320,240);
|
||||
|
||||
sub rect-do( $d, $ctx ) {
|
||||
given $ctx {
|
||||
.rgb(1, 0, 0);
|
||||
.rectangle(100, 100, 1, 1);
|
||||
.fill;
|
||||
}
|
||||
}
|
||||
|
||||
my $ctx = $da.add-draw-handler( &rect-do );
|
||||
$app.run;
|
||||
Loading…
Add table
Add a link
Reference in a new issue