Struct sciter::window::Window [] [src]

pub struct Window { /* fields omitted */ }

Sciter window.

Methods

impl Window
[src]

[src]

Create a new main window.

[src]

Create a new window with the specified position as rect(x, y, width, height), flags and an optional parent window.

[src]

Attach Sciter to an existing native window.

[src]

Obtain reference to Host which allows you to control sciter engine and windows.

[src]

Set callback for sciter engine events.

[src]

Attach dom::EventHandler to the Sciter window.

You can install Window EventHandler only once - it will survive all document reloads.

[src]

Register a native event handler for the specified behavior name.

Behavior is a named event handler which is created for a particular DOM element. In Sciter’s sense, it is a function that is called for different UI events on the DOM element. Essentially it is an analog of the WindowProc in Windows.

In HTML, there is a behavior CSS property that defines name of a native module that is responsible for initialization and event handling on the element. For example, by defining div {behavior:button} you are asking all <div> elements in your markup to behave as buttons: generate BUTTON_CLICK DOM events when clicks on that element and be focusable.

When the engine discovers element having behavior: xyz; defined in its style, it sends the SC_ATTACH_BEHAVIOR host notification with the name "xyz" and element handle to the application. You can consume the notification and respond to it yourself, or the default handler walks through the list of registered behavior factories and creates the instance of the corresponding dom::EventHandler.

Example:

struct Button;

impl sciter::EventHandler for Button {}

let mut frame = sciter::Window::new();
frame.register_behavior("custom-button", || { Box::new(Button) });

And in HTML it can be used as:

<button style="behavior: custom-button">Rusty button</button>

[src]

Load HTML document from file.

[src]

Load HTML document from memory.

[src]

Get native window handle.

[src]

Minimize or hide window.

[src]

Show or maximize window.

[src]

Close window.

[src]

Set title of native window.

[src]

Get native window title.

[src]

Set various sciter engine options, see the Options.

[src]

Show window and run the main app message loop until window been closed.

[src]

Run the main app message loop with already configured window.

[src]

Post app quit message.

Trait Implementations

Auto Trait Implementations

impl !Send for Window

impl !Sync for Window