Menu

Npp and Scintilla handles?

Help
2014-09-15
2014-10-01
  • GravityWell

    GravityWell - 2014-09-15

    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 W.

    Dave W. - 2014-09-25

    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!

     
    • Dave Brotherstone

      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:

      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!


      Npp and Scintilla handles?


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/npppythonscript/discussion/1188886/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       
  • GravityWell

    GravityWell - 2014-10-01

    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?

    editor.gilrelease()
    ctypes.sendmessage(npphandle, NPPM_GETOPENFILENAMES, wparam, lparam)
    ...
    editor.gilreclaim()
    
     

    Last edit: GravityWell 2014-10-01

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.