[gnome-devel-docs] correct x-csharpsrc to x-csharp
- From: Jeremy Bicha <jbicha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] correct x-csharpsrc to x-csharp
- Date: Wed, 15 Aug 2012 22:18:42 +0000 (UTC)
commit 293e7b0473a8e87bc326c3183abdb53a856a385f
Author: Jeremy Bicha <jbicha ubuntu com>
Date: Wed Aug 15 18:11:54 2012 -0400
correct x-csharpsrc to x-csharp
platform-demos/C/guitar-tuner.vala.page | 10 +++++-----
platform-demos/C/image-viewer.vala.page | 12 ++++++------
platform-demos/C/magic-mirror.vala.page | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/platform-demos/C/guitar-tuner.vala.page b/platform-demos/C/guitar-tuner.vala.page
index 2bf5051..fbd03a7 100644
--- a/platform-demos/C/guitar-tuner.vala.page
+++ b/platform-demos/C/guitar-tuner.vala.page
@@ -57,7 +57,7 @@
</item>
<item>
<p>Click <gui>Apply</gui> and the project will be created for you. From the <gui>Project</gui> or <gui>Files</gui> tab, open <file>src/guitar_tuner.vala</file> by double-clicking on it. You should see some code which starts with the lines:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
using GLib;
using Gtk;]]></code>
</item>
@@ -136,9 +136,9 @@ using Gtk;]]></code>
<p>In this example we will use a tone generator source called <code>audiotestsrc</code> and send the output to the default system sound device, <code>autoaudiosink</code>. We only need to configure the frequency of the tone generator; this is accessible through the <code>freq</code> property of <code>audiotestsrc</code>.</p>
<p>We need to add a line to initialize GStreamer; put the following code on the line above the <code>Gtk.init</code> call in the <code>main</code> function:</p>
- <code mime="text/x-csharpsrc"><![CDATA[Gst.init (ref args);]]></code>
+ <code mime="text/x-csharp"><![CDATA[Gst.init (ref args);]]></code>
<p>Then, copy the following function into <file>guitar_tuner.vala</file> inside our <code>Main</code> class:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
Gst.Element sink;
Gst.Element source;
Gst.Pipeline pipeline;
@@ -198,7 +198,7 @@ private void play_sound(double frequency)
<p>In the UI designer, you made it so that all of the buttons will call the same function, <gui>on_button_clicked</gui>, when they are clicked. Actually we type <gui>main_on_button_clicked</gui> which tells the UI designer that this method is part of our <code>Main</code>. We need to add that function in the source file.</p>
<p>To do this, in the user interface file (guitar_tuner.ui) select one of the buttons by clicking on it, then open <file>guitar_tuner.vala</file> (by clicking on the tab in the center). Switch to the <gui>Signals</gui> tab on the right, which you used to set the signal name. Now take the row where you set the
<gui>clicked</gui> signal and drag and drop it into to the source file at the beginning of the class. The following code will be added to your source file:</p>
-<code mime="text/x-csharpsrc"><![CDATA[
+<code mime="text/x-csharp"><![CDATA[
public void on_button_clicked (Gtk.Button sender) {
}]]></code>
@@ -212,7 +212,7 @@ public void on_button_clicked (Gtk.Button sender) {
<section id="handler">
<title>Define the signal handler</title>
<p>We want to play the correct sound when the user clicks a button. For this, we flesh out the signal handler which we defined above, <code>on_button_clicked</code>. We could have connected every button to a different signal handler, but that would lead to a lot of code duplication. Instead, we can use the label of the button to figure out which button was clicked:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
public void on_button_clicked (Gtk.Button sender) {
var label = sender.get_child () as Gtk.Label;
switch (label.get_label()) {
diff --git a/platform-demos/C/image-viewer.vala.page b/platform-demos/C/image-viewer.vala.page
index 185cefa..971868c 100644
--- a/platform-demos/C/image-viewer.vala.page
+++ b/platform-demos/C/image-viewer.vala.page
@@ -69,7 +69,7 @@
<p>Click <gui>Continue</gui> then <gui>Apply</gui> and the project will be created for you.
Open <file>src/image_viewer.vala</file> from the <gui>Project</gui> or <gui>File</gui> tabs.
You will see this code:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
using GLib;
using Gtk;
@@ -136,13 +136,13 @@ public class Main : Object
Here we will use the simplest available container, a <link href="http://unstable.valadoc.org/gtk+-2.0/Gtk.Box.html"><code>Gtk.Box</code></link>.</p>
<p>Add the following lines to the top of the <code>Main</code> class:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
private Window window;
private Image image;
]]></code>
<p>Now replace the current constructor with the one below:</p>
-<code mime="text/x-csharpsrc"><![CDATA[
+<code mime="text/x-csharp"><![CDATA[
public Main () {
@@ -205,7 +205,7 @@ public Main () {
<p>We will now define the signal handler for the <code>clicked</code> signal for the
button we mentioned before.
Add this code after the constructor:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
public void on_open_image (Button self) {
var filter = new FileFilter ();
var dialog = new FileChooserDialog ("Open image",
@@ -235,12 +235,12 @@ public void on_open_image (Button self) {
<p>The first argument of the callback method is always the widget that sent the signal.
Sometimes other arguments related to the signal come after that, but <em>clicked</em> doesn't have any.</p>
<p>In this case the <code>button</code> sent the <code>clicked</code> signal, which is connected to the <code>on_open_image</code> callback method:</p>
-<code mime="text/x-csharpsrc"><![CDATA[
+<code mime="text/x-csharp"><![CDATA[
button.clicked.connect (on_open_image);
]]></code>
<p>The <code>on_open_image</code> method takes the button that emitted the signal as an argument: </p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
public void on_open_image (Button self)
]]></code>
</item>
diff --git a/platform-demos/C/magic-mirror.vala.page b/platform-demos/C/magic-mirror.vala.page
index b42eb26..c7bfbb2 100644
--- a/platform-demos/C/magic-mirror.vala.page
+++ b/platform-demos/C/magic-mirror.vala.page
@@ -61,7 +61,7 @@
</item>
<item>
<p>Click <gui>Apply</gui> and the project will be created for you. Open <file>src/magic_mirror.vala</file> from the <gui>Project</gui> or <gui>File</gui> tabs. You should see some code which starts with the lines:</p>
- <code mime="text/x-csharpsrc"><![CDATA[
+ <code mime="text/x-csharp"><![CDATA[
using GLib;
using Gtk;]]></code>
</item>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]