Window buttons hide them?

Window buttons hide them?

dg3duy
Collaborator Collaborator
559 Views
5 Replies
Message 1 of 6

Window buttons hide them?

dg3duy
Collaborator
Collaborator

my question is if it is possible to hide the title and the minimize and maximize buttons... I only need the close window button and to be able to move it to any place on the screen by moving it.
Any example you can give me?

 

def showUI():
    myWin = cmds.window(title="Fit Timeline", widthHeight=(240, 48), tlb=False, mb=False)
    cmds.columnLayout(adjustableColumn=True)
    cmds.button(label="Select Keys", command=select_key_range)
    cmds.button(label="Restore Timeline", command=restore_timeline)
    cmds.showWindow(myWin)
showUI()

 



dg3duy_0-1675476527187.png

import maya.cmds as cmds

window = cmds.window(title="", widthHeight=(200, 200))
cmds.showWindow(window)
cmds.window(window, edit=True, menuBar=False, minimizeButton=False, maximizeButton=False)

 

a major breakthrough... now I just want to remove the title... any suggestions?

dg3duy_0-1675514590206.png

 

 

 

0 Likes
Accepted solutions (2)
560 Views
5 Replies
Replies (5)
Message 2 of 6

Kahylan
Advisor
Advisor
Accepted solution

You can hide the titlebar with the "tb" flag. But the close window button is part of the title bar, so you will lose that as well if you don't have a titlebar. So there isn't really a way to do what you want with the Maya cmds library.

 

Maybe you could do something like this using an external library like pyqt5?

Message 3 of 6

dg3duy
Collaborator
Collaborator

@Kahylan Using pyqt5 is already an esoteric word for me.😅
I don't know anything related to pyqt5, the question that comes to my mind is if I generate a window with pyqt5 another user needs something additional installed for it to work on his pc?

0 Likes
Message 4 of 6

Kahylan
Advisor
Advisor

I'm not quite sure, but I think the user will need to have pyqt5 installed as well. But its a simple pip install that most users that use a lot of python plugins already have, so that shouldn't be to much of an issue.

If that is a problem for you, I'm afraid that you wont be able to do what you want in this post and will just have to accept an empty title bar.

Message 5 of 6

lucericr
Autodesk
Autodesk
Accepted solution

if you're specifying  title="" and you're getting the name of the application instead of a blank titlebar, simply make the title a single space.

Message 6 of 6

dg3duy
Collaborator
Collaborator

@lucericr great trick! very good! I loved it!

0 Likes