[seed] [n-oscillator] Use new semi-attractive gobject property definition
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [seed] [n-oscillator] Use new semi-attractive gobject property definition
- Date: Sat, 1 Aug 2009 03:27:24 +0000 (UTC)
commit b8012a636c670949081e447116184bc338badf8b
Author: Tim Horton <hortont424 gmail com>
Date: Fri Jul 31 23:26:59 2009 -0400
[n-oscillator] Use new semi-attractive gobject property definition
examples/n-oscillator.js | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/examples/n-oscillator.js b/examples/n-oscillator.js
index 4241522..da46c7e 100755
--- a/examples/n-oscillator.js
+++ b/examples/n-oscillator.js
@@ -13,19 +13,17 @@ var unique_id = 0;
OscillatorWidget = new GType({
parent: Gtk.VBox.type,
name: "OscillatorWidget",
- class_init: function(klass, prototype)
- {
- var flags = (GObject.ParamFlags.CONSTRUCT |
- GObject.ParamFlags.READABLE |
- GObject.ParamFlags.WRITABLE);
-
- var ps = GObject.param_spec_float("frequency",
- "Oscillator Frequency",
- "The frequency of the audiotestsrc.",
- 0, 3000, 1000, flags);
-
- klass.c_install_property(ps);
- },
+ properties: [
+ { name: "frequency",
+ type: GObject.TYPE_INT,
+ default_value: 1000,
+ minimum_value: 0,
+ maximum_value: 3000,
+ flags: GObject.ParamFlags.CONSTRUCT |
+ GObject.ParamFlags.READABLE |
+ GObject.ParamFlags.WRITABLE
+ }
+ ],
init: function()
{
// Private
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]