Skip to content

Commit 03b8d2e

Browse files
committed
combo add
1 parent 9b3f374 commit 03b8d2e

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

PyQt/.ipynb_checkpoints/Orysya-checkpoint.ipynb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"cell_type": "code",
72-
"execution_count": 6,
72+
"execution_count": 10,
7373
"metadata": {
7474
"collapsed": false
7575
},
@@ -79,7 +79,9 @@
7979
"output_type": "stream",
8080
"text": [
8181
"0\n",
82-
"Explore Individual Cell Lines\n"
82+
"Explore Individual Cell Lines\n",
83+
"1\n",
84+
"Cell Line Correlation\n"
8385
]
8486
}
8587
],
@@ -124,14 +126,15 @@
124126
" #use button groups\n",
125127
" # http://stackoverflow.com/questions/17402452/how-to-get-the-checked-radiobutton-from-a-groupbox-in-pyqt\n",
126128
" \n",
127-
" self.button_group.addButton(self.explore_button, 0) # add button at index zero\n",
129+
" self.button_group.addButton(self.explore_button, 0) # add button at index 0 \n",
128130
" self.button_group.addButton(self.correlation_button, 1)\n",
129131
" \n",
130132
" # Connect each radio button to a method to run when it's clicked\n",
131133
" self.connect(self.explore_button, SIGNAL(\"clicked()\"), self.radio_button_clicked)\n",
132134
" self.connect(self.correlation_button, SIGNAL(\"clicked()\"), self.radio_button_clicked)\n",
133135
" \n",
134136
" # Set layout of first tab\n",
137+
" # button group above is just a way to check if either button is pressed\n",
135138
" self.grid.addWidget(self.explore_button, 1,0)\n",
136139
" self.grid.addWidget(self.correlation_button, 1,1)\n",
137140
" tab1.setGeometry(1000,1000, 1000, 1000)\n",
@@ -146,11 +149,16 @@
146149
" \n",
147150
" # self.explore_button is index 0\n",
148151
" if self.button_group.checkedId() == 0: \n",
149-
" self.explore_button\n",
150152
" self.dropdown1 = QtGui.QComboBox(self)\n",
151153
" self.parameters = ['x', 'y', 'z']\n",
152154
" self.dropdown1.addItems(self.parameters)\n",
153155
" self.grid.addWidget(self.dropdown1, 2,0)\n",
156+
" elif self.button_group.checkedId() == 1: \n",
157+
" self.dropdown2 = QtGui.QComboBox(self)\n",
158+
" self.parameters2 = ['CPQ #', 'CCLE #']\n",
159+
" self.dropdown2.addItems(self.parameters2)\n",
160+
" self.grid.addWidget(self.dropdown2, 2,1)\n",
161+
" \n",
154162
" \n",
155163
" #self.grid.addWidget(self.explore_button, 1,0)\n",
156164
" print(self.button_group.checkedButton().text())\n",

PyQt/Orysya.ipynb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"cell_type": "code",
72-
"execution_count": 6,
72+
"execution_count": 10,
7373
"metadata": {
7474
"collapsed": false
7575
},
@@ -79,7 +79,9 @@
7979
"output_type": "stream",
8080
"text": [
8181
"0\n",
82-
"Explore Individual Cell Lines\n"
82+
"Explore Individual Cell Lines\n",
83+
"1\n",
84+
"Cell Line Correlation\n"
8385
]
8486
}
8587
],
@@ -124,14 +126,15 @@
124126
" #use button groups\n",
125127
" # http://stackoverflow.com/questions/17402452/how-to-get-the-checked-radiobutton-from-a-groupbox-in-pyqt\n",
126128
" \n",
127-
" self.button_group.addButton(self.explore_button, 0) # add button at index zero\n",
129+
" self.button_group.addButton(self.explore_button, 0) # add button at index 0 \n",
128130
" self.button_group.addButton(self.correlation_button, 1)\n",
129131
" \n",
130132
" # Connect each radio button to a method to run when it's clicked\n",
131133
" self.connect(self.explore_button, SIGNAL(\"clicked()\"), self.radio_button_clicked)\n",
132134
" self.connect(self.correlation_button, SIGNAL(\"clicked()\"), self.radio_button_clicked)\n",
133135
" \n",
134136
" # Set layout of first tab\n",
137+
" # button group above is just a way to check if either button is pressed\n",
135138
" self.grid.addWidget(self.explore_button, 1,0)\n",
136139
" self.grid.addWidget(self.correlation_button, 1,1)\n",
137140
" tab1.setGeometry(1000,1000, 1000, 1000)\n",
@@ -146,11 +149,16 @@
146149
" \n",
147150
" # self.explore_button is index 0\n",
148151
" if self.button_group.checkedId() == 0: \n",
149-
" self.explore_button\n",
150152
" self.dropdown1 = QtGui.QComboBox(self)\n",
151153
" self.parameters = ['x', 'y', 'z']\n",
152154
" self.dropdown1.addItems(self.parameters)\n",
153155
" self.grid.addWidget(self.dropdown1, 2,0)\n",
156+
" elif self.button_group.checkedId() == 1: \n",
157+
" self.dropdown2 = QtGui.QComboBox(self)\n",
158+
" self.parameters2 = ['CPQ #', 'CCLE #']\n",
159+
" self.dropdown2.addItems(self.parameters2)\n",
160+
" self.grid.addWidget(self.dropdown2, 2,1)\n",
161+
" \n",
154162
" \n",
155163
" #self.grid.addWidget(self.explore_button, 1,0)\n",
156164
" print(self.button_group.checkedButton().text())\n",

0 commit comments

Comments
 (0)