'Maya GUI layout
I have a problem with my GUI layout. I attached a screenshot of how it looks with this code but what I want is all buttons and text under "add a door" button to look exactly like the ones above the 4 move buttons. What should I do?
Also, another problem is when I change the number in the "self.size" to change the size of the window, nothing happens. I want to enlarge the window size what should I do?
def __init__(self):
self.window = "MR_Window"
self.title = "GUI"
self.size = (400, 400)
if cmds.window(self.window, exists = True):
cmds.deleteUI(self.window, window=True)
#create new window
self.window = cmds.window(self.window, title=self.title, widthHeight=self.size)
cmds.rowColumnLayout(nc = 1)
cmds.text("Select desired rooms")
cmds.separator(height=20)
self.cubeCreateBtn= cmds.button(label='Add a bedroom',command=self.createBedroom)
cmds.separator(height=20)
// more room buttons are here but omitted them for simplicity
cmds.rowColumnLayout(nc = 4, columnWidth=[(1, 100), (2, 100),(3,100),(4,100)])
self.moveR= cmds.button(label='Move Right',command=self.moveRight)
self.moveL= cmds.button(label='Move Left',command=self.moveLeft)
self.moveU= cmds.button(label='Move Up',command=self.moveUp)
self.moveD= cmds.button(label='Move Down',command=self.moveDown)
cmds.columnLayout(w=400)
cmds.separator(height=20)
self.connectionsBtn= cmds.button(label='Add a door',command=self.connect)
cmds.separator(height=20)
cmds.text("Select a room then move it desired place")
#display new window
cmds.showWindow()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
