Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have some trouble with refreshing my Tk scripts. The scripts include some functions that last a long period of time. When they are executed, the whole program hangs until they complete. And the user interface is blocking. I tried "update idletasks", but it just update after the "functions" complete. What I need is to refresh when the "functions" are execting. I also tried "thread" and "trace", but in my opinion they didnot work. Can anyone give me some advice? Thank you! Regards, zhoujingyu
Post Follow-up to this messageOn Mar 31, 11:03 pm, 1985zhoujin...@163.com wrote: > Hi, > I have some trouble with refreshing my Tk scripts. The scripts include > some functions that last a long period of time. When they are > executed, the whole program hangs until they complete. And the user > interface is blocking. > I tried "update idletasks", but it just update after the "functions" > complete. What I need is to refresh when the "functions" are > execting. > I also tried "thread" and "trace", but in my opinion they didnot work. > Can anyone give me some advice? Thank you! > > Regards, > zhoujingyu See http://wiki.tcl.tk/1526 and http://wiki.tcl.tk/946.
Post Follow-up to this messageOn 4=D4=C21=C8=D5, =CF=C2=CE=E73=CA=B117=B7=D6, Aric Bills <aric.bi...@gmail = .com> wrote: > > Seehttp://wiki.tcl.tk/1526andhttp://wiki.tcl.tk/946. Hi, I went through the two pages, and they tell me to refresh with "recursion" function. But I cannot make my program a recursion function, and I have no idea how to make use of "recursion". My program includes series of sub-functions, that is not my own code, and packed in DLLs, thus cannot be modefied. I try to use "recursion", such as a "clock time label" that update automatically. And at the same time, my program is running in the same interpreter. However it is still blocking, when a long time function is executed. And the "clock time label" also blocks. I'm crying for you help. Thank you! Regards, zhoujingyu
Post Follow-up to this messageIt would be helpful if you could provide some more information about the program. How does your program call the functions in the DLLs (are they in a Tcl extension?) What do you want the GUI to do while the functions are running? If, in addition to answering these questions, you could post the part of your code that calls the slow functions, it will be easier to make meaningful suggestions. Thanks, Aric
Post Follow-up to this messageOn 4=D4=C23=C8=D5, =CF=C2=CE=E74=CA=B115=B7=D6, Aric Bills <aric.bi...@gmail = .com> wrote: > It would be helpful if you could provide some more information about > the program. How does your program call the functions in the DLLs > (are they in a Tcl extension?) What do you want the GUI to do while > the functions are running? If, in addition to answering these > questions, you could post the part of your code that calls the slow > functions, it will be easier to make meaningful suggestions. > > Thanks, > Aric Hi,Aric It is a program to test Network devices working with SmartBits. I will source the library(like lib.tcl), and DLLs are automatically loaded. And now, I can use library functions, like "NSSocketLink" which is used to connect my PC to the SmartBits. This function is called when a "button" in my GUI is clicked, and this procedure will last a period of time. And now the GUI is blocking. I will raise some trivial codes later. Regard, zhoujingyu
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.