Skip to content

MTY_WindowSetWebView

chrisd1100 edited this page Mar 26, 2023 · 2 revisions

Set a WebView overlaying a native window.

This will essentially overlay an entire web browser over the native window. To communicate with the WebView, see MTY_WebViewSendText and MTY_EVENT_WEBVIEW_TEXT. The WebView is based off of Windows' WebView2 system shipped with Windows 11 and Apple's WKWebView framework.

bool MTY_WindowSetWebView(
    MTY_App *    app,
    MTY_Window   window,
    const char * dir,
    bool         debug
);

Parameters

app (MTY_App *)

The MTY_App.

window (MTY_Window)

An MTY_Window.

dir (const char *)

Path to where temporary files related to the WebView will be stored (Windows only). If MTY_WebViewIsSteam returns true, dir will be interpreted as the directory where the Steam API shared object resides (i.e. libsteam_api.so).

debug (bool)

Set to true to enable debugging tools.

Return value

bool

Returns true on success, false if the WebView failed to be set or already exists.

Platform support

Windows   macOS  

See also

Module: App

Clone this wiki locally