をロードしようとしましたがminimal.html
、カーゴランで正常にロードされていますが、.exeを単独で実行すると、2つのウィンドウが表示され、1つは空のコンソールウィンドウで、もう1つはこの写真に示すように実際の出力を示します。
使っています Windows 10 x64
私main.rs
は:
extern crate sciter;
fn main() {
let html = include_bytes!("minimal.htm");
let mut frame = sciter::Window::new();
frame.load_html(html, None);
frame.run_app();
}
Cargo.toml
次のとおりです。
[package]
name = "rust_sciter"
version = "0.1.0"
authors = ["Home"]
[dependencies]
sciter-rs = "0.4.24"
minimal.html
次のとおりです。
<html window-icon="https://sciter.com/wp-content/themes/sciter/!images/favicon.ico">
<head>
<title>Minimalistic Sciter demo</title>
<style>
html {
background: radial-gradient(75% 75%, circle farthest-side, white, orange, rgb(0,0,204));
color:#fff;
}
html:rtl {
mapping: left-to-right(background);
}
</style>
<script type="text/tiscript">
view.caption = $(head > title).value;
$(#machine).text = Sciter.machineName();
var counter = 0;
$(button#append).on("click", function(){
$(body).$append(<h1#test>{++counter }</h1>);
});
$(button#open).on("click", function(){
var fn = view.selectFile(#open,
"HTML Files (*.htm,*.html)|*.HTM;*.HTML|All Files (*.*)|*.*" , "html" );
stdout.println("selected file: " + fn);
$(body).$append(<h1#test>{fn}</h1>);
});
</script>
</head>
<body>
<h1>Minimal Sciter Application</h1>
<p>Running on <em #machine /> machine</p>
<button #append>Append</button>
<button #open>Open</button>
<select>
<option>First</option>
<option>Second</option>
<option>Third</option>
</select>
</body>
</html>
アプリの構造、コード、出力は次のとおりです。
ここで答えを見つけました。#![windows_subsystem="windows"]
コードの先頭で使用する必要があるため、コードは次のようになりました。
#![windows_subsystem = "windows"]
extern crate sciter;
fn main() {
let html = include_bytes!("minimal.htm");
let mut frame = sciter::Window::new();
frame.load_html(html, None);
frame.run_app();
}
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加