Instances of Text type have the following attributes:
color
supports the same color representation
models as the graphics module. For the supported color
representation models, see Section 3.3.
u"Latin12"
. Trying to set a font which is not supported by the device has no effect. A list of supported fonts can be retrieved by using appuifw.available_fonts.
Example, setting font:
t = appuifw.Text() t.font = u"albi17b" # sets font to Albi 17 bold t.font = u"LatinPlain12" # sets font to Latin Plain 12
'annotation', 'title', 'legend', 'symbol', 'dense', 'normal'.
Example, setting font:
t.font = "title" # sets font to the one used in titles
Example, checking the currently set font:
unicodeFont = t.font
The attribute value retrieved is always a Unicode string. If the font has
been set with a label, for example, 'title'
, the attribute will
retrieve the font associated with that label.
highlight_color
supports the
same color representation models as the graphics module. For the
supported color representation models, see Section 3.3.
|
. The flags can be divided into two types: text style
and text highlight. Text style flags can be freely combined with each other.
However, one or more text style flags can be combined with only one text
highlight flag. The flags are:
Text style:
Text highlight:
Only one highlight is allowed to be used at once. Therefore, it is possible to combine only one highlight with one or more text styles.
Examples:
t = appuifw.Text() # These and other similar values and combinations are valid: t.style = appuifw.STYLE_BOLD t.style = appuifw.STYLE_UNDERLINE t.style = appuifw.STYLE_ITALIC t.style = appuifw.STYLE_STRIKETHROUGH t.style = (appuifw.STYLE_BOLD| appuifw.STYLE_ITALIC| appuifw.STYLE_UNDERLINE) # These values are valid: t.style = appuifw.HIGHLIGHT_STANDARD t.style = appuifw.HIGHLIGHT_ROUNDED t.style = appuifw.HIGHLIGHT_SHADOW # This combination is NOT valid: # Invalid code, do not try! t.style = (appuifw.HIGHLIGHT_SHADOW|appuifw.HIGHLIGHT_ROUNDED)
Instances of Text type have the following methods:
text) |
event_code, callback) |
bind(event_code, None)
clears an
existing binding. In the current implementation the event is always
passed also to the underlying native UI control.
) |
[pos=0, length=len()]) |
) |
) |
[pos=0, length=len()]) |
length
characters of the text held by the editor control,
starting from the position pos.
text) |
cursor_pos) |
See About this document... for information on suggesting changes.