Changeset 6437 for trunk


Ignore:
Timestamp:
Jul 22, 2016, 10:57:04 AM (8 years ago)
Author:
ldelgass
Message:

Make VisViewer? debug console toplevel window per viewer instance. Fixes errors
when mutliple viewer instances (e.g. multiple outputs using the same viewer
class) try to use a single debug console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/visviewer.tcl

    r6338 r6437  
    140140    private variable _trace 0;          # Protocol tracing for console
    141141    private variable _logging 0;        # Command logging to file
     142    private variable _console;          # Debug console window path
    142143    # Number of milliseconds to wait before idle timeout.  If greater than 0,
    143144    # automatically disconnect from the visualization server when idle timeout
     
    154155    set _servers(vtkvis)  "localhost:2010"
    155156    private common _done;               # Used to indicate status of send.
     157    private common _consoleCnt 0;
    156158}
    157159
     
    216218        set _trace 1
    217219    }
     220    incr _consoleCnt
     221    set _console ".renderconsole$_consoleCnt"
     222
    218223    eval itk_initialize $args
    219224}
     
    226231    interp delete $_parser
    227232    array unset _done $this
     233    if {[winfo exists $_console]} {
     234        destroy $_console
     235    }
    228236}
    229237
     
    706714#
    707715itcl::body Rappture::VisViewer::BuildConsole {} {
    708     toplevel .renderconsole
    709     wm protocol .renderconsole WM_DELETE_WINDOW [itcl::code $this HideConsole]
    710     set f .renderconsole
     716    toplevel $_console
     717    wm protocol $_console WM_DELETE_WINDOW [itcl::code $this HideConsole]
     718    set f $_console
    711719    frame $f.send
    712720    pack $f.send -side bottom -fill x
     
    763771#
    764772itcl::body Rappture::VisViewer::DebugConsole {} {
    765     if { ![winfo exists .renderconsole] } {
     773    if { ![winfo exists $_console] } {
    766774        BuildConsole
    767775    }
     
    769777        $this configure -sendcommand [itcl::code $this TraceComm]
    770778        $this configure -receivecommand [itcl::code $this TraceComm]
    771         wm deiconify .renderconsole
     779        wm deiconify $_console
    772780    } else {
    773781        $this configure -sendcommand ""
    774782        $this configure -receivecommand ""
    775         wm withdraw .renderconsole
     783        wm withdraw $_console
    776784    }
    777785}
Note: See TracChangeset for help on using the changeset viewer.