hi all,
i want to change (kind of dynamically) the NumberOfCollums of a rowCollumnLayout inside a Maya Window. Depending on the value given by ‘SLiBThumbSizeComboBox’ i want to change the count for the collumns.
Here the Problem: When running my 2 functions inside the Script Editor everything is working fine. I execute the first one - the ScrollLayout is created. I execute the second and the rowColumnLayout is created with the right count of collumns. But when i try run it only by the first function, meaning the second function is called at the end of the first one - it’s not working anymore?! Combining the two Functions also not working. I always get the error message, that NumberOfCollumns has to be greater than 0 ?! Only when splitting them and running one after the other it’s working…
My Goal is to create a window that can be resized and after an refresh function it has added or removed collumns from the layout. So that the scrollLayout is always filled out…
Hope that makes sense for you.
def FunctionA():
…if cmds.scrollLayout(‘SLiBScrollLayout’, query = True, exists = True):
…cmds.deleteUI(‘SLiBScrollLayout’, layout = True)
…cmds.scrollLayout(‘SLiBScrollLayout’, p=“SLiB_thumbsframe”)
def FunctionB():
…iconLayout = cmds.optionMenu(‘SLiBThumbSizeComboBox’, query = True, value = True)
…iconSize = iconLayout.split(‘x’)
…iconDiv = int(iconSize[0])
…n = int(cmds.scrollLayout(“SLiBScrollLayout”, query=True, saw=1)/iconDiv)
…cmds.rowColumnLayout(‘Icons’, numberOfColumns=n, p=“SLiBScrollLayout”)
thanks in advance
Daniel