1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| from PyQt4.QtGui import *
from PyQt4.QtCore import *
import controller_view
import msa_view
import sys
class View(QWidget):
def __init__(self):
super(View, self).__init__()
self.init()
self.number_msa=0
self.layout=QGridLayout()
def button_submit(self):
button = QPushButton('submit', self)
return button
def button_plus(self):
button = QPushButton('+algt',self)
return button
def display_msa(self, number_msa):
widget=QWidget()
layout= QGridLayout()
label=QLabel(self)
label.setText("MSA "+str(number_msa))
button_file = QPushButton('file', self)
self.connect(button_file, SIGNAL('clicked()'), self.control.choose_file)
filename=QLineEdit(self)
algt=QTextEdit(self)
button_remove = QPushButton('remove', self)
group=QGroupBox("format", self)
clustal=QRadioButton("clustal")
fasta=QRadioButton("fasta")
msf=QRadioButton("msf")
fasta.setChecked(1)
box=QHBoxLayout()
box.addWidget(fasta)
box.addWidget(clustal)
box.addWidget(msf)
group.setLayout(box)
layout.addWidget(label, 0,0)
layout.addWidget(button_file, 1,0)
layout.addWidget(filename, 1,1)
layout.addWidget(button_remove, 1,2)
layout.addWidget(algt, 2,1)
layout.addWidget(group, 3,0,1,2)
widget.setLayout(layout)
return widget
def init(self):
self.control = controller_view.Controller(self)
self.layout=QVBoxLayout()
self.layout.addWidget(self.display_msa(1))
self.layout.addWidget(self.display_msa(2))
self.layout.addWidget(self.button_submit())
self.layout.addWidget(self.button_plus())
self.setWindowTitle('MsaCompare')
self.setLayout(self.layout)
if __name__ == '__main__':
app=QApplication(sys.argv)
vw=View()
vw.show()
app.exec_() |
Partager