Hello fellow Perl people

I've been playing around with tie::Win32MemMap for the last day or so and can't figure out why it wont work with Tk's "-variable" or "-textvariable" fields.

I have a working program that updates a status bar:

$Status{'Total'} = 5; $s_bar->Label(-textvariable => \$Status{'Total'} )->pack();

That works great! Any time 'Total' changes, the status bar changes as well. But, when I try to tie that hash, all my values go away in the gui (But are still there in the hash when I look at it in the debugger)

tie %Status, 'Tie:Win32MemMap', { Create => Mem_New_Share, MapName => +'F_Status', Size => 10000 }; $Status{'Total'} = 5; $s_bar->Label(-textvariable => \$Status{'Total'} )->pack();

Now, the status bar shows nothing at all. Not even the initial value of 5. If I access 'F_Status' from another program, I see the value of 5 and can also change it... and confirm it's changed in another program...ie tie::Win32MemMap seems to be working perfectly.

Is there an issue with using tie and using Tk like this? I was hoping to use this as a way for other processes to report back to a central gui without making children and pipes.

Thanks for any insight to this.

Happy Turkey Day!!

Entities should not be multiplied unnecessarily.

In reply to Tie::Win32MemMap and Tk by Bagarre

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.