Text provides text editor with almost all of the text formatting functionalities. The control is provided by Text type. Unlike selection or multi-selection lists, text is a type. The functionalities provided by the text type are categorized as either attributes or methods. More precisely, since the text is a type, the functionalities are exposed either as a attribute or a method. The most commonly used attributes of Text include the following:
For example, to use a Text type with LatinPlain12 as the font value with bold text, the statements would be: t = appuifw.Text() t.font = u"LatinPlain12" # sets font to Latin Plain 12 t.style = appuifw.STYLE_BOLD As mentioned above, the Text type provides various methods to perform common operations on the text held by the editor. The most common methods are:
For example, to set a string having the value “This is a text” as the text in the editor, the statement is t.set(u”This is a text”) This brings us to the end of this section. In the next section, the guessing game application that was developed in the previous article (linked to at the beginning of this one) will be enhanced using a single selection list.
blog comments powered by Disqus |