Skip to content

Commit

Permalink
Обновлено: Rust приложение на GTK4
Browse files Browse the repository at this point in the history
  • Loading branch information
fiersik committed Jan 25, 2024
1 parent cd43ce0 commit 37d486a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/developers/rust-gtk4-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

## Установка зависимостей

```zsh
```shell
su -
apt-get install libadwaita-devel libgtk4-devel libgdk-pixbuf-devel libpango-devel libcairo-gobject-devel libgio-devel libcairo-devel rust rust-cargo
apt-get install libadwaita-devel libgtk4-devel libgdk-pixbuf-devel libpango-devel libcairo-gobject-devel libgio-devel libcairo-devel
```

## Пример приложения Adwaita

```zsh
### Создаём проект Rust и открываем его:

```shell
cd ~/projects
cargo new hello_adwaita --bin

Expand All @@ -18,6 +20,8 @@ cargo add libadwaita --rename adw --features gtk_v4_10
vscodium .
```

### Вставляем следующий код в файл main.rc:

```rust
use adw::prelude::*;
use adw::{
Expand Down Expand Up @@ -69,6 +73,14 @@ fn build_ui(app: &Application) {
}
```

### Собираем и запускаем приложение:

```shell
cargo run
```

![app](/rust/gtk4-applications/app.png)

### Материалы

[GTK-RS.org](https://gtk-rs.org)
Binary file added docs/public/rust/gtk4-applications/app.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 37d486a

Please sign in to comment.