1 // Gtk.VScale.cs - Gtk VScale class customizations
2 //
3 // Author: Mike Kestner <mkestner@ximian.com>
4 //
5 // Copyright (C) 2004 Novell, Inc.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of version 2 of the Lesser GNU General
9 // Public License as published by the Free Software Foundation.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this program; if not, write to the
18 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 // Boston, MA 02111-1307, USA.
20 
21 namespace Gtk {
22 
23 	using System;
24 	using System.Runtime.InteropServices;
25 
26 	public partial class VScale {
27 
28 		[DllImport (Global.GtkNativeDll, CallingConvention = CallingConvention.Cdecl)]
gtk_vscale_new_with_range(double min, double max, double step)29 		static extern IntPtr gtk_vscale_new_with_range (double min, double max, double step);
30 
VScale(double min, double max, double step)31 		public VScale (double min, double max, double step) : base (IntPtr.Zero)
32 		{
33 			if (GetType() != typeof (VScale)) {
34 				Adjustment adj = new Adjustment (min, min, max, step, 10 * step, 0);
35 				string[] names = new string [1];
36 				GLib.Value[] vals = new GLib.Value [1];
37 				names [0] = "adjustment";
38 				vals [0] = new GLib.Value (adj);
39 				CreateNativeObject (names, vals);
40 				vals [0].Dispose ();
41 				return;
42 			}
43 
44 			Raw = gtk_vscale_new_with_range (min, max, step);
45 		}
46 	}
47 }
48