From 09d8feda849561b1302cc0d53fee787112ae075b Mon Sep 17 00:00:00 2001 From: Milo Gilad Date: Fri, 25 Aug 2017 10:38:25 -0400 Subject: Moved enum into structs and renamed section to structs and enums --- vala.html.markdown | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'vala.html.markdown') diff --git a/vala.html.markdown b/vala.html.markdown index a65c528f..2711f078 100755 --- a/vala.html.markdown +++ b/vala.html.markdown @@ -215,7 +215,7 @@ namespace_int += 5; // Won't compile using NamespaceDemo; namespace_int += 5; // Valid -/* Structs */ +/* Structs and Enums */ struct Closet { public uint shirts; // Default access modifier is private @@ -229,6 +229,13 @@ var struct_init_3 = Closet() { // Type inference also works jackets = 3; } +enum HouseSize { // An example of an enum + SMALL, + MODERATE, + BIG +} + + /* Classes and Object-Oriented Programming */ class Message : GLib.Object { // Class Message extends GLib's Object @@ -271,12 +278,6 @@ public class Calculator : GLib.Object { var calc1 = new Calculator.with_name("Temp"); var calc2 = new Calculator.model("TI-84"); -enum HouseSize { - SMALL, - MODERATE, - BIG -} - ``` * Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw). -- cgit v1.2.3