[Vala] [Genie] I can't create a new widget Gtk.Switch (from Gtk3) Vala 0.11.7



Hi all,

Button description:
--------------------------
http://library.gnome.org/devel/gtk3/stable/GtkSwitch.html

gtk+-3.0.vapi
-----------------
        [CCode (cheader_filename = "gtk/gtk.h")]
        public class Switch : Gtk.Widget, Atk.Implementor, Gtk.Buildable,
Gtk.Activatable {
                [CCode (type = "GtkWidget*", has_construct_function = false)]
                public Switch ();
                public bool get_active ();
                public void set_active (bool is_active);
                public bool active { get; set; }
        }

My source file:
--------------------

/*
 * valac --verbose --debug --save-temps --pkg gtk+-3.0 gtk3switch.gs
 */

[indent = 4]

init
    Gtk.init (ref args)
    var mainwindow = new MainWindow ()
    mainwindow.title = "Test"
    mainwindow.window_position = Gtk.WindowPosition.CENTER
    mainwindow.show_all ()
    Gtk.main ()

class MainWindow : Gtk.Window
    _hbox : Gtk.HBox = new Gtk.HBox (false, 0)

    init
        default_height = 400
        default_width = 500
        destroy.connect (Gtk.main_quit)

    construct MainWindow ()
        super
        self.add (_hbox)
        test_switch_button ()

    def private test_switch_button ()
        var switch_button = new Gtk.Switch ()
        _hbox.pack_start (switch_button, false, false)


valac output:
-----------------
dmitriy runningmaster:~/source/valagenie$ valac --verbose --debug
--save-temps --pkg gtk+-3.0 gtk3switch.gs

cc -g -o '/home/dmitriy/source/valagenie/gtk3switch'
'/home/dmitriy/source/valagenie/gtk3switch.c' -pthread -DGSEAL_ENABLE
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/gtk-3.0 -I/usr/lib/gtk-3.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12  -pthread
-lgtk-x11-3.0 -lcairo-gobject -lpangoft2-1.0 -lfreetype -lfontconfig
-lgio-2.0 -latk-1.0 -lgdk-x11-3.0 -lgdk_pixbuf-2.0 -lm -lpng12
-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0

/home/dmitriy/source/valagenie/gtk3switch.c: In function
‘main_window_test_swith_button’:
/home/dmitriy/source/valagenie/gtk3switch.c:93: error: ‘GtkSwitch’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:93: error: (Each
undeclared identifier is reported only once
/home/dmitriy/source/valagenie/gtk3switch.c:93: error: for each
function it appears in.)
/home/dmitriy/source/valagenie/gtk3switch.c:93: error: ‘_tmp0_’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:94: error: ‘swith_button’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:96: error: expected
expression before ‘)’ token
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
dmitriy runningmaster:~/source/valagenie$


Can anybody help me? thanks (Vala 0.11.7, Ubuntu 10.10)

-- 
Banzai,
Dmitriy Kovalenko



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]