From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mo DeJong To: sourcenav@sourceware.cygnus.com Subject: Re: Small suggestion and question Date: Tue, 03 Apr 2001 15:22:00 -0000 Message-id: References: <5.0.2.1.0.20010401175711.00a7dd60@plris.com> X-SW-Source: 2001-q2/msg00025.html On Sun, 1 Apr 2001 leonp@plris.com wrote: > Hello, > I use the SN for cross development (this time under Win2K without > CygWin). > > 1 - Suggestion: > It seems to be comfortable to have the "build" window be open as a > subwindow in text editor - it is always accessible and one can rebuild his > target fast after any small changes. What seems to be not so > comfortable is: > a) The necessity to confirm each change before build starts (may > be by default, if I pressed "build" button - save). Sounds interesting, basically a "fast save all" by default. A prefs option for that would not be too hard to add. > b) This "build" subwindow seems to occupy too much place with the > information which isn't so necessary at the moment - build command, build > directory, target. If you ask me, the result window with 3 buttons at the > same horizontal level will be brilliant. I think we would like to merge the dir and the command into the target itself. That way you could have targets like: autoconf: run ./configure make: run make You could also have targets that just call other targets, like autoconf + make. A little bit of work on the targets piece of the tools could make SN a whole lot more useful. You could do neat stuff like kick off a simulator. > 2 - Question: > When I run SN under Win2K it is VERY slow, which, besides making > the work nervous, causes SN errors. For example, pressing Ctrl-S and Ctrl-W > sequentually, causes an error below. This effect doesn't occur when running > under Linux on the same machine. Does somebody know any medicine to the > problem? I think that problem was fixed in the soon to be released 5.0 version. The attached patch should fix it for you in 4.5. Mo Index: busy.tcl =================================================================== RCS file: /cvs/cvsfiles/devo/snavigator/gui/Attic/busy.tcl,v retrieving revision 1.6.10.2 retrieving revision 1.6.10.2.14.1 diff -u -r1.6.10.2 -r1.6.10.2.14.1 --- busy.tcl 2000/02/11 23:48:55 1.6.10.2 +++ busy.tcl 2000/12/14 00:23:46 1.6.10.2.14.1 @@ -215,7 +215,7 @@ #already called if {! [info exists watch_num_calls($win)]} { sn_blt_busy hold_update $win - set watch_num_calls($win) 1 + set watch_num_calls($win) {} } else { sn_log "WARNING: (watch y $win) already called"; flush stderr } @@ -226,10 +226,35 @@ update idletasks; # Important ! } sn_blt_busy release $win + + # Run any watch_done callbacks + if {$watch_num_calls($win) != {}} { + foreach cmd $watch_num_calls($win) { + sn_log "running watch $win release command \"$cmd\"" + uplevel #0 $cmd + } + } catch {unset watch_num_calls($win)} } else { sn_log "WARNING: (watch n $win) wrongly called"; flush stderr } + } +} + +# This procedure will run the given cmd when the watch for a given window +# is released. If the given window is not currently locked with a watch +# then the command will be run right away. + +proc watch_done { win cmd } { + global watch_num_calls + if {! [info exists watch_num_calls($win)]} { + # Run the command right away + sn_log "!!!!!!!!!!!!!! Watch NOT held for $win, executing \"$cmd\"" + uplevel #0 $cmd + } else { + # Save it so that it will get run when the watch is released + sn_log "!!!!!!!!!!!!!! Watch HELD for $win release command \"$cmd\"" + lappend watch_num_calls($win) $cmd } } Index: multiappl.tcl =================================================================== RCS file: /cvs/cvsfiles/devo/snavigator/gui/Attic/multiappl.tcl,v retrieving revision 1.32.2.17.2.5.4.7 retrieving revision 1.32.2.17.2.5.4.7.14.1 diff -u -r1.32.2.17.2.5.4.7 -r1.32.2.17.2.5.4.7.14.1 --- multiappl.tcl 2000/02/11 23:49:20 1.32.2.17.2.5.4.7 +++ multiappl.tcl 2000/12/14 00:23:46 1.32.2.17.2.5.4.7.14.1 @@ -4099,7 +4099,11 @@ #this procedure is bound on Control-w, so don't #close window when it's the last one in the project if {[MultiWindow& @@ num_Existing_windows] > 1} { - catch {[winfo toplevel $w] windows_close dummy} + # Protect against destruction of the toplevel + # while the window is locked by a call to + # [watch $top y]. If there is no watch + set top [winfo toplevel $w] + watch_done $top "$top windows_close dummy" } } proc find_dialog {w} {