[gnome-devel-docs] vala tutorials: some rearranging.
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] vala tutorials: some rearranging.
- Date: Tue, 21 Feb 2012 00:06:14 +0000 (UTC)
commit 704e9e17a32b50ec76d73ca358cb0d09eba1b377
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Tue Feb 21 01:05:32 2012 +0100
vala tutorials: some rearranging.
platform-demos/C/beginner.vala.page | 17 ++++++++-
platform-demos/C/image-viewer/image-viewer.vala | 47 ++++++++++++-----------
platform-demos/C/menus.vala.page | 2 +-
platform-demos/C/signals-callbacks.vala.page | 2 +-
platform-demos/Makefile.am | 1 -
5 files changed, 43 insertions(+), 26 deletions(-)
---
diff --git a/platform-demos/C/beginner.vala.page b/platform-demos/C/beginner.vala.page
index 4f17563..5cbbc01 100644
--- a/platform-demos/C/beginner.vala.page
+++ b/platform-demos/C/beginner.vala.page
@@ -5,7 +5,7 @@
<info>
<link type="guide" xref="index#vala"/>
- <desc>A complete beginner's guide to GTK+ programming</desc>
+ <desc>A beginner's guide to GUI programming using GTK+</desc>
<credit type="author">
<name>Tiffany Antopolski</name>
<email>tiffany antopolski gmail com</email>
@@ -14,7 +14,22 @@
<title>0 Beginner's Tutorials</title>
+<synopsis>
+ <p>If you have never programmed before, or are not familiar with the concepts of object oriented programming, you may need to learn a few basics first. The book <link href="http://learnpythonthehardway.org/book/">Learn Python the Hard Way</link> may be a better place for you to start. Once you master the basics, be sure to come back and check out these tutorials.</p>
+ <p>Although these tutorials are designed for beginners, we can't cover all the basics. Before attempting to follow these tutorials, you are expected to be familiar with the following concepts:</p>
+<list type="numbered">
+ <item><p>Object oriented programming</p></item>
+ <item><p>The Vala programming language:</p>
+ <list>
+ <item><p><link href="https://live.gnome.org/Vala/Tutorial">The Vala Tutorial</link></p></item>
+ <item><p><link href="https://live.gnome.org/Vala/Documentation#Sample_Code">Sample Vala code</link></p></item>
+ </list>
+ </item>
+</list>
+
+<p>By following these tutorials you will learn the basics of GUI programming using Gtk+.</p>
+</synopsis>
<section id="tutorials">
<title>Tutorials</title>
</section>
diff --git a/platform-demos/C/image-viewer/image-viewer.vala b/platform-demos/C/image-viewer/image-viewer.vala
index 1c96126..1cc73b3 100644
--- a/platform-demos/C/image-viewer/image-viewer.vala
+++ b/platform-demos/C/image-viewer/image-viewer.vala
@@ -5,57 +5,60 @@ public class Main : Object
{
private Window window;
private Image image;
-
+
public Main () {
-
+
window = new Window ();
window.set_title ("Image Viewer in Vala");
-
+
// Set up the UI
var box = new Box (Orientation.VERTICAL, 5);
var button = new Button.with_label ("Open image");
image = new Image ();
-
+
box.pack_start (image, true, true, 0);
box.pack_start (button, false, false, 0);
window.add (box);
-
+
// Show open dialog when opening a file
button.clicked.connect (on_open_image);
-
+
window.show_all ();
window.destroy.connect (main_quit);
}
-
+
+ public void dialog_response (Dialog dialog, int response_id) {
+ switch (response_id) {
+ case ResponseType.ACCEPT:
+ var filename = (dialog as FileChooserDialog).get_filename ();
+ image.set_from_file (filename);
+ break;
+ default:
+ break;
+ }
+ dialog.destroy ();
+ }
+
[CCode (instance_pos = -1)]
public void on_open_image (Button self) {
var filter = new FileFilter ();
var dialog = new FileChooserDialog ("Open image",
window,
FileChooserAction.OPEN,
- Stock.OK, ResponseType.ACCEPT,
- Stock.CANCEL, ResponseType.CANCEL);
+ Stock.CANCEL, ResponseType.CANCEL,
+ Stock.OK, ResponseType.ACCEPT);
filter.add_pixbuf_formats ();
dialog.add_filter (filter);
-
- switch (dialog.run ())
- {
- case ResponseType.ACCEPT:
- var filename = dialog.get_filename ();
- image.set_from_file (filename);
- break;
- default:
- break;
- }
- dialog.destroy ();
+ dialog.response.connect (dialog_response);
+ dialog.show ();
}
static int main (string[] args) {
Gtk.init (ref args);
var app = new Main ();
-
+
Gtk.main ();
-
+
return 0;
}
}
diff --git a/platform-demos/C/menus.vala.page b/platform-demos/C/menus.vala.page
index 97bbc59..d65acc9 100644
--- a/platform-demos/C/menus.vala.page
+++ b/platform-demos/C/menus.vala.page
@@ -14,7 +14,7 @@
<desc></desc>
</info>
- <title>iv. Menus</title>
+ <title>iii. Menus</title>
<comment>
<cite date="2012-02-20" href="mailto:tiffany antopolski gmail com">Tiffany Antopolski</cite>
diff --git a/platform-demos/C/signals-callbacks.vala.page b/platform-demos/C/signals-callbacks.vala.page
index e59616f..9dc66e2 100644
--- a/platform-demos/C/signals-callbacks.vala.page
+++ b/platform-demos/C/signals-callbacks.vala.page
@@ -14,7 +14,7 @@
<desc></desc>
</info>
- <title>iii. Signals and Handlers</title>
+ <title>ii. Signals and Handlers</title>
<comment>
<cite date="2012-02-20" href="mailto:tiffany antopolski gmail com">Tiffany Antopolski</cite>
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index 9097950..9033d88 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -48,7 +48,6 @@ DOC_PAGES = \
beginner.js.page \
entry.js.page \
getting-ready.page \
- getting-started.vala.page \
guitar-tuner.c.page \
guitar-tuner.cpp.page \
guitar-tuner.py.page \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]