Menu

#71 Sort menu of sidebar

3.x
closed
None
2019-01-18
2018-12-03
No

Sort menu of sidebar is inactive. Or something missed?

2 Attachments

Discussion

  • Trevor Williams

    Trevor Williams - 2018-12-04

    I'm not sure what the issue is here. Your image of the sort menu looks like it is active. I tried changing the sort options of a directory and didn't have any problems on my end. Could you provide a bit more detail?

     
  • Trevor Williams

    Trevor Williams - 2018-12-04
    • assigned_to: Trevor Williams
     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    Indeed, the feature works OK in Windows (being rather convenient, see attachments), but in Debian GNU/Linux it fails.
    I'm not fooling you. In Debian, the Sort submenu is really inactive, it's seen as to the selection: the Sort item is selected while in its submenu there is no selection at all. The submenu reacts to the clicks with closing itself and there are no results of clicking. See the attached video.

     

    Last edit: Alex Plotnikov 2018-12-05
  • Trevor Williams

    Trevor Williams - 2018-12-05

    Weird. Can you tell me if you see a ".tkesort" file created in the directory which is being sorted? You will need to use the command-line or other file browser to see this as TKE will hide this file from view. Also, are you seeing any error messages in the debug logfile when this happens?

     
  • Trevor Williams

    Trevor Williams - 2018-12-05
    • status: open --> accepted
     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    There are no .tkesort file, no errors in logfile. See attachment.
    I tried to play with sidebar preferences ("hide binary files" is a valuable option btw) and different directories, but got no result.

     
  • Trevor Williams

    Trevor Williams - 2018-12-05

    The .tkesort file would be placed in the "add_shortcuts" directory if it was working properly. The user guide spells out what happens to allow for sorting, but to quickly summarize, a file called ".tkesort" will be placed in the directory if sorting options are changed. This way, whenever TKE is closed/reopened, it will be able to correctly re-apply the previously set ordering options by reading this file. So if you changed the standard order to "Decreasing" or "Manual", it would create the .tkesort file in the effected directory.

    Manualy sorting (for me) is useful in creating documentation. I can drag/drop Markdown files in the order that I want them to appear in a document and then use the "Publish Markdown" plugin to generate the documentation for an entire directory tree of Markdown files. Pretty sweet.

    I haven't been able to reproduce this problem in macOS, Windows or elementary OS yet. I may have to add some debugging information to this code and have you run with it to see if we can figure out what is going wrong in your Debian environment.

     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    okay, send me the code to try it
    ...
    the submenu doesn't allow to activate "Decreasing" or "Manual", so it even doesn't reach the creation of .tkesort

     
  • Trevor Williams

    Trevor Williams - 2018-12-05

    If you are willing to edit TKE source code on your end, add the following line to sidebar.tcl, line 1017:

    puts "sortby: $sortby, sortdir: $sortdir, selection: [$widgets(tl) selection]"

    After making the change, restart TKE, make sure the Tcl console is displayed, and then attempt to change the sorting method to "Manual". Let me know what the Tcl console output is after performing this action.

    Also, what version of Tcl/Tk are you using again?

     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    ...the submenu doesn't allow to activate "Decreasing" or "Manual"
    ...so no output of your code is seen.
    I tried the code by calling "wish tke.tcl" in CLI ==> no output as well.
    That said I don't see why the Sort submenu is not activated (though seen), while all submenus of main menu are working OK.
    Versions:
    Tcl/Tk 8.6.8 in Windows
    Tcl/Tk 8.6.6 in Debian

     
  • Trevor Williams

    Trevor Williams - 2018-12-05

    According to the video that you attached, the menu items were "activateable" (i.e., the state of the menu entries were all "normal" -- no menu items were greyed out). So clicking on a menu entry in that submenu should cause the "sort_updated" procedure to be called.

    Now if the command is not being called, then the next time that you display the menu, it will not have changed states so the checkmarks would stay the same.

     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    Just so on the video. If the submenu disappears it means that I clicked its item - Manually or Decreasing. But no menu command is called at that.

     
  • Trevor Williams

    Trevor Williams - 2018-12-05

    That is Tk not doing what it is supposed to be doing.... ugh! From the Tcl console, do you see any output when you do the following?

    Select the directory in the sidebar to change the sorting by, bring up the sidebar menu and make sure that the sorting submenu is displayed, then in the Tcl console enter the following commands:

    $sidebar::widgets(sortmenu) entrycget "Manually" -command
    $sidebar::widgets(sortmenu) invoke "Manually"

    The first command should display "sidebar::sort_updated". The second command would hopefully display the output that we added to sort_updated (and actually cause the sort to occur).

     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-05

    Now I should inform you, that I was able to call the Sort menu items, by these steps:
    1) activating the popup menu by mouse
    2) going to "Sort" item with Arrow down key
    3) activating "Sort" submenu with Arrow right key
    4) using Arrow down key and Enter key to call the menu command
    Can it be due to Moving Mouse event not processed properly?
    I would try all these tomorrow in more details.

     
  • Trevor Williams

    Trevor Williams - 2018-12-06

    This has been fixed and submitted to the default branch. It will be generally available in the next development and stable releases.

     
  • Trevor Williams

    Trevor Williams - 2018-12-06
    • status: accepted --> pending
     
  • Alex Plotnikov

    Alex Plotnikov - 2018-12-06

    If this has been fixed by you, Trevor, then ... you have all rights to let them Tk developers know how to fix it.
    I tried this issue in the independent code (attached as well as the video of its run) and as a result I supposed it's the Tk 8.6.6 issue. I'd mistaken.
    Big fix!

     
  • Alex Plotnikov

    Alex Plotnikov - 2019-01-08

    Works okay on my machine (Windows, Debian).

     
  • Trevor Williams

    Trevor Williams - 2019-01-18
    • status: pending --> closed
     
  • Trevor Williams

    Trevor Williams - 2019-01-18

    Available in the 3.6 release.

     

Log in to post a comment.