BBjHtmlView::setUserAgent

Description

In BBj 15.0 and higher, this method sets the user agent string for this BBjHtmlView control.

Syntax

Return Value

Method

void

setUserAgent(string userAgent)

Parameters

Variable

Description

string

The user agent string to be used for the BBjHtmlView control.

Return Value

None.

Remarks

This method is only meaningful in the optional JAVAFX_HTMLVIEW. For more information about the user agent string, go to useragentstring.com.

Example

rem ' BBjHtmlView::setUserAgent

print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE")

url$ = "http://www.useragentstring.com/"

sysgui = unt

open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

window! = sysgui!.addWindow(50,50,800,650,"htmlview "+url$,$00090003$)

window!.setCallback(window!.ON_CLOSE,"eoj")

getUserAgent! = window!.addButton(1,25,25,100,25,"getUserAgent",$$)

getUserAgent!.setCallback(getUserAgent!.ON_BUTTON_PUSH,"getUserAgent")

text! = window!.addEditBox(100,150,25,625,25,"",$0200$)

setUserAgent! = window!.addButton(2,25,75,100,25,"setUserAgent",$$)

setUserAgent!.setCallback(setUserAgent!.ON_BUTTON_PUSH,"setUserAgent")

edit! = window!.addEditBox(101,150,75,625,25,"",$$)

htmlview! = window!.addHtmlView(102,25,125,750,500,"",$$)

htmlview!.setUrl(url$)

process_events

eoj:

  release

getUserAgent:

  useragent$ = htmlview!.getUserAgent()

  text!.setText(useragent$)

return

setUserAgent:

  htmlview!.setText("")

  htmlview!.setUserAgent(edit!.getText())

  htmlview!.setUrl(url$)

return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.