in reply to Invisible Prima::Radio

... I'm sure I'm doing something wrong, but I don't know what it is. ...

Well, you haven't posted a minimal example ...

I see radio if I run https://metacpan.org/source/KARASIK/Prima-1.41/examples/buttons.pl or https://metacpan.org/source/KARASIK/Prima-1.41/examples/buttons2.pl or https://metacpan.org/source/KARASIK/Prima-1.41/examples/fontdlg.pl

So maybe you can compare to what you're doing :)

Replies are listed 'Best First'.
Re^2: Invisible Prima::Radio
by over2sd (Beadle) on Feb 14, 2015 at 00:30 UTC

    Here is a minimally functional (well, not really, but it runs) example of the code from the linked page I mentioned:

    use strict; use warnings; use Prima qw(Application Buttons); my $window = Prima::MainWindow->new( text => "Invisible Radios!", size => [300, 200], ); my $box = $window->insert( Widget => name => "box", pack => { fill => +"both", expand => 1, }, ); # Code straight from http://search.cpan.org/~karasik/Prima-1.41/Prima/ +Buttons.pm # only change is $box instead of $widget my $group = $box-> insert( 'Prima::GroupBox', onRadioClick => sub { print $_[1]-> text, "\n"; } ); $group-> insert( 'Prima::Radio', text => 'Selection 1'); $group-> insert( 'Prima::Radio', text => 'Selection 2', pressed => 1); $group-> index(0); # End of copied code! Prima->run();

    Examining the scripts that do display, I think that the problem is that the example code (and thus, my own) does not contain an origin attribute, without which, it appears the radios do not (properly) display.

    Unfortunately, this attribute is not mentioned anywhere on the page documenting buttons that I linked above (or any other documentation I found in my searching). This is quite sad, as it appears to be a required attribute.

    Thanks for pointing me in the right direction to figure it out.

    index(0); # End of copied code! Prima-

        Thank you for the info.

        I'd been using pack with other things, but I guess I thought radio buttons were one of those things you'd want to always work pretty much the same way by default, so I didn't think to use pack for them.

        I make so many silly mistakes.