Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add editable, cursor-visible properties to TextView
Closes #8
- Loading branch information
1 parent
7df7b5b
commit 0d097d0
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env perl6 | ||
|
|
||
| use GTK::Simple; | ||
|
|
||
| my $app = GTK::Simple::App.new(title => 'Text'); | ||
|
|
||
| my $editable = GTK::Simple::CheckButton.new(label => 'Editable'); | ||
| $editable.status = True; | ||
| my $show-cursor = GTK::Simple::CheckButton.new(label => 'Show Cursor'); | ||
| $show-cursor.status = True; | ||
| my $text-view = GTK::Simple::TextView.new; | ||
|
|
||
| $editable.toggled.tap(-> $w { $text-view.editable = $w.status }); | ||
| $show-cursor.toggled.tap( -> $w { $text-view.cursor-visible = $w.status }); | ||
|
|
||
| my $vbox = GTK::Simple::VBox.new($editable, $show-cursor, $text-view); | ||
|
|
||
| $app.set_content($vbox); | ||
|
|
||
|
|
||
| $app.run; | ||
|
|
||
| # vim: expandtab shiftwidth=4 ft=perl6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters