Author terry.reedy
Recipients Abhishek.Kumar, Todd.Rovito, alex.rodas, edmond.burnett, giampaolo.rodola, rhettinger, roger.serwy, terry.reedy
Date 2014-09-03.21:42:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1409780574.39.0.320560240028.issue17642@psf.upfronthosting.co.za>
In-reply-to
Content
#21933 added font resizing hotkeys to turtle demo: Control/Command minus, underscore, equal, minus. The OS difference was handled by defining the prefix for the system.
    shortcut = 'Command' if darwin else 'Control'
    widget.bind_all('<%s-minus>' % shortcut, self._decreaseFont)

The patch also added including control-mousewheel. The discussion there revealed that Control-mousewheel up/down generates a <Control-MouseWheel> event with event.delta of +120/-120 on Windows, -1/+1 on Darwin, and <Control-Button-4>/<Control-Button-5> events on X11. 

Control-mousewheel has a tk glitch in that it also generates ordinary mousewheel (scrolling) events. For turtledemo's read-only window of relatively short files, we decided not to worry.  Moving the cursor in edit windows would be a worry.

But Saimadhave and I discovered with line-numbering that this is also a problem with font resizing even without scrolling.  Text widgets send scroll up and down and back to start position commands to the scroll bar on font-resizing. See #17535, my tkfontsize.py test file, and the discussion thereof.

Also, the fontsize needs a minimum since tk (at least on Mac) treats negative sizes as positive sizes, so that decreasing past 0 increases.

This issue is *not* easy.

From the discussion (I have not read the patches yet), I am not sure whether the hotkey is intended to affect just the one window, like Context (and probably line numbering) or all,  I think it should just be the one window.
History
Date User Action Args
2014-09-03 21:42:54terry.reedysetrecipients: + terry.reedy, rhettinger, giampaolo.rodola, roger.serwy, Todd.Rovito, edmond.burnett, alex.rodas, Abhishek.Kumar
2014-09-03 21:42:54terry.reedysetmessageid: <1409780574.39.0.320560240028.issue17642@psf.upfronthosting.co.za>
2014-09-03 21:42:54terry.reedylinkissue17642 messages
2014-09-03 21:42:53terry.reedycreate