{"size": 1683, "ext": "scrbl", "max_stars_repo_path": "scribblings/web-view.scrbl", "max_stars_repo_name": "soapdog/racket-web-view", "max_stars_repo_stars_event_min_datetime": "2019-09-17T20:17:45.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-22T12:05:52.000Z", "max_issues_repo_path": "scribblings/web-view.scrbl", "max_issues_repo_name": "soapdog/racket-web-view", "max_issues_repo_issues_event_min_datetime": "2019-09-17T20:17:43.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-22T19:30:26.000Z", "max_forks_repo_path": "scribblings/web-view.scrbl", "max_forks_repo_name": "soapdog/racket-web-view", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 19, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 23.375, "max_line_length": 234, "alphanum_fraction": 0.6262626263}
#lang scribble/manual
@require[@for-label[web-view
                    racket/class
                    racket/base
                    racket/gui]]

@title{A Racket GUI widget to display web pages}
@author{Andre Alves Garzia}

@defmodule[web-view]

This module contains a Web View to be used with Racket GUI Toolkit. At the moment it works only with macOS because it wraps @hyperlink["https://developer.apple.com/documentation/webkit/wkwebview?language=objc"]{WKWebView} from WebKit.

There is a @hyperlink["https://github.com/soapdog/racket-web-view/blob/master/demo/demo.rkt"]{Demo Browser available on the Github Repository}.

@defclass[web-view% object% ()]{

A widget to display web pages.

@defconstructor[([parent (or/c (is-a?/c frame%)
                               (is-a?/c dialog%)
                               (is-a?/c panel%)
                               (is-a?/c pane%))]
                 [on-status-change ((is-a?/c button%) (is-a?/c control-event%) . -> . any) (lambda (b e) (void))])]{

  Construct a new widget. 

  The @racket[on-status-change] procedure is used to receive navigation events from the web view.

}

@defmethod*[([(set-url [url string?]) any/c])]{

Set the URL for the web view.

}

@defmethod*[([(get-url) string?])]{

Get the current URL loaded in the web view.

}


@defmethod*[([(go-forward) any/c])]{

Navigates forward.

}


@defmethod*[([(go-back) any/c])]{

Navigates backward.

}


@defmethod*[([(reload) any/c])]{

Reloads the current page.

}

@defmethod*[([(set-html-text [text string?] [base-url string?]) any/c])]{

Sets the HTML text being used by the web view. Any relative url will be relative to the specified base url.

}

}
