Overview of Item Types

HTML Items

Items of type html are compound items representing the specified html file. (HTML is HyperText Markup Language. Based on SGML, HTML is most commonly known as the language describing items for the World-Wide Web.) HTML items know about the internet and will automatically fetch a file from a URL (Universal Resource Locator) as well as in-line images. URL's may also specify local files. When the html data is fetched, it is parsed and the HTML item is created which contains a method for rendering the page. HTML anchors are created as separate items which may have events bound to them. HTML items are an extension of group items, and thus have several of the same options as groups.

There is a Tcl file (draw/html.tcl) which describes default event bindings for html items which follow hyperlinks, and lay them out with scale. See the end of the description of HTML items for a description of html anchors.

HTML items are created with widget commands of the following form:

pathName create html [option value option value ...]

There may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. The following options are supported for html items:

[31] -border color

(available only for HTML and portal item types)

Color specifies a color to use for drawing the border of the portal; it may have any of the forms accepted by Tk_GetColor. If color is "none", the outline will not be drawn. This option defaults to the fill color.


[32] -borderwidth width

(available only for HTML and Portal item types)

Width specifies the width of the border in current units to be drawn around the item. Wide borders will be drawn completely inside the path specified by the points of this object. Note that this is different than pens. If width is 0, then the border will always be drawn one pixel wide, independent of the zoom. Width defaults to 1 pixel.

[33] -divisible boolean

(available only for grid, group, and HTML item types)


If true, then events go through the HTML object to its anchors. If false, events stop at the HTML object, and never go through to the anchors. Defaults to true.


[34] -donescript script

(available only for HTML item types)

If script is specified, it gets evaluated when the html item has completed loading - including all in-line images. script is postpended with the id of the html object. This is necessary because the script is typically specified on the create line where the id of the html object is not yet known.


[35] -errorscript script

(available only for HTML item types)


If script is specified, it gets evaluated if there is an error creating the html item. An error can occur for many reasons - especially because creating an html typically starts a network communication process for fetching the URL. script is postpended with the id of the html object. This is necessary because the script is typically specified on the create line where the id of the html object is not yet known.


[36] -fill color

(available only for handle,HTML, polygon, portal and rectangle item types)


Fill the background of the html item with color, which may be specified in any of the forms accepted by Tk_GetColor. If color is "none", the background will not be drawn. It defaults to the background of the Pad++ widget it is created on.

[37] -font fontname

(available only for HTML, portal, text and textfile item types)


Specifies the font to be used for rendering text for this item. fontname must specify a filename which contains an Adobe Type 1 font, or the string "System" which causes the Pad++ line-font to be used. Defaults to "System".


[38] -htmlanchors

(available only for HTML item types)


Returns all the anchors that are part of this HTML item. This is a read-only option, and may not be set.


[39] -members

(available only for group and HTML item types)


Because an HTML item is a group, it may contain other members in addition to its anchors. This allows setting and retrieving of all members that are part of this HTML item.


[40] -updatescript script

(available only for HTML item types)


If script is specified, it gets evaluated when the html source has loaded, and then once every time an in-line is loaded. script is postpended with the id of the html object. This is necessary because the script is typically specified on the create line where the id of the html object is not yet known.


[41] -url urlname

(available only for HTML item types)


Specifies the URL (Universal Resource Locator, or World-Wide Web address) that this html page should be accessed from. It must be specified with a valid address. Some examples are: "http://www.unm.edu", "http://www.cs.unm.edu/bederson", "file://nfs/u3/bederson/public_html/begin.html", "home-page.html".


[42] -width width

(available only for all item types)


Specifies the width (in the current units) of the html page. The page will be re-laid out according to the new width, and the length of the page may change dependent on the new width.


HTML ANCHORS

The anchors are special Pad++ items of type "htmlanchor". They are automatically grouped with the HTML object. As such, they can not be deleted independently, and are automatically deleted when the html object they are associated with is deleted. Some anchors have multiple components (i.e., and image and some text). In this case, they all have the same URL, and changing the pen color of one component automatically changes the pen color of the other components.

Anchors may be configured with the itemconfigure command. The following options are supported for html anchors:

[43] -html

(available only HTML anchors item types)

Returns the html item this anchor belongs to. This is a read-only option.


[44] -ismap

(available only HTML anchors item types)


Returns true if this anchor is an imagemap. This is a read-only option.


[45] -state state

(available only HTML anchors item types)


Specifies the state of the anchor (which controls its color). There is no direct control over an anchor's color. Rather, it uses the default colors unless the HTML page specifies anchor colors. State may be one of "unvisited", "active", "visited", or "notloaded". In-line images that haven't been loaded yet are

"notloaded".

[46] -url

(available only HTML anchors item types)


Returns the URL that this anchor addresses. This is a read-only option.

HTML ANCHORS

July 9, 1996 - 9 JUL 1996

Generated with Harlequin WebMaker

Web Accessibility