Ignore:
Timestamp:
Mar 6, 2007, 12:03:02 PM (18 years ago)
Author:
nkissebe
Message:

use molVisViewer as the molecule viewer if hubvis_server resource is set

File:
1 edited

Legend:

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

    r472 r607  
    3333
    3434    private variable _current ""  ;# active device editor
     35
     36    public common _hubvisHosts ""
     37
     38    public proc setHubvisServer {namelist} {
     39        if {[regexp {^[a-zA-Z0-9\.]+:[0-9]+(,[a-zA-Z0-9\.]+:[0-9]+)*$} $namelist match]} {
     40            set _hubvisHosts $namelist
     41        } else {
     42            error "bad visualization server address \"$namelist\": should be host:port,host:port,..."
     43        }
     44    }
    3545}
    3646                                                                               
    3747itk::usual DeviceEditor {
     48}
     49
     50# must use this name -- plugs into Rappture::resources::load
     51proc deviceEditor_init_resources {} {
     52    Rappture::resources::register \
     53        hubvis_server Rappture::DeviceEditor::setHubvisServer
    3854}
    3955
     
    132148            if {![winfo exists $itk_component(hull).mol]} {
    133149                catch {destroy $itk_component(hull).dev}
    134                 Rappture::MoleculeViewer $itk_component(hull).mol $this
     150                if {"" != $_hubvisHosts} {
     151                    Rappture::MolvisViewer $itk_component(hull).mol $_hubvisHosts
     152                } else {
     153                    Rappture::MoleculeViewer $itk_component(hull).mol $this
     154                }
    135155                pack $itk_component(hull).mol -expand yes -fill both
    136156            }
Note: See TracChangeset for help on using the changeset viewer.