Vgtk is participating 2021 OSC China Open Source Project Selection , please vote for it!
Vgtk in 2021 OSC China Open Source Project Selection {{projectVoteCount} has been obtained in, please vote for it!
2021 OSC China Open Source Project Selection It is in hot progress. Come and vote for your favorite open source project!
2021 OSC China Open Source Project Selection>>> Midfield Review
Vgtk won the 2021 OSC China Open Source Project Selection "The Best Popularity Project" !
Authorization Agreement GPL
development language Rust View source code »
operating system Cross platform
Software type Open source software
Open source organizations nothing
region Unknown
deliverer game
intended for unknown
Recording time 2022-05-30

Software Introduction

Vgtk is a declarative desktop UI framework written by Rust, with built-in GTK and Gtk rs.

Example

 use vgtk::{ext::*,  gtk, run, Component, UpdateAction, VNode}; use vgtk::lib::{gtk::*,  gio::ApplicationFlags}; #[derive(Clone, Default, Debug)] struct Model { counter: usize, } #[derive(Clone, Debug)] enum Message { Inc, Exit, } impl Component for Model { type Message = Message; type Properties = (); fn update(&mut self, message: Message) -> UpdateAction<Self> { match message { Message::Inc => { self.counter += 1; UpdateAction::Render } Message::Exit => { vgtk::quit(); UpdateAction::None } } } fn view(&self) -> VNode<Model> { gtk!  { <Application::new_unwrap(None, ApplicationFlags::empty())> <Window border_width=20 on destroy=|_| Message::Exit> <HeaderBar title="inc!" show_close_button=true /> <Box spacing=10 halign=Align::Center> <Label label=self.counter.to_string() /> <Button label="inc!" image="add" always_show_image=true on clicked=|_| Message::Inc /> </Box> </Window> </Application> } } } fn main() { std::process::exit(run::<Model>()); }

characteristic

  • suffer Elm Architecture Redux And Yew Inspiration, using a simple and practical component model
  • A Declarative DSL for combining React And JSX Inspired GTK widget, effectively updated with virtual "DOM" differences
  • Fully cross platform, with a native look for Linux, Windows, and macOS
  • No need to rely on embedded browser engine
  • Based on Rust's Future structure , using GLib's event loop, provides a clean integration with the GTK event model async/await
Expand to read the full text

code

comment

Click to join the discussion 🔥 (3) Post and join the discussion 🔥
No content temporarily
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
No more
No content temporarily
Issued a question and answer
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
No more
No content temporarily
No content temporarily
three comment
eighteen Collection
 OSCHINA
Log in to view more high-quality content
 Back to top
Top