I am following the sample dialog project, and I have added a wxTextCtrl to a saveFileDialog.
I would like to pass an initial string into the wxTextCtrl from my app, but I don't know how to do that. I tried adding a member function to "MyExtraPanel" that my app could call to pass in the string, but the panel is not created until a call to saveFileDialog.ShowModal, at which point it is too late to set the value, since the dialog has already been displayed, and the user has already clicked save or cancel.
I did a totally ugly hack, where the app puts the string into a global variable, and then "MyExtraPanel" retrieves it from the global, but there has to be a better way.
How does one pre-populate strings into MyExtraPanel?
I can post my code to dropbox if someone wants to look at it.
Passing variables into SetExtraControlCreator
-
- In need of some credit
- Posts: 2
- Joined: Sun Aug 04, 2019 4:11 pm
Re: Passing variables into SetExtraControlCreator
Looking through the API and the source, i don't think there is any other way.I did a totally ugly hack, where the app puts the string into a global variable, and then "MyExtraPanel" retrieves it from the global, but there has to be a better way.
SetExtraControlCreator() and ExtraControlCreatorFunction() would have to be expanded to accept an additional parameter.
Use the source, Luke!
-
- In need of some credit
- Posts: 2
- Joined: Sun Aug 04, 2019 4:11 pm
Re: Passing variables into SetExtraControlCreator
Ok - thanks for checking. I guess I'll just leave my hack in place.