Skip to content

Commit

Permalink
Update code sample to work on both GLib versions from 2.74 and lower …
Browse files Browse the repository at this point in the history
…than 2.74
  • Loading branch information
colinkiama committed Feb 20, 2024
1 parent 55e138f commit a9480fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/code-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ public class ExampleApp : Gtk.Application {
public ExampleApp () {
Object (
application_id: "com.example.App",
#if GLIB_2_74
flags: ApplicationFlags.DEFAULT_FLAGS
#else
flags: ApplicationFlags.FLAGS_NONE
#endif
);
}
Expand All @@ -25,6 +29,6 @@ public class ExampleApp : Gtk.Application {
}
}
// Compile command (requires "glib-2.0" package on version 2.74 or higher and "gtk4" package to be installed):
// valac --target-glib=2.74 --pkg gtk4 ExampleApp.vala
// Compile command (requires gtk4 package to be installed):
// valac --target-glib=auto --pkg gtk4 ExampleApp.vala
```

0 comments on commit a9480fa

Please sign in to comment.