__init__(self,
id,
text="",
label=None,
link_color="blue",
fgcolor=None,
bgcolor=None,
callback=None,
img_provider=None)
(Constructor)
| source code |
RichText constructor.
@param id: unique identifier.
@param text: text to use in this viewer.
@param label: label to display in the widget frame around the viewer.
If None, no label or frame will be shown.
@param link_color: color to use for links.
@param fgcolor: color to use for foreground (text)
@param bgcolor: color to use for background.
@param callback: function (or list of functions) to call when
user clicks a link. Links to anchor will automatically make
the anchor/mark visible and then callback. Function will get
as parameters:
- App reference
- RichText reference
- href contents (string)
- offset from buffer begin (integer)
@param img_provider: if images could not be resolved, call this
function. It should get an address (string) and return an
eagle.Image. Eagle already provides a handle to addresses
prefixed with "eagle://", the following part should be an
eagle.Image id, and the image should be live (not garbage
collected) when displaying it, so remember to keep a
reference to it! You may use img_provider to download
files from webservers and stuff like that.
Function signature:
def img_provider( filename ):
return eagle.Image( ... )
-
- Overrides:
_EGWidget.__init__
|