benknoble / frosthaven-manager

GUI Frosthaven Scenario Manager
https://benknoble.github.io/frosthaven-manager
Other
5 stars 0 forks source link

Thread a renderer through the application #9

Closed benknoble closed 1 year ago

benknoble commented 1 year ago

The easiest way to do this (in terms of required modifications to the code) is as follows:

  1. Create a current-renderer parameter in a new module. The value of the parameter will actually be a procedure that returns the renderer, so usage will be ((current-renderer)) (see https://github.com/Bogdanp/racket-gui-easy/issues/23).
  2. Import this module in manager.rkt and establish the current-renderer dynamically.
  3. Import this module in modules that call procedures that can take a renderer (like render, esp. with a dialog), and use it.

Nothing is actually broken, currently, but this will help indicate window hierarchy to the window manager better. It may also help if we ever figure out how to get the mouse-position so that we can use popup-menus.

benknoble commented 1 year ago

The current-renderer exists and should be set by render/eventspace (possibly with with-closing-custodian/eventspace).