Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTWindow Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NTWindow Issue

    I'm having trouble identifying my NTWindow after recompiling code. I've attached a sample add on to show the issue. I've created a custom NTWindow of type MyNTWindow. When the window is created using the menu item I've added, the OnWindowCreated() method will successfully identify the window as a MyNTWindow object. However, if I recompile the code with the window opened, NT shows that the window is being destroyed and recreated, but it is not identifying it as a MyNTWindow object when it is being recreated. Am I missing step here?
    Attached Files

    #2
    Hello SystemTrading,

    The window in your script is being created when the button is clicked.

    The Addon itself is reloaded when a compile happens as this is required for any changes to the menu.

    If the button isn't clicked, a new window is created and that variable isn't set to anything.

    You could give you window a resource name and then find it by resource.

    However, why are you attempting to find the existing window in the OnWindowCreated() method?

    Any handlers assigned to buttons or any code running in the window will still be running and will still work even if the script does not have the existing window object saved to a variable.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Something is not working in my program after I recompile. My first instinct was that it was related to the recreation of the window, so I am really just trying to do some debugging.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, Today, 06:46 AM
      0 responses
      9 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, Yesterday, 05:21 PM
      0 responses
      14 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      15 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      82 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      48 views
      0 likes
      Last Post PaulMohn  
      Working...
      X