self.methodCombo = QComboBox()
self.methodCombo.addItem('method01')
self.methodCombo.addItem('method02')
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6c1e4e7e-74e4-4976-b7a5-f6cfa252016a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class Test(QtGui.QDialog):
def __init__(self):
super(Test, self).__init__()
self.combo = QtGui.QComboBox()
self.combo.addItem("First Callback", self.callback1)
self.combo.addItem("Second Callback", self.callback2)
self.combo.activated.connect(self._comboActivated)
layout = QtGui.QVBoxLayout(self)
layout.addWidget(self.combo)
def callback1(self):
print "callback1"
def callback2(self):
print "callback2"
def _comboActivated(self, idx):
fn = self.combo.itemData(idx)
fn()
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC1AzRyoV7f-tdpxTG-8K9CcvnBsdKRp6PoWubBNaXf-A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA25-VXx%3D9N6EYCMsp8Uj6ypNAh-ZJtr%2B%3DXz8KYDQ48XVw%40mail.gmail.com.
On 20/10/2014 7:56 PM, "Fredrik Averpil" <fredrik...@gmail.com> wrote:
>
> That's pretty neat. I would have used a whole lot more code. Thanks for the tip, Justin.
>
No problem!
> To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWNfD_LxcBLDn-nhK6BrMSCOogTxBZCOckFCw7MXxnxA4Q%40mail.gmail.com.