I read what documentation I found and I checked out the ManPage for Gtk2::RadioButton and couldn't find anything about using Label Widgets with this. But I figured maybe it was possible since most of the documentation I found for Gtk2 doesn't always show every single method that each particular widget is capable of using. For instance the info I found for some of the Widgets don't include some of the methods like; "modify_bg()" and "modify_fg()", I found were missing from a few of the Widgets Method's lists...

This is something that can be bothersome at first, but it’s actually useful. The widgets are organised into a hierarchy, and so, widget types deep in the hierarchy will have many methods inherited from higher up. Since everything visible is a Gtk2::Widget you should look at that man page too. Sometimes also somewhere inbetween (eg. Gtk2::Editable for Gtk2::Entry, or Gtk2::ToggleButton for Gtk2::RadioButton). These hierarchical relationships are written in every piece of documentation in the Gtk2 module.

What’s slightly more annoying is the lack of explanations under the methods, so you’ll need to go to eg. GtkRadioButton and read their explanations there.

As for the actual question about colouring: indeed, some widgets, including Gtk2::Label don’t have a full drawn area and they’re always transparent — you’ll need to wrap them in something that does, for example a Gtk2::EventBox. Then you’ll be able to colour the background of that and it will be visible through the Label.


Update: Added link to GtkLabel rendering info.

In reply to Re: Perl::Gtk2 --- Possible for a RadioButton to contain a Label Widget? by Ralesk
in thread Perl::Gtk2 --- Possible for a RadioButton to contain a Label Widget? by mmartin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.