Author terry.reedy
Recipients terry.reedy
Date 2018-06-04.05:54:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528091671.87.0.592728768989.issue33768@psf.upfronthosting.co.za>
In-reply-to
Content
Item 8. on #33610.  Clicking on a line in the context box jumps the editor to that line, displayed as the first line.  If we do item 11, replace Label with Text, this has to start after #33763 is merged.

We could determine the context line clicked from click event.y by using .dlineinfo('1.0') on the editor window to get the offset and height of textlines for the font used.

Disabled texts still have an 'insert' mark that is moved by clicks.  It is just not visible.  The line clicked on is int(self.context.index('insert').split('.')[0]),
or int(float(index('insert'))),
or next(map(int, t.index('insert').split('.'))),
or s=t.index('insert'); int(s[:s.find('.')])
the same as if the context were 'normal' with a visible cursor.

This only works if the default click handler fires first, so the mark is moved before we look at it.  The default handler is a class binding to Button (press), so we should just be able to bind to ButtonRelease, which is generally a better choice anyway "because if the user accidentally presses the button, they can move the mouse off the widget to avoid setting off the event."
History
Date User Action Args
2018-06-04 05:54:31terry.reedysetrecipients: + terry.reedy
2018-06-04 05:54:31terry.reedysetmessageid: <1528091671.87.0.592728768989.issue33768@psf.upfronthosting.co.za>
2018-06-04 05:54:31terry.reedylinkissue33768 messages
2018-06-04 05:54:31terry.reedycreate