#dialog #bindings #ffi #gui

nvdialog-rs

NvDialog 的高层 Rust 绑定

2 个版本

0.1.0 2023 年 3 月 26 日
0.1.0-rc02023 年 1 月 28 日

#32 in #dialog

MIT 许可证

69KB
184

nvdialog-rs:NvDialog 的 Rust 绑定

此软件包提供对 NvDialog 的 Rust 绑定,并通过 Rust 原则抽象了指针和其他讨厌的东西。此软件包 不会手动构建 NvDialog。您应该在系统运行时提供 NvDialog 的构建版本,或者将其与您的应用程序打包。

注意

我创建的 nvdialog 软件包已被弃用,并由这个软件包取代,这个软件包更简洁、更容易使用。如果您使用的是前者,请立即切换到这个版本。

示例

extern crate nvdialog_rs;
use nvdialog_rs::DialogBox;
use nvdialog_rs::DialogType;

fn main() {
        /* Initialize the library. This corresponds to `nvd_init` */
        nvdialog_rs::init();

        /* Creating the dialog box. */
        let dialog_box = DialogBox::new(
                "Hello from Rust!", /* Title of the dialog */
                /* Message of the dialog */
                "This dialog has been created using Rust and NvDialog bindings to the language.",
                /* See documentation for more */
                DialogType::Simple
        );

        /* Showing the dialog box. */
        dialog_box.show();
}

rustc 支持

以下是支持 rustc(Rust 编译器)的版本表。您也可以使用旧版本,但可能会收到错误消息。

版本 软件包版本 支持
1.35.0> 0.1.0-rc1
1.45.0> 0.1.0-rc1
1.55.0> 0.1.0-rc1
当前 0.1.0-rc1
nightly 0.1.0-rc1

许可证

此库受 MIT 许可证的许可

The MIT License (MIT)
Copyright © 2022 Aggelos Tselios and contributors on NvDialog.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDEDAS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

依赖项