Struct sciter::window::Window

source ·
pub struct Window { /* private fields */ }
Expand description

Sciter window.

Implementations

Create a new main window.

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

Attach Sciter to an existing native window.

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

Set callback for sciter engine events.

Attach dom::EventHandler to the Sciter window.

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

Register an archive produced by packfolder.

See documentation of the Archive.

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>

Load HTML document from file.

Load HTML document from memory.

Get native window handle.

Minimize or hide window.

Show or maximize window.

Close window.

Set title of native window.

Get native window title.

Set various sciter engine options, see the Options.

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

Run the main app message loop with already configured window.

Post app quit message.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.