keck has asked for the wisdom of the Perl Monks concerning the following question:

Hi perl'ers, I'm using wxPerl/GTK+ under win32 as a replacement for tk in an existing application, and am having a problem with the RadioBox widget. The BackgroundColour of it's constituent RadioButtons are not inheriting from the RadioBox, nor the parent window, and I don't see a way to access them directly. Anybody see something I don't here?
Snippets: # Colors for main window. $self is the top-level frame. my $mainbg = Wx::Colour->new(0,102,179); $self->SetBackgroundStyle('wxBG_STYLE_CUSTOM'); $self->SetBackgroundColour($mainbg); $self->InheritAttributes() # .. later, $self->{rb} is a Wx::RadioBox $self->{rb}->SetBackgroundStyle('wxBG_STYLE_CUSTOM'); $self->{rb}->SetBackgroundColour($buttonbg) # The effect of above is to color the background behind # the text title of the radio box, not behind the radio # button elements. http://bsd-unix.net/~nate/example.jpg # shows what I mean.
Any idea how I can access the RadioButton elements within the RadioBox?

Replies are listed 'Best First'.
Re: wxPerl RadioBox Inheritance problem
by PodMaster (Abbot) on Sep 13, 2005 at 19:45 UTC
    Instead of
    $self->SetBackgroundStyle('wxBG_STYLE_CUSTOM');
    try
    $self->SetBackgroundStyle(Wx::wxBG_STYLE_CUSTOM());
    , since wxBG_STYLE_CUSTOM is supposed to be a constant(a function in perl), not a string.
    Any idea how I can access the RadioButton elements within the RadioBox?
    A wxRadioBox is a wxWindow, and wxWindow has a GetChildren method.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.