
class rightPane {
    variable observer
    variable text
    constructor { frame observerView } {
        global HTML_RightPane
	set observer $observerView
	set scwindow [ScrolledWindow $frame.scwindow]
	set text [text [$scwindow getframe].text -bg white -height 30]
	pack $text -fill both -expand true
	$scwindow setwidget $text
	pack $scwindow -fill both -expand true  
	HMinit_win $text
	set HTML_RightPane($text) $this
	$text configure -state disabled
    }
    method loadHTML
    method processHref
}

body rightPane::processHref { href } {
    $observer processURL $href
}

body rightPane::loadHTML { html } {
    $text configure -state normal
    HMreset_win $text
    HMparse_html $html "HMrender $text"
    $text configure -state disabled
}

proc HMlink_callback {win href} {
    global HTML_RightPane
    $HTML_RightPane($win) processHref $href
}

proc HMset_image {win handle src} {
    HMgot_image $handle $src
}

proc HMtag_button {win param text} {
        global HTML_RightPane
        upvar #0 HM$win var
	array set options {image wheelSmall command ""}
	HMextract_param $param image options(image)	
	HMextract_param $param command options(command)
	set b [Button $win.[unique::newId] -image $options(image) \
	-command [list $HTML_RightPane($win) processHref $options(command)]]
        HMwin_install $win $b
}
