python命令窗口代码如何调整大小_可调整窗口大小命令pythonmay
自從我開始用Python編寫腳本以來,我就一直有這個問題。在
即使我在主“窗口”命令中添加了“寬度”和“高度”標志,大小總是根據最近的操作進行調整。明白我的意思嗎?在
它不是應該給我的尺寸總是和我在寬度和高度標志后面輸入的一樣嗎?在
有什么問題嗎?在
我不想使用sizeable標志,因為我在使用windows時總是需要調整它們。在
這種奇怪行為背后的真正原因可能是什么??在
我想打開我的窗口,不管我多少次通過拖動窗口的角來調整它的大小。。。在
如果需要,這里是我的python代碼。。。在import maya.cmds as cmds
def createGUI():
#If the window already exists, it will delete it.
if cmds.window('myWindow',exists=True):
cmds.deleteUI('myWindow')
#Creation window command
winControl=cmds.window('myWindow',title='BookShelf Generator',resizeToFitChildren=True, sizeable=False) #s=False does not allow the user to change the size of the window
#Windows Layout
#Top Part
#Header image
cmds.rowColumnLayout(w=400)
cmds.image( image='/home/s4915717/Stefano_Feltre_Scripting/artefacts/Images/UIheader02.png' )
cmds.setParent("..")
cmds.columnLayout(adjustableColumn=True,rowSpacing=0)
cmds.frameLayout( label='BookShelf Options',collapsable=False, mw=5, mh=5 )
cmds.text(label='Modify the value on the interace to create different aspect of the BookShelf.', align='center', height = 20)
cmds.separator(height=5)
cmds.columnLayout()
#Center Part
ShelfSizeControl=cmds.intSliderGrp(label='Shelfs Size',minValue=5.0,maxValue=200.0, value=50.0,field=True)
NumShelfsColumnControl = cmds.intSliderGrp(label='Num Shelfs Column', minValue=1, maxValue=10, value=3,field=True)
NumShelfsRowControl = cmds.intSliderGrp(label='Num Shelfs Row', minValue=1, maxValue=10, value=3,field=True)
GapShelfsColumnControl = cmds.intSliderGrp(label='Gap Column Shelfs', minValue=10, maxValue=50, value=10,field=True)
GapShelfsRowControl = cmds.intSliderGrp(label='Gap Row Shelfs', minValue=1, maxValue=30, value=1,field=True)
GapBooksControl = cmds.intSliderGrp(label='Gap Books', minValue=0, maxValue=1, value=0,field=True) #da controllare il valore massimo
cmds.text(label='Books Direction', align='center', height = 20)
DirectionControl = cmds.radioCollection()
Direction0 = cmds.radioButton( label='Front',align='left')
Direction1 = cmds.radioButton( label='Back',align='center')
Direction2 = cmds.radioButton( label='Random',align='right')
cmds.radioCollection( DirectionControl, edit=True, select=Direction0 )
cmds.columnLayout(adjustableColumn=True,rowSpacing=0)
cmds.separator(height=5)
#Bottom Part
#cmds.shelfButton(annotation='BookShelf Generator - Stefano Feltre', image = "commandButton.png", l='BookShelf', p='Custom', imageOverlayLabel='Spider', overlayLabelBackColor=(.6, .6, .6, .6), command=str("from SpiderGen import gui;reload(gui);gui.createUI()"))
#vedere come caricare un bottone nel custom
#Signature
cmds.text(label='Stefano Feltre - 2017', w=400, h=30, font="smallPlainLabelFont")
#This command make appear the window
cmds.showWindow(winControl)
createGUI()
我在命令“showwindow”后面找到了一個要添加的MEL代碼。但是我不能用Python翻譯它…這里是:
^{pr2}$
總結
以上是生活随笔為你收集整理的python命令窗口代码如何调整大小_可调整窗口大小命令pythonmay的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 系统设计综述——个人思考总结
- 下一篇: websocket python爬虫_p