-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new natlink function for controlling the message window #213
Comments
drmfinlay
added a commit
to drmfinlay/natlink
that referenced
this issue
Oct 17, 2024
Re: dictation-toolbox#213. This item is grayed out (disabled) by default, for now. I've added a separator between it and the File>Reload item.
I think I'll leave completely detaching the window from the NatSpeak connection for now. It is possible, but not strictly necessary here. |
drmfinlay
added a commit
to drmfinlay/natlink
that referenced
this issue
Oct 22, 2024
Re: dictation-toolbox#213. This item is grayed out (disabled) by default, for now. I've added a separator between it and the File>Reload item.
drmfinlay
added a commit
to drmfinlay/natlink
that referenced
this issue
Oct 22, 2024
Re: dictation-toolbox#213. The new function is setMessageWindow(). I have documented it in the NatlinkSource/natlink.txt file. It is now necessary to call this function with a Python callback to enable the message window. The default callback will soon reside in the natlinkcore code and be set from appsupp.cpp. Since it is related, this changeset includes modifications to the message window's File>Reload logic, re: dictation-toolbox#28. The default callback will do a narrower reloading of user modules.
drmfinlay
added a commit
to drmfinlay/natlink
that referenced
this issue
Oct 22, 2024
dougransom
pushed a commit
that referenced
this issue
Nov 26, 2024
* Fix Natlink message window pop-up menu initialization Re: #184. The message window's pop-up menu is now loaded from the executable resource data. It is easier to change now. * Add an Exit item to the Natlink message window's File sub-menu Re: #213. This item is grayed out (disabled) by default, for now. I've added a separator between it and the File>Reload item. * Adjust File>Exit menu item changes to do things the C++/Windows way Re: #184. That is, use boolean flags and a dedicated user window message to convey updates to the output window. This makes it easier to update the pop-up menu later down the line, if desired, by adding and hand- ling new flags. * Add a new function for controlling Natlink's message window Re: #213. The new function is setMessageWindow(). I have documented it in the NatlinkSource/natlink.txt file. It is now necessary to call this function with a Python callback to enable the message window. The default callback will soon reside in the natlinkcore code and be set from appsupp.cpp. Since it is related, this changeset includes modifications to the message window's File>Reload logic, re: #28. The default callback will do a narrower reloading of user modules. * Fix global callbacks that fail without thread safety This changes the CDragonCode::makeCallback() method to hold Python's GIL regardless of whether Natlink thread safety is enabled. A crash occurs if this is not done. * Adjust and fix the message window changes a little Re: #213. * Update appsupp - Show the message window before natConnect(). - Remove the now unused reloadPython() method. * Fix some indentation issues in two files * Fix a problem with setMessageWindow() * Stop releasing natlink objects on IDD_RELOAD This can cause inconsistent state in user/library code. ---------
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was an idea that developed from my thinking on issue #198.
In a nutshell, an additional, setTrayIcon-like function could be added to enable/disable the Natlink message window and to handle user events (as preferred) in Python. This would allow us to hide the window for users in a multi-user system who don't have Natlink enabled and to use it in remote python.exe processes (at least for testing).
The function name I propose to use is
setMessageWindow()
. This function would take a single parameter: a callback function to handle user events. Adding a new File>Exit menu item to the window seems appropriate as part of this change. Ditto for detaching the window from the NatSpeak connection.The following is the documentation I came up with:
I have this planned out and will try to make pull requests for review soon. I think it would be useful...
The text was updated successfully, but these errors were encountered: