-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using improved L&F #16
Comments
Here's what it looks like on a Mac, indeed it does not need XQuartz: There are a few more issues apparent when running it on a Mac.
I'm not in any hurry to get these fixed, just trying this as a fun experiment. For now I've pushed any progress to a separate branch. |
Hello Christopher, That's quite an accomplishment to get the HSW12 GUI running without an X server. Have you also tried to connect a D-Bug12 pod and use the terminal? The terminal relies on a "fileevent" callback. It would be interesting to see if that mechanism still works after replacing the Tk framework. I think we should merge your code into the master branch. I like your approach of of probing the existence of Tcl/pTk first. Additionally we could add a command line argument to the "hsw12.pl" script to explicitly select the Tk framework. Thanks for all the work, that you've put in the IDE. Dirk |
Hi Dirk, thanks for replying. I had not tried connecting my Dragon12 board, indeed the terminal doesn't yet work with Tcl::pTk but still does with Tk. It fails as soon as I select the port with this error:
I'm wondering if that's due to my installation though. I'll keep digging. I was able to 'modernize' the menubar after some finding & replacing, so it should be able to use the system menubar. I then had to figure out what was causing a strange error but only with TkHijack. It turned out that it didn't like the
|
Sorry if this discussion is becoming a bit unwieldy for a single issue, I might be inclined to split this into separate issues. This effort is probably going to take a quite bit more debugging and polishing, but I haven't given up. I'm finding quite a few of the issues also apply to the modified widget demo program for Tcl::pTk, so I might use that as a starting point for correspondence with pTk. I think it would then be interesting to use HSW12 as a test case to help further improve pTk at the same time. I'll still try to incorporate any "safe" changes to the main branch and try adding a command-line option as you suggested.
|
I've begun opening issues on the CPAN issue tracker for Tcl::pTk, including for some of the issues discussed here. I think some of the issues I might have a chance of resolving myself by looking through at Tcl::pTk::Widget or Tcl::pTk::Menu and seeing if there's any simple mistakes with how things are being translated from Perl/Tk syntax to Tcl/Tk. But for other issues, I probably want to get the maintainer's input on how to address, like for whether right-click should automatically adjust to using button 2 on macOS-aqua. For now I have the MainWindow hidden (using |
I have been making progress on finding Tcl::pTk issues, as well as fixing some of the easier ones. But I think until the terminal is working and the Menubutton text color issue is addressed, I'm inclined not to have HSW12 try using Tcl::pTk automatically yet. I think once I get some changes documented they can be merged into the master branch. Some of the issues in Tcl::pTk are "inherited" from either Perl/Tk or Tcl::Tk code that it borrows verbatim, for example binding to the correct mouse button for right- or middle-click events, or handling mousewheel scrolling correctly. So the fixes I've found for these in Tcl::pTk likely apply to Perl/Tk and/or Tcl::Tk: eserte/perl-tk#35. Though some other users of Tcl::pTk have reported issues which are caused by Perl/Tk having improved something but Tcl::pTk never having copied over the improvement. The current maintainer of Tcl::pTk replied to one of the issues, and asked if I was interested in co-maintaining it since he doesn't currently have the resources to do so. I need to check again with him if he's still able to add me. https://rt.cpan.org/Ticket/Display.html?id=125050#txn-1784565 MacPorts let me add a port Tcl::pTk (p5-tcl-ptk) so that it doesn't have to be installed directly from CPAN, and I have included patches in the meantime: macports/macports-ports#2036 I had installed Tcl/Tk through MacPorts, so I thought I had been running Tcl/Tk 8.6.8. But it turned out that I was running Tcl/Tk 8.5.9, which is what is bundled with recent macOS versions. After bringing it up with MacPorts folks, we think the issue might be that their p5-tcl port (the Tcl.pm module) is finding the system Tcl/Tk instead of MacPorts Tcl/Tk. But then a few days ago I managed to get Tcl.pm to run using MacPorts Tcl/Tk, however I'm not sure how I got it working, nor do I know how to get it back to using Tk 8.5. So it may have been a problem on my specific MacPorts installation rather than MacPorts itself. https://trac.macports.org/ticket/56638 I wanted to make sure I could try the latest Tcl/Tk, in case any bugs I found in Tk 8.5.9 had been fixed. I think the only change I've noticed so far is that the CCR bits are now properly rendered as buttons rather than checkboxes, so there isn't an issue with them being crowded: I figured out why I found that instead of using |
I've been added as a co-maintainer for Tcl::pTk, and have posted a new version of Tcl::pTk (0.93) to CPAN containing fixes to some of the issues that I and other users have found. The menubutton issue might be an upstream Tcl/Tk issue since I was able to find the issue from a Tcl/Tk program (gitk): https://rt.cpan.org/Public/Bug/Display.html?id=125049#txn-1795332 I'm not sure if I'll be able to get fileevent or an alternative working on macOS, but I'll keep talking with the maintainer of Tcl.pm for ideas: gisle/tcl.pm#14 |
I haven't used HSW12 much lately, but I did come across how there are ways to have improved look-and-feel for Tk (I believe it is the Tcl/Tk "Tile" feature specifically). I imagine that this would probably be worthwhile supporting e.g. for macOS so that a native look-and-feel is used and maybe even XQuartz is not needed--I'll upload a screenshot once I have my Mac running again if this is the case.
It seems the easiest way might be to try Tcl::pTk. With little effort I was able to use the "hijack" approach (i.e. launch using
perl -MTcl::pTk::TkHijack hsw12.pl
). I can at least get the GUI to appear after addressing a couple of minor issues:Tk::Exists
has to be explicitly used asTk::Exists
rather than justExists
(please correct me if there is some otherExists
besidesTk::Exists
that's being used)There is an error when allowing autofocus;
If I comment out
focusFollowsMouse
it works fine, but I do not know what exactly causes the error. Personally I'm fine without the autofocus.I'll note that it did take a few more steps to use Tcl::pTk than just regular Perl/Tk, since neither Linux distributions, macports, nor ActiveState PPM seem to provide it, although they do tend to provide the prerequisite modules prepackaged (e.g. Tix for Tcl; and Tcl, Class::ISA, and Sub::Name for Perl). I imagine whoever is still successfully using HSW12 is adventurous enough to go through these steps as well.
Also, I'd be inclined to have HSW12 use Tcl::pTk only if it is available and still work without it otherwise. Maybe some variation of the approach used here will suffice.
The text was updated successfully, but these errors were encountered: