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:
http://maya-python.com/files/optwin.py
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 attach the button in the tab layout to the bottom 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 to the tab layout. Also tried creating another form layout inside the tablayout(whatever that would do), but it looked the same of course.
Thank you for reading! :nod: