Show/hide the toolbar
-
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.
-
@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.