0

I've got a pretty complex question for any Maya coders...

I want to utilize a drop down menu similar to that of the cmdScrollFieldExecuter's [script editor's] "Show Tooltip Help". It looks like a window that has been appended to the bottom of the inputted text with a feedback of all relative commands or strings.

Does anyone have experience with appending a similar textbox/ window/ menu to typed input, and if so, can you toss me in the right direction?

Note: I am not talking about "optionMenu".

Alternatively, is there a way to get cmdScrollFieldExecuter to reference a different array or set of strings?

SirJames
  • 387
  • 8
  • 27

1 Answers1

1

A complete port of that won't be possible in vanilla Maya - You'd need to use python and QT because the built-in GUI objects (such as TextField) don't fire any events on keypresses so you won't be able to live-update as the user types.

You can almost fake the visual appearance with a window whose title bar is set to off. Use a formLayout to dock a TextScrollField inside it. You'll need to hack up some way of dismissing it since it won't have a close box -- you could put it on a timer or add an invisible button covering the whole thing which closed the window when clicked

theodox
  • 12,028
  • 3
  • 23
  • 36
  • I tried something similar to that, already. I appended a window to the general location, but eventually the window stopped appearing in the specified x,y. It seems to be an issue with only Python and not MelScript... – SirJames May 29 '16 at 20:16
  • You may want to check the window view in your OS to make sure that the new window hasn't ended up behind the man maya window – theodox May 29 '16 at 21:58
  • It appears to not be behind the main maya window. It's simply providing its own coordinates for no reason. – SirJames May 31 '16 at 17:03
  • If you're recycling the name of the window you may be getting it from your windowPrefs.mel – theodox May 31 '16 at 17:08
  • I've checked, there are no recycled names for this particular window (not even by Maya default prefs). Must just be a strange reoccurring glitch. – SirJames Jun 01 '16 at 20:59
  • if you hang on to the name of the window, you can `cmds.window(windowname, q=True, tlc =True) it's let you find the missing winwo – theodox Jun 02 '16 at 17:20
  • Ah, the window isn't missing. It just "spawns" randomly on the screen within a set amount of pixels. I've specified the tlc =(100,500). It takes that location and places it at anywhere between +/- 50 and +/- 90 pixels from the location. The window is removed via: Try: cmds.deleteUI('windowname') except: pass to reset the window and values yet continues to spawn it randomly on the screen. – SirJames Jun 02 '16 at 18:43
  • Meh, it doesn't matter anymore; I'll just append a textFieldGrp to my current window. – SirJames Jun 02 '16 at 18:44