-
Notifications
You must be signed in to change notification settings - Fork 5
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
CALLING-METHOD: Unable to call postcircumfix $bt[ (Any) ] with a type object #40
Comments
Thanks for the report. I will look into it.
…On Mon, Nov 4, 2019, 12:42 PM hythm ***@***.***> wrote:
I'm getting CALLING-METHOD error when adding many children to a
container, If I lowered down the number of children ( to may be "150" child
) the error goes away.
I reduced the problem to the below code:
#!/usr/bin/env perl6
use GTK::Application;
use GTK::FlowBox;
use GTK::Label;
GTK::Application.new;
my $str = q:to/END/; # Reducing number of children by removing one line from $str fix the issue
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
END
my $flowbox = GTK::FlowBox.new;
for $str.words.join.comb -> $sym {
$flowbox.add: GTK::Label.new: $sym;
}
### OUTPUT
# Unable to call postcircumfix $bt[ (Any) ] with a type object
# Indexing requires a defined object
# in method CALLING-METHOD at /home/hythm/dev/GTK/p6-GtkPlus/lib/GTK/Roles/Protection.pm6 (GTK::Roles::Protection) line 17
# in method IS-PROTECTED at /home/hythm/dev/GTK/p6-GtkPlus/lib/GTK/Roles/Protection.pm6 (GTK::Roles::Protection) line 54
# in method add at /home/hythm/dev/GTK/p6-GtkPlus/lib/GTK/FlowBox.pm6 (GTK::FlowBox) line 219
# in block <unit> at tmp/sym.p6 line 1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40?email_source=notifications&email_token=AAEU5QT5PDCSKYKSQC5BY3TQSBNIRA5CNFSM4JIW6D7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWVN3FQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEU5QWKCZGRCS4IOS7T3B3QSBNIRANCNFSM4JIW6D7A>
.
|
Ah! This is related to the deprecated GTK::Roles::Types. I just haven't had a chance to circle back and fix it all (as it's a LOT of code). Thanks for finding this. I hope to have a fix in git, shortly. |
@hythm7 - Actually, this looks to go deeper than that. For one thing, the IS-PROTECTED method is not called directly by GTK::FlowBox at all. I've gone through and added the missing code you pointed out at #41, so the only thing I can think of is that it is related to the number of items... but it should not be. This may require more of a think. |
@hythm7 - I've managed to get it to work if I run it through at least 3 times. Can you confirm this behavior? Also, what version of rakudo are you using? I'm using Rakudo version 2019.07.1-443-gcfc0f46c0 built on MoarVM version 2019.07.1-298-g67b6acf71. You may want to upgrade to latest moar-blead if you can. |
@Xliff Thanks for looking into that. I upgraded to latest moar-blead ( and removed GTK top directory and cloned the repos again to GTK top directory ). here is my Raku version:
I ran the script few times, here is the output: 0 means exited successfully
|
Just to clarify, the script I ran was |
Thanks for that. It looks to be an issue with rakudo, especially when dealing with NativeCall. I've been dealing with flappers like this all throughout the project, and they are inexplicable. I am wondering if it has something to do with memory management as, outside of Widgets, no attempt at proper reference counting (read: freeing resources) is even made. It's a bit disturbing, though. If the same code can work, why does it not work consistently? The fact that the code is not changed and has this degree of variance bothers me. It would be nice if I could golf the situation down to a specific case, but so far I have had no luck. Caveat emptor, though. Until I can figure out the cause, p6-GtkPlus will remain unusable for medium to large size projects. I will leave this bug open until I can figure out why. |
@Xliff : I saw your conversation with timotimo on #raku and I went ahead and tested with:
ran the script 42 times (even with many more children), It succeeded every time. no errors anymore. it also fixed #41 |
@hythm7 - Ah! Good to know. Now to see the minimal number of those we need to make it work. Thanks! |
MVM_SPESH_DISABLE=1 works |
I'm getting
CALLING-METHOD
error when adding many children to a container, If I lowered down the number of children ( to may be "150" child ) the error goes away.I reduced the problem to the below code:
The text was updated successfully, but these errors were encountered: