I was studying Chapter 7, particularly section "Getting and setting
body text directly" looking for some documentation hints.
The following mini-scripts don't seem to have any effects on my setup
(linux, python 2.6, pyqt 4.7, current trunk of leo with qt GUI):
w = c.frame.body.bodyCtrl
w.setBackgroundColor('red')
w = c.frame.body.bodyCtrl
w.setBackgroundColor('#FF0000')
w = c.frame.body.bodyCtrl
w.setForegroundColor('red')
w = c.frame.body.bodyCtrl
w.setForegroundColor('#FF0000')
These seem to work in the tk GUI, but not perfectly. There seems to
happen some interference between them and the colorer, because not all
the body text is affected.
How I found this. I was looking for a way of writing a script button
that I could press after selecting a piece of text
(w.getSelectedText() seems to return it correctly) in the current body
and have all occurrences of it displayed with a certain foreground/
background combination (I couldn't find any hints in the docs so I'll
be grateful if somebody teaches me how to do it). I need this
functionality because I think it could help me study unknown python
code (big legacy methods). I plan to emphasize variable names this way
to get a general view on their references inside a function.
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.