Comments (6)
Ok. Using GTK::Simple:ver<0.1.10> (from zef). I ran the following code :
#!/usr/bin/env perl6
use v6;
use GTK::Simple;
use GTK::Simple::App;
my $app = GTK::Simple::App.new(title=> 'Test');
my $text = GTK::Simple::TextView.new(text=>'Original');
my $button = GTK::Simple::ToggleButton.new(label=>'Update');
$button.clicked.tap( { $text.text = "New" } );
$app.set-content(
GTK::Simple::VBox.new(
$text,
$button,
)
);
$app.border-width = 20;
$app.run;
The App opens but the Text box is empty and when I click the update I get the following :
Cannot modify an immutable Str ()
in block <unit> at src/perl6/desktop-apps/text-test.p6 line 11
Perl6 version 2018.11 built on MoarVM version 2018.11
from gtk-simple.
This is due to the fact that the accessor method:
method text() {
Proxy.new:
FETCH => {
gtk_text_buffer_get_text($!buffer, self!start-iter(),
self!end-iter(), 1)
},
STORE => -> \c, \text {
gtk_text_buffer_set_text($!buffer, text.Str, -1);
}
}
Is not "is rw". I think this code worked up until a recent commit of Perl6, where the bug that allowed this to work without the 'rw' trait was fixed.
from gtk-simple.
I think you're going to have to talk us through this as I can't get the as-is examples/17-scrolled-window-with-textview.p6
to do anything untoward.
from gtk-simple.
Sorry, was mostly working through my Advent calender article at the time (suprise guess what it's about?).
I'll investigate further.
from gtk-simple.
Yeah that's entirely what it is.
Let me have a quick look at that.
from gtk-simple.
As it stands the constructor for the TextView doesn't do anything with a text
argument. Arguably it should but that should probably be handled separately as it will require a bit of a rework of the whole class.
from gtk-simple.
Related Issues (20)
- Moving GTK::Simple to GTK 4 HOT 22
- Tests not actually run by Actions HOT 3
- Please deploy to `fez` HOT 2
- Add a "gui" tag to the meta-6 file HOT 3
- RFE: Please add Progress Bar to the list of examples HOT 4
- GObject Introspection? HOT 2
- program crashes when GTK::Simple::App.new(...) is called later in program HOT 4
- Install fails on Windows HOT 2
- Install not working correctly HOT 6
- rfe: example with a scroll bar HOT 3
- MoarVM Panic Running Example 18, Cairo Draw Handler HOT 3
- how install Cairo HOT 3
- Host used for downloading windows DLLs is down HOT 2
- Trying to read the `.text` property of a TextView results in an abort. HOT 9
- use just Github Actions for CI HOT 2
- RFE: example of a fill in form HOT 1
- RFE: 07-text.pl6: show returned text HOT 3
- Documentation HOT 7
- No way to loop over components in a container or an app HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtk-simple.