• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

accountselector cleanup

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

    accountselector cleanup

    Hello, i am using an AccountSelector within an AddonBase and looking at the cleanup in handling the

    accountSelector.SelectionChanged & account.Selected.AccountItemUpdate

    components.

    For the AccountSelector in the help it mentions the cleanup() which disposes of the AccountSelector and to call NTTabPage.base.Cleanup()

    how does one do this within a class derived from AddonBase as i am not using and do not need a tab in my addon for this instance?

    Also within my OnWindowCreated( Window window) within Addon base - this is where i install my addon to an existing Window .. in this case checking for window as Chart.

    Now all this is working fine and i see OnWindowCreated() is called whenever a new NTWindow is created.

    Is there a method within the Addon framework which will be called whenever a new tab is created within an NTwindow ? can i get a notfication for this? ie onWindowTab() .. distinct from the addon tabs?

    thanks

    #2
    Hello soulfx,

    Below I am providing a link to an example script that demonstrates detecting when a tab is opened (added to the tab collection), closed (removed from the tab collection), selected (loaded), or unselected (unloaded).

    http://ninjatrader.com/support/forum...182#post502182

    I would recommend removing handlers from events when the TabCollection change event triggers as the tab is removed.

    If the addon does not have tabs, I would recommend removing the handlers in a handler added to the unloaded event of the NTWindow.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      at NTWindow derived classes is also a eventhandler called "Closed" available. I have put all my cleanups to this handler.
      Probably the Unloaded and the Closed handlers are fired at the same time when window is closing.

      Comment


        #4
        Thanks Chelsea, i did see this when searching forum. Given it is the chart tab collection changes i need not the addon - this gave me the insight to what i need and is working based on changes to the chart tab control.

        Thanks GoSPvC - it is the AddonBase that i am using and so i have been doing the cleanup of resources and handlers in the onWindowDestroyed() which seems to be working fine ; i just wondered if there was a better/ alternate place to cleanup given this is derived from AddonBase and thus a chart window instance and not an Addon NTWindow.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Bouzayen, Today, 08:31 PM
        0 responses
        8 views
        0 likes
        Last Post Bouzayen  
        Started by IanC28, 03-27-2020, 10:20 AM
        6 responses
        28 views
        0 likes
        Last Post jim1234
        by jim1234
         
        Started by aramtrader, Yesterday, 03:05 PM
        7 responses
        38 views
        0 likes
        Last Post woodie1
        by woodie1
         
        Started by renehtx, Today, 03:51 PM
        2 responses
        16 views
        0 likes
        Last Post renehtx
        by renehtx
         
        Started by eidog2020, Today, 03:31 PM
        0 responses
        7 views
        0 likes
        Last Post eidog2020  
        Working...
        X