Bagarre has asked for the wisdom of the Perl Monks concerning the following question:
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!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie::Win32MemMap and Tk
by PodMaster (Abbot) on Nov 26, 2003 at 15:13 UTC |