Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
With astonishing indifference to thousands of existing Perl programs and newbies, some capricious genius at Gtk2 decided to disable by default all stock images displaying in buttons and it seems this is inherited by gtk2-perl since gtk+ 2.6. This generated large numbers of forum posts by puzzled users of course but nobody cares. This means stock images do not show in buttons unless explicitly turned on. I assume this applies to all widgets. Who knows. As usual there's little or no explanation, it's all got to be secret magic absorbed from the ether through experience and endless googling. I found something like the following in a snippet which, if I place this after creating my first button ($sortbutton) turns on the button image - weirdly - in a different button ($quitbutton) created later, $quitbutton is stock but $sortbutton is a stock gtk-refresh icon placed in an iconfactory with a custom label.
my $button = $sortbutton; my %buttonimages; $buttonimages{$button}=$button->get_settings; $buttonimages{$button}->set('gtk-button-images', !$buttonimages{$butto +n}->get('gtk-button-images'));
1. Despite referencing only one button ($sortbutton) this seems to turn on the images for other stock buttons (all of them?). Why? Is it supposed to? 2. How do I propagate this setting to the icon factory images? Or can I just change the label on a stock button image without an icon factory? 3. What is that second argument doing: !$buttonimages{$button}->get('gtk-button-images') Thanks

In reply to gtk2-perl: how to enable stock images in all widgets by wdef2

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (6)
    As of 2014-12-27 03:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (176 votes), past polls