5E Product Walkthrough Playlist
  1. #1

    findWindow() syntax to find a panel?

    Trying to figure out how to to locate the windowinstance for a panel using the Interface.findWindow function.

    Have a panel like so:
      <panel name="shortcuts" modes="host">
    with class definition:
      <windowclass name="shortcuts_dm">
            <nodrag />
            <closetoggle />
    I'd like to find that panel in order to disable the windowreferencecontrol but findWindow doesn't seem to be locating it.

    I though this would work since the panel class has no database node but it just gives an "invalid parameters passed to findWindow" error:
    Interface.findWindow("shortcuts_dm"), nil);
    Also tried:
    Interface.findWindow("shortcuts_dm"), "");
    Interface.findWindow("shortcuts_dm"), "nil");
    both of which return nil

    Anyone know how to do this?
    Work Less, Game More!

  2. #2
    Interface.findWindow("shortcuts_dm", ""); should work. I use this all the time for custom windowclass controls not tied to the DB.

  3. #3
    Cheers Joshua.
    Will triple-check my code. Probably some silly mistake like an incorrect uppercase/lowercase character...
    Work Less, Game More!

  4. #4
    Bump. I still can't figure out how to use findWindow to find a panel.

    e.g. trying to find the chat window:
    if Interface.findWindow("chat", "") then
      print("found chat");
      print("couldnt find chat");

    comes back with "couldnt find chat"...

    Works fine for normal windowclasses that are not bound to a datasource but not for classes used for panels.
    Work Less, Game More!

  5. #5


    Aha! Now I see your sneaky bit of coding! And I shall make like a and it for my own nefarious purposes!

    Or in english:
    The onInit function in chat_chat.lua stores a reference to the chat window (self) within the ChatManager.lua script block. Hence, I can access the chat window from anywhere else by caalling a function I have added to ChatManager.lua!
    Work Less, Game More!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Log in

Log in