Okay I give up. I have googled and googled. I swear there is not a single explicit snippet on the entire web about how to do this in gtk2-perl, which unfortunately says something about the documentation, given that it must be a very common problem. Usually I can find a snippet to show me how to do just about anything in Perl if I look hard enough. Not this time.

I have a widget displaying a default image. Once the action starts in a callback, I want to change that displayed image.

I have tried printing to an indirect filehandle as for communicating between subs, and that doesn't work. I have tried calling $img_scaled->show() or Gtk2 ->main_iteration again in the callback's sub until I'm blue in the face. It just don't work. It seems the main loop is blocked on that callback and simply cannot see a change to that global pixbuf made in a callback. And yet I can pass refreshed text to a textbox in that same UI using the indirect filehandle method.

Help please, O Monks! (*teeth marks on my laptop*).


In reply to gtk2-perl: how to update image widget from callback? 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!
  • 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.