Skip to content

Commit

Permalink
Исправление недоразумения.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampernic committed Mar 25, 2024
1 parent 173ac1c commit e441e19
Showing 1 changed file with 1 addition and 82 deletions.
83 changes: 1 addition & 82 deletions docs/developers/vala.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,85 +50,4 @@ vala sample.vala
```shell
valac sample.vala -o sample
./sample
```

## Тест

```vala
using Application.Gui;
namespace Application {
public errordomain ShitError {
BIG,
MIDDLE,
FIRE
}
}
[GtkTemplate (ui = "/path/to/resources/app-id/ui/main_window.ui")]
public class Application.Gui.Window : Object {
[GtkChild]
unowned Gtk.Button button;
public string app_id { get; set; }
public signal void done (uint64 what);
public Window (app_id) {
Object (app_id: app_id)
}
construct {
do_thing.begin (32, (obj, res) => {
var result = do_thing.end (res);
message (result);
});
done.connect (do_thing);
done (21);
done.emit (62);
}
public async string do_thing (int64 kek) {
string shit;
int64 shit_int = 0;
for (int64 i = 0; i > kek; i++) {
shit_int += kek;
Idle.add (do_thing.callback);
yield;
}
return shit_int.to_string ();
}
[GtkCallback]
public void on_button_clicked () {
close ();
try {
do_another (false);
} catch (ShitError e) {
message (e.message);
}
}
protected override void size_allocate (
int width,
int height,
int baseline
) {
base.size_allocate (width, height, baseline);
}
void do_another (bool yes) throws ShitError {
if (yes) {
throw new ShitError.FIRE;
}
}
}
```
```

0 comments on commit e441e19

Please sign in to comment.