Skip to content
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

Make some changes to Natlink's message window #214

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

drmfinlay
Copy link
Member

Re: #28, #184, #213.

This PR mostly changes the message window. There are a few minor, unrelated changes.

The message window may now be controlled by a new setMessageWindow() function, though it is still started automatically in appsupp.cpp. I have included documentation for this new function in NatlinkSource/natlink.txt.

The window may now also be displayed before natConnect() and the pop-up menu is easier to change.

I have also fixed the reload button. It now reloads user modules, via the new callback, instead of the Python interpreter.

This is to be merged in conjunction with a natlinkcore pull request I'll make shortly. To test: build and run an installer, then install my branch of natlinkcore with pip install -e.

Re: dictation-toolbox#184.

The message window's pop-up menu is now loaded from the executable
resource data.  It is easier to change now.
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.
Re: dictation-toolbox#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.
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.
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.
- Show the message window before natConnect().
- Remove the now unused reloadPython() method.
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
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants