in reply to Re: fork, tk, win32
in thread fork, tk, win32

Thanks! That's the most info I've gotten in a while. I really appreciate it.

You're totally right about putting the mainwindow after the if. I even just added a button and all is fine. I wonder though if this will help me in my final app. I will need to have a gui created, and then when they click "update" I want to go get a web page using fork, and use the results to show new stats on the gui basically. Can I just put the fork in a subroutine above the definition of the GUI? I guess I don't know enough to know if that would make a difference. If not, any thoughts on how to make that work? Thanks again!!!

Justin

Replies are listed 'Best First'.
Re: Re: Re: fork, tk, win32
by wog (Curate) on Jun 03, 2001 at 19:38 UTC
    With Tk, you probably want to look at the documentation for Tk::fileevent. One solution is to use the pipe or socketpair function to generate streams from your parent to your child and vice-versa. (perlipc gives an example of this under the heading Bidrectional Communication with Yourself.)

    The idea would be is that your child could act as a server, recieving notification from the parent when an update is needed. Then it could send the information back to the parent which could know its there from Tk::fileevent. (so the parent could do it within the Tk event loop.)