Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
vicinity_window.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 # (c) Copyright Rosetta Commons Member Institutions.
4 # (c) This file is part of the Rosetta software suite and is made available under license.
5 # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
6 # (c) For more information, see http://www.rosettacommons.org. Questions about this can be
7 # (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
8 
9 ## @file /GUIs/pyrosetta_toolkit/window_modules/vicinity_options/vicinity_window.py
10 ## @brief Vicinity dialog window
11 ## @author Jared Adolf-Bryfogle (jadolfbr@gmail.com)
12 
13 from Tkinter import *
14 import tkSimpleDialog
15 from os import getcwd
16 
17 pwd = getcwd()
18 class vicinityrelaxwindow(tkSimpleDialog.Dialog):
19  """
20  This is the Vaccinity Relax Window to specify options while doing relax. May be used in other protocols if possible.
21  It is set as a tkSimpleDialog, but this can be changed fairly easily to allow more use.
22  """
23 
24  def body(self, main):
25  #self.main = Toplevel(main)
26  self.main = main
27  #self.main.title("Neighbor Options")
28  #self.column = column; #Column to begin Grid (Int)
29  #self.row = row; #Row to begin Grid (Int)
30  #self.pwd = pwd
31  row = 0; column= 0
32  #Options:
33  self.FixTarget = StringVar(); self.FixTarget.set("Open")
34  self.FixVaccinity = StringVar(); self.FixVaccinity.set("Open")
35  self.FixBoth = StringVar(); self.FixBoth.set("UnSet")
36 
37 
38  #Set Tk
39  print pwd
40  #Photo
41  VacPhoto =PhotoImage(file = (pwd+"/Media/Vaccinity_Smaller.gif"))
42  self.Photo = Label(self.main, image=VacPhoto)
43  self.Photo.image = VacPhoto
44 
45  #Button/Labels
46  #self.setOptionsbutton_ = Button(self.main, text = "Continue...", command = lambda: self.setOptions())
47  self.control = Label(self.main, text = "Control.")
48 
49  #Fix Options
50  self.FixBBlab = Label(self.main, text = " Loop/Target ")
51  self.FixBBOpt = OptionMenu(self.main, self.FixTarget, "Fix", "Fix BB", "Fix Chi", "Open")
52  self.FixChilabel_ = Label(self.main, text = " Vaccinity ")
53  self.FixChiOpt = OptionMenu(self.main, self.FixVaccinity, "Fix", "Fix BB", "Fix Chi", "Open")
54  self.FixBotlabel_ = Label(self.main, text = "Fix BackBone and Rotamers")
55  self.FixBothOpt = OptionMenu(self.main, self.FixBoth, "UnSet", "Target", "Vaccinity")
56 
57 
58  #ShoTk
59 
60  self.Photo.grid(row =row, column = column+1, rowspan=17, columnspan=17)
61  self.FixBBlab.grid(row = row+5, column= column)
62  self.FixBBOpt.grid(row = row+6, column = column, sticky="ew")
63 
64  self.FixChilabel_.grid(row=row+5, column = column+18)
65  self.FixChiOpt.grid(row=row+6, column = column+18, sticky="ew")
66 
67  self.FixBotlabel_.grid(row=row, column = column+8+1)
68  self.FixBothOpt.grid(row = row+1, column = column+8+1)
69 
70  self.control.grid(row=row+18, column=column+8+1)
71  #self.setOptionsbutton_.grid(row = row +19, column = column+8+1)
72  def apply(self):
73  fixloo = self.FixTarget.get()
74  fixvac = self.FixVaccinity.get()
75  fixboth = self.FixBoth.get()
76  self.result = (fixloo, fixvac, fixboth)
77  #self.main.destroy()
78