本文へスキップ

View

レイアウト、描画、ポインター入力、アクセシビリティに使える汎用の保持型コンテナです。

デモを読み込み中…

#インポート

quickgui から div をインポートします。

use quickgui::*;

#使い方

div()
    .p(20.0)
    .gap(12.0)
    .child(text("Hello from Rust"))
    .child(button().on_click(continue_clicked).child("Continue"))

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

pub fn div() -> Element

Create a container element.

bgpub fn bg(mut self, color: Color) -> Self—

Configures bg for this part.

pub fn bg(mut self, color: Color) -> Self
ソースを見る
pxpub fn px(mut self, value: f32) -> Self—

Configures px for this part.

pub fn px(mut self, value: f32) -> Self
ソースを見る
hoverpub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> Self—

Configures hover for this part.

pub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> Self
ソースを見る
childpub fn child(mut self, child: impl IntoElement) -> Self—

Configures child for this part.

pub fn child(mut self, child: impl IntoElement) -> Self
ソースを見る
on_clickpub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> Self—

Attach a listener registered by [`crate::ViewContext::listener`].

pub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> Self
ソースを見る
idpub fn id(mut self, id: impl Into<ElementId>) -> Self—

Configures id for this part.

pub fn id(mut self, id: impl Into<ElementId>) -> Self
ソースを見る