> > On 8/18/2020 12:31 PM, James Platt wrote: >> I'm looking at implementing a zoom contents (not zoom window) feature in a >> GUI with lots of elements and I'm wondering about the best way to do this. >> Most, if not all, standard GUI widgets in Racket can be resized by changing >> the font size of their contents or label. Then redraw the widget and you >> have the whole thing in a new size. So zoom could be done by creating a >> function which handles each element individually but I would like a more >> general solution, if possible. Most widgets use the value >> normal-control-font for their default but it doesn't look like this can be >> changed at present. If there were a setter for normal-control-font, it >> looks like you could have a menu item change it, then recursively get the >> children of the frame it is attached to and redraw them. Would this >> actually work? Is there a better way to do it? > > If you can access (or render) the contents as a 'pict', then it be scaled > somewhat arbitrarily (though a scaled version is not guaranteed to look good). > https://docs.racket-lang.org/pict/Pict_Drawing_Adjusters.html > > It is a form of BitBLT operation. I would search the docs for "blt" or > "blit" in addition to "scale" and "size". Sorry I can't point you more > directly to relevant functions: I've done a lot of GUI programming, but, > unfortunately, I know it from C++ using device contexts directly, not from > using Racket's graphics.
If I understand correctly, I would do that like in the Stackoverflow post below. Note the need for using the bitmap% version of the button label. The advantage of this approach is that you can change the label dynamically with a send. The drawback is that I would have to create a modified version of every widget. I was just hoping for a solution which would not require so much customization of a standard Racket package. https://stackoverflow.com/questions/48414363/how-to-change-the-color-of-text-in-a-racket-gui-button/48468797#48468797 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/08CD0FAF-AFCD-4B43-87C4-422C79AA2361%40biomantica.com.

