summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMilo Gilad <milogaccnts@gmail.com>2017-08-25 10:38:25 -0400
committerMilo Gilad <milogaccnts@gmail.com>2017-08-25 10:38:25 -0400
commit09d8feda849561b1302cc0d53fee787112ae075b (patch)
tree835b159acc36c6f34ecb150e7c2af31a830ba4c1
parent35aa1410e2becb5d768b9c5142e069b4d0fc46df (diff)
Moved enum into structs and renamed section to structs and enums
-rwxr-xr-xvala.html.markdown15
1 files changed, 8 insertions, 7 deletions
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).