Module eagle :: Class RichText
[hide private]
[frames] | no frames]

Class RichText
source code

object --+        
         |        
 _EGObject --+    
             |    
     _EGWidget --+
                 |
                RichText

A Rich Text viewer

Display text with basic formatting instructions. Formatting is done using a HTML subset.

Nested Classes [hide private]
Renderer Specialized TextView to render formatted texts.
Parser HTML subset parser
Formatter HTML subset formatter

Instance Methods [hide private]
  __init__(self, id, text="", label=None, link_color="blue", fgcolor=None, bgcolor=None, callback=None, img_provider=None)
RichText constructor.
  __setup_gui__(self)
  __setup_parser__(self)
  __setup_connections__(self)
  set_text(self, text)
Replace current text
  get_text(self)
Return current text, with formatting tags
  append(self, text)
  set_label(self, label)
  get_label(self)
  __str__(self)
  __repr__(self)

Inherited from _EGWidget: __get_resize_mode__, __get_widgets__, hide, set_active, set_inactive, show

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Class Variables [hide private]
padding  

Inherited from object: __class__


Properties [hide private]
bgcolor  
fgcolor  
link_color  
text  
label  

Inherited from _EGWidget: app

Inherited from _EGObject: id


Method Details [hide private]

__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__

__setup_gui__(self)

source code 

__setup_parser__(self)

source code 

__setup_connections__(self)

source code 

set_text(self, text)

source code 
Replace current text

get_text(self)

source code 
Return current text, with formatting tags

append(self, text)

source code 

set_label(self, label)

source code 

get_label(self)

source code 

__str__(self)
(Informal representation operator)

source code 
Overrides: _EGObject.__str__

__repr__(self)
(Representation operator)

source code 
Overrides: _EGObject.__str__

Class Variable Details [hide private]

padding

Value:
5                                                                     
      

Property Details [hide private]

bgcolor

Get Method:
unreachable.get(self)
Set Method:
unreachable.set(self, value)
Delete Method:
None

fgcolor

Get Method:
unreachable.get(self)
Set Method:
unreachable.set(self, value)
Delete Method:
None

link_color

Get Method:
unreachable.get(self)
Set Method:
unreachable.set(self, value)
Delete Method:
None

text

Get Method:
eagle.RichText.get_text(self) - Return current text, with formatting tags
Set Method:
eagle.RichText.set_text(self, text) - Replace current text
Delete Method:
None

label

Get Method:
eagle.RichText.get_label(self)
Set Method:
eagle.RichText.set_label(self, label)
Delete Method:
None