Hi. I’m back to studying Python.
Now reading up on classes and how to utilize it with UI:s.
I’m having some problems figuring out how to get exactly what I want though and so I turn to you.
I’m using the book “Maya Python for Games and Film”. They are distributing a base window class found here:
I then created another class which inherits from the base class, here:
import optwin reload(optwin) from optwin import AR_OptionsWindow class newWin(AR_OptionsWindow): def __init__(self): AR_OptionsWindow.__init__(self) self.title = 'Dag\'s window' self.window = 'dag\'s window' self.actionName = 'Huey' def displayOptions(self): mc.setParent(self.optionsForm) self.btnA = mc.button( label = "button A") mc.formLayout(self.optionsForm, edit=True, attachForm=( [self.btnA, 'left', 0], [self.btnA, 'right', 0], [self.btnA, 'top', 0], [self.btnA, 'bottom', 0], ), attachPosition=( [self.btnA, 'right', 0, 50], ) ) newWin.showUI()
It’s really simple. However I really can’t figure out how to align the button in the formlayout which is parented to the tab layout so it will scale with the window =/
Tried parenting the button to the mainForm instead and sure, that works, but I want it to be attached under the tab layout.
Thank you for reading!