lunduniversity / introprog-scalalib

Scala library with simple-to-use utilites for students of introductory programming. http://cs.lth.se/pgk/api
BSD 2-Clause "Simplified" License
60 stars 14 forks source link

implement JFrame.setTitle in PixelWindow #8

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am requesting the setTitle method to be implemented and accessible from introprog.PixelWindow. I noticed that JFrame has a method for renaming the frame title, and I am missing this feature in PixelWindow, it could be useful

bjornregnell commented 4 years ago

Implemented by https://github.com/lunduniversity/introprog-scalalib/commit/cf2aee56bf3d10538fbc511d77cba31f378853bc

bjornregnell commented 4 years ago

I reopening this issue as I just noticed that the frame.setTitle in the merged PR is not executed on the Swing thread. @ke8683da Could you fix this by sending a new PR with Swing { frame.setTitle(title) } block similar to def show() and then test this thoroughly using existing labs with game loops running for a while with some load on your CPU such as in Snake, so that we can spot any threading issues make e.g. the Swing thread hang.

ghost commented 4 years ago

PR sent, tested on Linux and Windows, working flawlessly. Demo

bjornregnell commented 4 years ago

merged; thanks!