11.2 HTML Widget object

Widget objects whose widget class is subclassed from html have the following additional methods:

AnchorToId( name)
Returns id. This function corresponds with HTMLAnchorToId. Convenience function to return the element id of the anchor based on the anchor name passed. Function returns id on success. If there is no such element, 0 is returned.

AnchorToPosition( name)
Returns (x,y). This function corresponds with HTMLAnchorToPosition. Convenience function to return the position of the anchor based on the anchor name passed. If there is no such element, a ValueError is raised.

ClearSelection( )
This function corresponds with HTMLClearSelection. Clear the current selection (if there is one).

DrawBackgroundImage( x, y, width, height)
This function corresponds with HTMLDrawBackgroundImage.

FreeImageInfo( )
Returns href_list. This function corresponds with HTMLFreeImageInfo.

GetActions( )
Returns href_list. This function corresponds with HTMLGetActions. Convenience function to return the ACTIONs of all active forms in the document. Function returns an array of strings.

GetHRefs( )
Returns href_list. This function corresponds with HTMLGetHRefs. Convenience function to return the HREFs of all active anchors in the document. Function returns an array of strings.

GetImageSrcs( )
Returns src_list. This function corresponds with HTMLGetImageSrcs. Convenience function to return the SRCs of all images in the document. Function returns a list of strings.

GetLinks( )
Returns link_list. This function corresponds with HTMLGetLinks.

GetSubmitInfo( )
Returns list of list of name,value tuples. Convenience function to return a list of (name,value) pairs for all form elements in all active forms. Function returns a list containing, for each form in the document, a list of tuples.

GetText( pretty[, url[, time_str]])
Returns text. This function corresponds with HTMLGetText. Convenience function to return the text of the HTML document as a plain ascii text string. Extra option flags pretty text to be returned. When pretty is two or larger, Postscript is returned. The font used is encoded in the pretty parameter: pretty = 2: Times; pretty = 3: Helvetica; pretty = 4: New century schoolbook; pretty = 5: Lucida Bright.

GetTextAndSelection( )
Returns (text, start, end, insert). This function corresponds with HTMLGetTextAndSelection. Convenience function to return the text of the HTML document as a single white space separated string, with pointers to the various start and end points of selections.

GotoId( id)
This function corresponds with HTMLGotoId. Convenience function to position the element based on the element id passed at the top of the viewing area. A passed in id of 0 means goto the top.

IdToPosition( id)
Returns (x,y). This function corresponds with HTMLIdToPosition. Convenience function to return the position of the element based on the element id passed in. If there is no such element, a ValueError is raised.

PositionToId( x, y)
Returns id. This function corresponds with HTMLPositionToId. Convenience function to return the element id of the element nearest to the x,y coordinates passed in. If there is no element there, return the first element in the line we are on. If we are on no line, either return the beginning, or the end of the document.

SearchText( pattern[, start[, backward[, caseless]]])
Returns ((start_id, start_pos), (end_id, end_pos)). This function corresponds with HTMLSearchText. Convenience function to search the text of the HTML document as a single white space separated string. Linefeeds are converted into spaces. Takes a pattern, and, optionally, the location to start the search from for incremental searching. Default start is the beginning of the document for forward searching, and the end of the document for backwards searching. The backward and caseless parameters I hope are self-explanatory. Returns the start and end positions on success, and raises a ValueError otherwise.

SetAppInsensitive( )
This function corresponds with HTMLSetAppInsensitive.

SetAppSensitive( )
This function corresponds with HTMLSetAppSensitive.

SetFocusPolicy( policy)
This function corresponds with HTMLSetFocusPolicy. This allows the client to set the focus policy for all the widgets created as children of the html widget.

SetSelection( (start_id, start_pos), (end_id, end_pos))
This function corresponds with HTMLSetSelection. Set the current selection based on the ElementRefs passed in.

SetText( text, header_text, footer_text[, id[, target_anchor]])
This function corresponds with HTMLSetText. Convenience function to set the raw text into the widget. Forces a reparse and a reformat. If any argument is passed in as None that text is unchanged, if an argument is an empty string, that text is set to NULL. Optionally also pass an element ID to set the view area to that section of the new text. Finally pass an anchor NAME to set position of the new text to that anchor.

TraverseTabGroups( direction)
This function corresponds with HTMLTraverseTabGroups. This function is intended to imitate XmProcessTraversal.