Community
    • Login

    Call Tip Color change

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    39 Posts 6 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lycan ThropeL
      Lycan Thrope
      last edited by

      I’m not sure how this is going to work, but I’ve put in a feature request via GitHub about being able change the CallTip coloring. I’ve read several times here that someone says there’s nothing they can do to help, so that’s why I put in the feature request #11036. I also set about trying to find any options in the config files etc, to see if there was any setting in those that would allow a change. For those with old or bad eyes, this screenshot reeks of need change, other than switching to a dark mode:
      A_NeedToColorCallTipHintBox.PNG

      I started looking into the Scintilla documentation and found references to what needs to be set at this link. with these calls

      SCI_CALLTIPSETBACK(colour back)
      The background colour of call tips can be set with this message; the default colour is white. It is not a good idea to set a dark colour as the background as the default colour for normal calltip text is mid grey and the default colour for highlighted text is dark blue. This also sets the background colour of STYLE_CALLTIP.
      
      SCI_CALLTIPSETFORE(colour fore)
      The colour of call tip text can be set with this message; the default colour is mid grey. This also sets the foreground colour of STYLE_CALLTIP.
      

      So I guess the question becomes, is there a way to set this via config that I don’t know about? I haven’t found any looking through the files, but an .ini would have been a good place to allow that setting. Even in the UDL Dialog, would have been a great place to set that kind of setting.

      Maybe Alan can let me know what, if anything can be done with the PythonScript and how to implement it. I’ll keep looking but I’ve got a feeling it’s not going to be an easy fix option. :-(

      I have, at least one user of the UDL that’s up there with eye issues and mine aren’t the greatest either, so… any help would be appreciated. Where would I even put this Python aspect (presuming I can learn it and do it) anyway?

      Thanks in advance for any info or help.

      Lee

      Nick BrownN Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Nick BrownN
        Nick Brown @Lycan Thrope
        last edited by

        @lycan-thrope

        This is part of the settings I use in my startup.py pythonscript file:

        for e in (editor1, editor2):
            e.callTipSetBack((255, 255, 176))
            e.callTipSetFore((0, 0, 0))
        
        Michael VincentM Lycan ThropeL 2 Replies Last reply Reply Quote 5
        • Alan KilbornA
          Alan Kilborn @Lycan Thrope
          last edited by

          @lycan-thrope said in Call Tip Color change:

          Maybe Alan can let me know what, if anything can be done with the PythonScript and how to implement it. I’ll keep looking but I’ve got a feeling it’s not going to be an easy fix option.

          It is easy, and Nick provided the same way I do it.

          1 Reply Last reply Reply Quote 2
          • Michael VincentM
            Michael Vincent @Nick Brown
            last edited by

            @nick-brown said in Call Tip Color change:

            This is part of the settings I use in my startup.py pythonscript file:
            for e in (editor1, editor2):
            e.callTipSetBack((255, 255, 176))
            e.callTipSetFore((0, 0, 0))

            Thanks for that! I was changing CallTip background as well but doing it with Scintilla styles (callTipUseStyle, and then styleSetFore|Back) which needed to be reset every buffer change. So I had a PythonScript callback on buffer activation to (re)set my call tip new colors. I didn’t see this much simpler call in Scintilla docs. Saves me a line of code and then removing an entire script for buffer callback!

            Cheers.

            1 Reply Last reply Reply Quote 3
            • Lycan ThropeL
              Lycan Thrope @Nick Brown
              last edited by

              @nick-brown said in Call Tip Color change:

              for e in (editor1, editor2):
              e.callTipSetBack((255, 255, 176))
              e.callTipSetFore((0, 0, 0))

              Thank you. Now, I’m going to stick it in somewhere in the file below stderr, and hope for the best. I have no clue about Python, Python script, but I have the plugin installed, tried clicking on startup.py in the menu, was ignored, found the file in the plugin directory and am going to try and modify it. Let’s see what happens.

              Lee

              Lycan ThropeL 1 Reply Last reply Reply Quote 0
              • Lycan ThropeL
                Lycan Thrope @Lycan Thrope
                last edited by

                @lycan-thrope
                ::sigh:: I knew it would’nt be easy. Got to find something to read that explains the usage. I uncommented sys.stdout = editor and commented sys.stdout = console and I’m still getting the result, albeit not red, in the console only. It was the same when I hadn’t commented out sys.stdout = console, so obviously there’s more to find out. :-(

                Thanks.

                Lee

                EkopalypseE 1 Reply Last reply Reply Quote 0
                • EkopalypseE
                  Ekopalypse @Lycan Thrope
                  last edited by Ekopalypse

                  @lycan-thrope

                  I would recommend creating a new startup.py instead of using the one that comes with the python script plugin itself.
                  Just go to plugins->python script->new script and save it as startup.py. Make sure the directory points to the …\plugins\CONFIG\pythonscript\scripts directory.

                  Then copy and paste exactly what @Nick-Brown posted.
                  Whitespace is important for python!!!
                  Restart Npp -> done

                  If you want to edit an existing script, hold down the CTRL key while clicking on the script and it will open in the editor instead of running.

                  EDIT: as first line put in
                  from Npp import editor1, editor2

                  Michael VincentM Lycan ThropeL 2 Replies Last reply Reply Quote 3
                  • Michael VincentM
                    Michael Vincent @Ekopalypse
                    last edited by

                    @ekopalypse said in Call Tip Color change:

                    If you want to edit an existing script, hold down the CTRL key while clicking on the script and it will open in the editor instead of running.

                    WHAT - !?!? I’m learning quite a bit from this thread!

                    Cheers.

                    EkopalypseE 1 Reply Last reply Reply Quote 1
                    • EkopalypseE
                      Ekopalypse @Michael Vincent
                      last edited by

                      :-D - I have to admit it took me a while to find this in another thread too.
                      Seems to be a hidden gem :-)

                      Lycan ThropeL 1 Reply Last reply Reply Quote 2
                      • Lycan ThropeL
                        Lycan Thrope @Ekopalypse
                        last edited by

                        @ekopalypse ,

                        Thanks for helping. Unfortunately, the only result that happened earlier with the old startup, is that when I tried the calltip, it wouldn’t show. I rebooted NPP, read your last messsage, did that, and now I have two scripts in the menu.
                        PytonScriptResults.PNG

                        Wish I’d seen your last tip sooner about how to edit it. :-). I had to go into the directory and get it prior to the post. I tried in Config to remove the extra from the menu, to no effect. It won’t let me remove it. Soo…I soldier on, will try a few more of your things and see what happens. :-(

                        Lee

                        EkopalypseE 1 Reply Last reply Reply Quote 0
                        • EkopalypseE
                          Ekopalypse @Lycan Thrope
                          last edited by Ekopalypse

                          @lycan-thrope

                          You can call it startup.py because it automatically adds a [user] tag, but another name is just as good, but then you always have to start it manually. Only startup.py files are executed as soon as npp reports readiness to the plugin.
                          Have you checked in the console whether an error is displayed?

                          Lycan ThropeL 1 Reply Last reply Reply Quote 0
                          • Lycan ThropeL
                            Lycan Thrope @Ekopalypse
                            last edited by

                            @ekopalypse said in Call Tip Color change:

                            Have you checked in the console whether an error is displayed?

                            Yes I have, and unless it’s invisible, no error. :-)

                            Here’s what I have, so we’re on the same page. I put the import in, you suggested, I have the section Nick Brown suggested and this is what I have in screenshot so you can see the file as is:
                            PSScriptPerEko.PNG

                            I can get a screenshot of the console, if need be, but here is the result in my files using the Calltip with the settings that Nick has supplied, which I presume to be black text on a mild yellow background, per the r,g,b numbers:
                            PSNoChange.PNG

                            As you can see, the default light gray on bright white.

                            I have to figure I’ve done something wrong, but what, I have no idea and am all ears. :-)

                            Lee

                            EkopalypseE PeterJonesP 3 Replies Last reply Reply Quote 0
                            • EkopalypseE
                              Ekopalypse @Lycan Thrope
                              last edited by

                              @lycan-thrope

                              and after you saved it you restarted Npp?

                              Lycan ThropeL 1 Reply Last reply Reply Quote 0
                              • EkopalypseE
                                Ekopalypse @Lycan Thrope
                                last edited by

                                @lycan-thrope

                                is that now a new startup.py located in the plugins\config\pythonscript\scripts directory or the original from plugins\pythonscript\scripts directory?

                                1 Reply Last reply Reply Quote 0
                                • Lycan ThropeL
                                  Lycan Thrope @Ekopalypse
                                  last edited by

                                  @ekopalypse said in Call Tip Color change:

                                  and after you saved it you restarted Npp?

                                  Yes sir. After doing something like this, I usually reboot and restart in Admin mode in case I need to make changes and save the files. I just did it again, to be sure, and tried using the call tip again. I do have install on startup, so there should be no issue with it being loaded, as far as I can tell. Here’s a shot:
                                  PSConsole.PNG

                                  Lee

                                  EkopalypseE 1 Reply Last reply Reply Quote 0
                                  • EkopalypseE
                                    Ekopalypse @Lycan Thrope
                                    last edited by Ekopalypse

                                    @lycan-thrope

                                    Is LAZY or ATSTARTUP set in the config?

                                    3ad8c16b-cce9-4adf-b8a6-26bf15aac1ff-image.png

                                    Lycan ThropeL 1 Reply Last reply Reply Quote 0
                                    • Lycan ThropeL
                                      Lycan Thrope @Ekopalypse
                                      last edited by

                                      @ekopalypse said in Call Tip Color change:

                                      Is LAZY or ATSTARTUP set in the config?

                                      ATSTARTUP. Else the console wouldn’t be shown, right? Now if it’s not loading the startup.py, that could be a problem, but not sure how to tell. The console is coming up and my assumption is that the startup.py is also starting up. Would that be an accurate assumption?

                                      Lee

                                      EkopalypseE 1 Reply Last reply Reply Quote 0
                                      • EkopalypseE
                                        Ekopalypse @Lycan Thrope
                                        last edited by

                                        @lycan-thrope

                                        No, the console will(should) open always. Gimme a sec to test something.

                                        Lycan ThropeL 1 Reply Last reply Reply Quote 0
                                        • Lycan ThropeL
                                          Lycan Thrope @Ekopalypse
                                          last edited by

                                          @ekopalypse ,
                                          Ok. Here’s a screenshot of my config Machine view:

                                          PytonScriptConfigView.PNG

                                          I can do what ever you suggest, if I am setup right. That is the question we’re looking at. :-)

                                          Lee

                                          EkopalypseE 2 Replies Last reply Reply Quote 0
                                          • EkopalypseE
                                            Ekopalypse @Lycan Thrope
                                            last edited by

                                            @lycan-thrope

                                            and in User Scripts there is nothing?

                                            My fresh setup test

                                            97733d5a-f4b6-456d-b555-8a7619f5e732-image.png

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors