Community
    • Login

    Show/hide the toolbar

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.5k 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.
    • mkupperM
      mkupper
      last edited by mkupper

      This would be for npp v8.6 though I suspect could apply to many of the recent versions of Notepad++.

      The Autohide tabs bar forum thread reminded me that my toolbar had reappeared which lead to some fruitless hunting…

      It seems there are no menu options to show or hide the toolbar. The only user option for this seems to be buried in Settings / Preferences / General (section) / Toolbar (sub-section)

      The only IDM message codes that mention the toolbar are:

      IDM Code Comment
      IDM_VIEW_TOOLBAR_HIDE 44001 Does nothing - this line is commented out in https://github.com/editorconfig/editorconfig-notepad-plus-plus/blob/master/src/menuCmdID.hpp
      IDM_VIEW_TOOLBAR_REDUCE 44002 Switches the toolbar to small icons
      IDM_VIEW_TOOLBAR_ENLARGE 44003 Switches the toolbar to large icons
      IDM_VIEW_TOOLBAR_STANDARD 44004 Switches the toolbar to standard (small) icons
      IDM_VIEW_TOOLBAR_REDUCE_SET2 44027 Switches the toolbar to small set-2 icons
      IDM_VIEW_TOOLBAR_ENLARGE_SET2 44028 Switches the toolbar to large set-2 icons

      The IDM messages that switch the toolbar icon style or size only work if the toolbar is already visible. They don’t unhide it. All of them only switch the running copy of Notepad++'s toolbar and do not save the setting to config.xml.

      The comments above are base on me trying that IDM code in a simple keyboard macro to see if I could take advantage of them.

      Is there a way for me to toggle the toolbar state? Ideally, the state I toggle to/from does not get saved to config.xml as I suspect I would leave toolbar hidden most of the time. I likely would just toggle it on, do something using the toolbar, and then toggle it off.

      I have PythonScript 2 installed and so if toggling the toolbar state between hidden and standard is possible then some example code would be great.

      Michael VincentM 1 Reply Last reply Reply Quote 1
      • Michael VincentM
        Michael Vincent @mkupper
        last edited by

        @mkupper said in Show/hide the toolbar:

        I have PythonScript 2 installed and so if toggling the toolbar state between hidden and standard is possible then some example code would be great.

        Easy enough:

        notepad.hideToolBar(True)
        

        To unhide, just pass False instead.

        Cheers.

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