Call back to a WindowManager method

In a derived WindowManager class, I have a reference to a class that manages sheet controls.

MyWindowMgr  CLASS(WindowManager)
MySheetMgr       &MySheetClass

If I now want MySheetClass to directly call back to a MyWindowMgr method (maybe Reset), what is the easiest/best way to reference the MyWindowMgr class?

Not sure exactly what you’re asking, but have you looked at WindowComponent?

1 Like

Such things are always clear until one tries to explain them.
I did look at WindowComponent but it did not seem quite right for the situation.

I would like to call a MyWindowMgr method from within MySheetClass.
Admittedly, it does seem a bit circular.

You’ll need to pass a reference of MyWindowMgr into you MySheetClass.

Thank you. That was the only solution I could think of.
Seemed a bit odd – “I reference you, you reference me.”

I have this explorer that allows trying every PROP that modifies Sheets and Tabs that you may find useful for writing your class.

4 Likes

You can certainly inject the my WindowManager and call into it.

But another approach is to define an interface which you then implement in MyWindowManager and then inject that into mySheetClass, then just call into the interface.