-
Notifications
You must be signed in to change notification settings - Fork 2
/
CheckBoxFrame.py
63 lines (56 loc) · 1.93 KB
/
CheckBoxFrame.py
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
import wx
import Imports
class CheckBoxFrame(wx.Frame):
"""select coloured features"""
def __init__(self):
wx.Frame.__init__(self , None,-1,"Selection View", size = (300, 200))
panel = wx.Panel(self,-1)
checkbox1 = wx.CheckBox(panel, -1, "CDS", (20,10),(90,30))
checkbox2 = wx.CheckBox(panel, -1, "Gene", (20,30),(90,30))
checkbox3 = wx.CheckBox(panel, -1, "Start Codon", (20,50),(90,30))
checkbox4 = wx.CheckBox(panel, -1, "Stop Codon", (20,70),(90,30))
btn1 = wx.Button(panel, -1, "color features", (150,100), (90,20))
#self.Bind(wx.EVT_BUTTON, self.CheckCheckboxes(), self)
checkbox1.Show()
checkbox2.Show()
checkbox3.Show()
btn1.Show()
self.Centre()
self.Show()
def CheckCheckboxes(self):
con = Imports.con
gfflist = con.getGFFList()
if checkbox1.checked():
print "check1 true"
for item in gfflist:
if item.getDescription() == "CDS":
item.setActive(False)
else:
print "testpi"
if checkbox2.checked():
print "check1 true"
for item in gfflist:
if item.getDescription() == "gene":
item.setActive(False)
else:
print "testpi2"
if checkbox3.Checked():
print "test3 checked"
for item in gfflist:
if item.getDescription() == "start_codon":
item.setActive(False)
else:
print "testpi3"
if checkbox4.Checked():
print "check 4 true"
for item in gfflist:
if item.getDescription() == "stop_codon":
item.setActive(False)
else:
print "testpi4"
def OnExit(self):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
CheckBoxFrame().Show()
app.MainLoop()