I updated helpbrowser to use arrow keys for navigation, and updated the version to 0.2?
-took out searching the user libraries (only kept static path) because things were being added twice if people want to load a library on startup and it was in the staticpaths.
-added navigation by arrow keys
-changed method of destroying listboxes because of arrow navigation.
Each listbox is now named in the pattern: helpbrowser.frame.root(listbox#). Whenever focus changes to a listbox, or a listbox is created (to avoid name clashes), the list of children is searched in the check_destroy proc using this name pattern and deletes all listboxes 2 or more after the focused one. This was the best method I could come up with. When focus changes, the scroll_destroy proc scrolls the focused listbox to the left (because it was scrolling right for some reason even though the right arrow key is bound) and then calls check_destroy.
I also added new procs for each "type" of listbox for dealing with arrow key navigation
Anonymous
I couldn't figure out how to delete my previous attachment, but here is a version that deals with the winlevel better in check_destroy
EDIT: I also just added a return key binding and dealt with destroying better by keeping track of the # of listboxes, and renamed check_destroy to scroll_destroy. Now I just iterate over the difference between the previous height and the new one, and delete those windows.
EDIT2: fixed bug where navigating backward didn't update height variable
Last edit: Sebastian Shader 2016-10-18
when replacing the calls using [list] curly braces weren't put around some dirs. here's another patch to patch off 0.48.0test5
Last edit: Sebastian Shader 2017-07-24
a call to dir_return binding was also replaced with dir_right. Here is a patch to fix both
Last edit: Sebastian Shader 2017-07-24
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
It looks like I can't undo the changes in the earlier helpbrowser2.patch - can you make a
patch that applies to 0.48-0test5 (the latest)?
? well here is the whole correct file
ok, adopted. I was confused by the two earlier patches and didn't realize I could just ignore them :)
Note that I've been updating the helpbrowser as well, let's make sure we're not cross defeating ourselves. I'll make a PR on GitHub for what I'm doing so you can check it out.
Here's the PR: https://github.com/pure-data/pure-data/pull/143
But why not just filter out duplicates? I found the addition of user paths to be pretty useful, especially when one of those is the deken install directory.
Also, now I'm seeing all the reference help patches in the main column while they already live in Pure Data/5.reference...
well it was easier, and I have not been using deken at all personally. any libraries I had installed were in static path so it didn't seem like anyone would need help for libraries they didn't have installed
For me anything in the main column is from extra and none of those are in Pure Data/5.reference
Ok, I've put in the changes. Can you check them? Building on top of your update was much easier than starting from where things were before!
https://github.com/pure-data/pure-data/pull/143
and a demo video
https://www.youtube.com/watch?v=2hL1brds1XA&feature=youtu.be
Last edit: danomatika 2017-07-26
looks good! glad you got rid of the annoying horizontal scrolling too
edit: I actually get a duplicate library error with my own library (which I load @ startup) looking into it...
Last edit: Sebastian Shader 2017-07-26
ok, the issue is that when you save a search path in the preferences in pd 0.47 it will put the directory into ::sys_searchpath with a trailing "/" on osx, so filtering it with [lsort -unique] fails to match it to the directory from the staticpath.. this could potentially be solved with
lappend searchpaths [string trimright [file join [file normalize $pathdir] { }] '/']
on line 442, though I'm not sure if this would mess up deleting trailing white space from the file name (or rather what trimright is doing here), or a good way to do this for windows also
Last edit: Sebastian Shader 2017-07-26
Maybe a regex match is better? Or at least use [file separator] instead of a Unix "/"
Thanks, I think we have it now. The [file separator] is now trimmed before doing the join to append a new one. This way we make sure there is only one.
another small thing: when compiling pd using the included wish (which is the default) the help browser doesn't get the focus from mouse clicks correctly (and hence can't use keys to navigate at first unless you press tab). It's obviously ok with tcl/tk 8.5, might not be worth worrying about
Last edit: Sebastian Shader 2017-08-01
Requiring tab is on purpose as the listbox is not foucsed on start. I had feedback from people who didn't like/understand why there was a highlight when the window was first opened and they hadn't done anything yet. Looking at the macOS Finder behavior, you also need to press Tab to set the focus. Clicking, of course, does it as well.
I could add Up/Down arrow binds to the Window itself to then set focus on the listbox. Find works this way as well.
Another thing to note: on Windows 10, the single column is too small for the min/max/close buttons so there is no easy space to grab and move the window. Maybe the browser should open showing two columns?
Fixed in https://github.com/pure-data/pure-data/pull/154/commits/5fbac200059e2a7448090cba572a74be38fba1be
Navigating in sub-directories doesn't work with this now (because the focus just goes back to the root listbox).
Also somehow the file seperator fix is not in this version of the file.. not sure if that's an issue..
I think leaving it like it was could be ok though... or maybe explicitly setting focus using the various "click" functions if on tcl/tk 8.4
Last edit: Sebastian Shader 2017-08-02
I fixed the focus issue in the next commit actually. The file separator is working AFAICT, I just went about it in a different manner and tested on windows & macOS.
Oh yes seems to be working. However, the file seperator fix is still gone seems like it was this commit https://github.com/pure-data/pure-data/pull/154/commits/4ceebf8ba41acdc2359435ffdfa2ea16f0de51cb
Last edit: Sebastian Shader 2017-08-02
The original fix broke things on Windows. The latest update uses the line of tcl from the static paths loop. I just tested it in tclsh and it correctly strips teh trailing slash.
Ok I am still getting the duplicate library error but now maybe I'm thinking it wasn't the file seperator at all? looking into it again..
The issue is when searchpaths and staticpaths have the same path, we get the duplicate library error (not when searchpaths has the same path twice)
Last edit: Sebastian Shader 2017-08-04
I think I finally got it. Here's what I did
I did use tclsh to try the command, and though it seemed to trim initially, it adds a trailing separator with variables:
set pathdir /Users/sebshader/Library/Pd/shadylib
set dir [string trimright [file join [file normalize $pathdir] { }]]
returns with trailing separator
edit: would pull requests be way easier?
Last edit: Sebastian Shader 2017-08-04