Skip to content

Commit

Permalink
Updated documentation and fixed bug when using VMD in text mode
Browse files Browse the repository at this point in the history
-check for Tk package before calling winfo
  • Loading branch information
Leif Hickey committed Jun 27, 2013
1 parent 59730cf commit 7d7c475
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,29 @@ To install:
e.g. change:

- the file name `.vmdrc` _to_ `vmd.rc`
- the directory `$HOME` _to_ `%USERPROFILE%` (_e.g._ `C:\Users\myuser\vmd.rc`)
- the directory `$HOME` _to_ `%USERPROFILE%` ( _e.g._ `C:\Users\myuser\vmd.rc`)
- the line

```tcl
set auto_path [linsert $auto_path 0 [file join $env(HOME) vmdplugins]]
```

_to_
_to_

```tcl
set auto_path [linsert $auto_path 0 {C:\vmdplugins}
set auto_path [linsert $auto_path 0 {C:\vmdplugins}]
```

(substitute `C:\vmdplugins` with your plugin directory location)
(substitute `C:\vmdplugins` with your plugin directory location)

After installing, the vmdplugins directory should look like this:

vmdplugins/
+-- liquify/
| +-- liquify.tcl
| +-- pkgIndex.tcl

```
vmdplugins/
+-- liquify/
| +-- liquify.tcl
| +-- pkgIndex.tcl
```

Using the Plugin
------------------
Expand Down
11 changes: 8 additions & 3 deletions liquify.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,13 @@ proc Liquify::set_defaults {} {
set options(-savedir) [pwd]
set options(-savefile) ""
set options(-cube) 0
if {[winfo exists .liquify]} {
$Liquify::w.f2.y-e1 configure -state normal
$Liquify::w.f2.z-e1 configure -state normal
if {[catch {package present Tk} res]} {
puts "No X present"
} else {
if {[winfo exists .liquify]} {
$Liquify::w.f2.y-e1 configure -state normal
$Liquify::w.f2.z-e1 configure -state normal
}
}
set options(-adj_radii) 1.0
set options(-density) 1.0
Expand Down Expand Up @@ -462,6 +466,7 @@ proc Liquify::populate { gui } {
vmdcon -info "Calculating randomly packed density..."
set density [format "%.4f g/mL" [Liquify::calc_density]]
vmdcon "density: $density\n"
vmdcon "number molecules added: $tot_resid\n"

return 1
}
Expand Down

0 comments on commit 7d7c475

Please sign in to comment.