I have my search functions working again. The problem was that when Gtk was updated, and I updated my code to this I also changed how FilePath’s were passed around to the various methods. I did this to only pass around what was necessary, rather than the full paths, and I never reflected this within my search code! Pretty stupid really, but an easy mistake to make. A mistake that also had a domino effect on the methods that search uses!! So when search was fixed, I had to go through the other methods and update those too!
I edited my openFile method so that, it tries to open the supplied file using “xdg-open”. If that is successful, it returns ExitSuccess, and the function exits. However, if it returns any other type of exit, i.e. ExitFailure Int, it searches a file containg extensions & commands. It searches for the extension of the supplied file. If it’s found it asks the user for a command to run the file with, i.e. .hs files are opened in gedit. If the command that the user enters is successful, it then writes the extension command combo to the file for future use.
I finally figured out how to do a right-click menu, which is pretty good, the code is 90% identical to the file menu code. Originally, following the example I found, the action had to be added to the overall window, but I found that that didn’t work. It has to be added to the ScrolledWindow that the user will be making selections from. This has a couple of benefits: Different menu’s for different parts of the screen.
I still have to try to:
- Implement Drag and Drop.
- Expand tree to selected
- Now that I have the right-click menu, try renaming within the scrolled window.
M