I haven't needed these yet, and maybe never will, but is there an easy way to get handles for Npp and Scintilla in case I want to use ctypes and sendmessage?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't think of any direct way, but we could add it. But, there be
dragons...
Any time a call to scintilla or n++ is made, the gil (global interpreter
lock) is given up, and reclaimed when the call returns. This is done such
that callbacks can have a chance to run while the call is made. If you make
these calls from within python itself, the gil would never be given up and
kittens might die.
How about a way to call a generic n++/scintilla call, using ctypes to
provide the parameters. That way we can manage the gil, and not end up with
dead kittens? I'm not quite sure how this would look, but it sounds
feasible.
I was thinking about calls like NPPM_GETOPENFILENAMES, which might be wrapped by notepad.getFiles, and I think was adjusted in the latest version. It returns an array so not sure if such variations could be handled with a generic wrapper function? If so, then great.
I haven't needed these yet, and maybe never will, but is there an easy way to get handles for Npp and Scintilla in case I want to use ctypes and sendmessage?
Dave B.,
I would also be interested to hear your thoughts on this. Please see if you can find a few minutes to weigh in. Thanks!
I can't think of any direct way, but we could add it. But, there be
dragons...
Any time a call to scintilla or n++ is made, the gil (global interpreter
lock) is given up, and reclaimed when the call returns. This is done such
that callbacks can have a chance to run while the call is made. If you make
these calls from within python itself, the gil would never be given up and
kittens might die.
How about a way to call a generic n++/scintilla call, using ctypes to
provide the parameters. That way we can manage the gil, and not end up with
dead kittens? I'm not quite sure how this would look, but it sounds
feasible.
Dave
On 25 Sep 2014 04:05, "Dave W." oldwarhorse@users.sf.net wrote:
I was thinking about calls like NPPM_GETOPENFILENAMES, which might be wrapped by notepad.getFiles, and I think was adjusted in the latest version. It returns an array so not sure if such variations could be handled with a generic wrapper function? If so, then great.
Would it help if something like this was done?
Last edit: GravityWell 2014-10-01