Think about Loose Coupling | |
PerlMonks |
Re: Perl::Gtk2 --- Possible for a RadioButton to contain a Label Widget?by Ralesk (Pilgrim) |
on Jun 26, 2013 at 11:56 UTC ( [id://1040761]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|