in reply to Re: Sharing Tk-module objects in threads
in thread Sharing Tk-module objects in threads

BrowserUk, you bloody champ you !!
Guess what, I found out a way aswell ! Using IO::Pipe.

I figured out the following way to achieve my goal but you beat me to it.. L: hehe. And you know what, It's the repeat Tk method aswell o_(.
PLUS, I am using fork again. When I said I wasn't going to. But your way is very nice.
use IO::Pipe; use Tk; $pipe = new IO::Pipe; create_tk_window(); if($pid = fork()) { # Parent $pipe->reader(); $mw->MainLoop; }elsif(defined $pid) { # Child $pipe->writer(); while(1) { write_to_pipe(); } } sub write_to_pipe { $pipe->write("Who's a jebroni - Not me Not me"); } sub display_handle_data { my $pipe_data; $pipe->sysread($pipe_data,100024); $server_list_listbox->insert('end',"GOT $pipe_data"); $server_list_listbox->see('end'); } sub create_tk_window { $mw=MainWindow->new ( -background=>'#dedede', -foreground=>'yellow', -title=>"FingerLick - Only eye nows the gows wehn the wind blo +ws" ); $mw->geometry("802x618"); $mw->minsize(802,618); $mw->maxsize(802,618); $mw->repeat(1.001,sub { display_handle_data() }); $sent_recvd_listbox=$mw->Listbox ( -height=>1, -width=>60, -background=>'black', -foreground=>'yellow' )->pack(-side=>'bottom',-anchor=>'s',-pady=>2); $server_list_listbox=$mw->Scrolled ( "Listbox", -height=>20, -width=>60, -background=>'white', -foreground=>'black', -scrollbars=>'se', )->pack(); }
The Threads::Queue method that you have suggested may be the winner I think.
We shall see after some tests...etc..

Thank you very much BrowserUk. Now things are moving forward a lil more...
I wanted to finish this thing by this weekend, looks like I may now.

Thanks alot mate : _)