Alright! Thanks, however, seems like I missed something "important". The thread is actually the GUI part...
my $GuiThread = threads->create("startSystray"); sub startSystray { $mw_win32 = new Win32::GUI::Window( -width => 0, -height => 0, -name => 'MainWindow'); $systray_menu = new Win32::GUI::Menu( "SystrayMenu Functions" => "SystrayMenu", "> Info" => "SystrayInfo", "> Exit" => "SystrayExit" ); new Win32::GUI::NotifyIcon($mw_win32, -name => "SysTray", -id => 1, -icon => $icon); my $call = Win32::GUI::Dialog(); } sub SystrayInfo_Click { # my $A = new Win32::GUI::AcceleratorTable( # #"Ctrl-X" => "Close", # "Shift-N" => "New", # #"Ctrl-Alt-Del" => "Reboot", # "Shift-A" => sub { print "Hello\n"; }, # ); $infoWindow = new Win32::GUI::Window ( $mw_win32, -width => 400, -height => 200, -left => 300, -top => 400, -name => "infoWindow", # -accel => \$A ); my $text = join "\n", @actionHistory; $richEdit = new Win32::GUI::RichEdit ( ... ); }
That is, the GUI is a thread on its own. Not sure how to solve this, and in a good way. I can't really send the $richEdit to the _Click() function... Not that I know of anyway. (That's one of the reasons I have the richedit as global...) Thing is, the $richEdit is not defined for thread 1 (the noneGUI thread) for starters. Its only defined when user klicks in tray. So, I cant pass like that either it seems... Hmm...

Edit: Maybe Im gonna create the GUI, and hide it. Only show when klicking in tray...

In reply to Re^2: Sharing Win32::GUI::RichEdit... by Ace128
in thread Sharing Win32::GUI::RichEdit... by Ace128

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.