HI guys,

Perhaps the simplest way to ask this is, could anyone tell me why when
the attached file (Genie) is compiled and then run, do I get these error
messages?

(wasiliana:2710): Gtk-CRITICAL **: gtk_container_add: assertion
`GTK_IS_CONTAINER (container)' failed
(wasiliana:2710): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(wasiliana:2710): GLib-GObject-CRITICAL **: g_signal_connect_object:
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

-- 
Andrew
[indent=4]

// Compile with

uses
    Gtk
    Gdk

class wMain : GLib.Object

    prop main_window : MainWindow
    
    init
        var main_window = new MainWindow()
        var main_viewport = new Viewport(null, null)

        main_window.scrolled_window.add(main_viewport)
        main_window.show_all()
        
        main_window.location_entry.activate.connect(on_location_activate)

    def on_show_menuitem_activate(show_menuitem:CheckMenuItem)
        if show_menuitem.active
            print "Toggled"
            main_window.show()
        else
            print "Not Toggled"
            main_window.hide()
            
    def on_location_activate(location_entry:Gtk.Entry)
        print "connected"



class MainWindow : Gtk.Window

    prop scrolled_window : ScrolledWindow
    prop toolbar : Toolbar
    prop forward_button : ToolButton
    prop location_entry : Entry
    
    construct(type:Gtk.WindowType=Gtk.WindowType.TOPLEVEL)
        GLib.Object(type:type)
        this.set_default_size(900, 600)

    init
        this.delete_event.connect(on_mainwindow_delete_event)
        
        // Toolbar creation
        var scrolled_window = new ScrolledWindow(null, null)
        var vbox = new VBox(false, 0)
        var toolbar_hbox = new HBox(true, 0)
        var toolbar = new Toolbar()
        var back_button = new ToolButton.from_stock("gtk-go-back")
        var forward_button = new ToolButton.from_stock("gtk-go-forward")
        var location_entry = new Entry()
        
        //Toolbar Packing
        toolbar.insert(back_button, -1)
        toolbar.insert(forward_button, -1)
        toolbar_hbox.pack_start(toolbar, false, true)
        toolbar_hbox.pack_start(location_entry, false, true)
        vbox.pack_start(toolbar_hbox, false, true)
        vbox.pack_start(scrolled_window, true, true)
        this.add(vbox)
        
        
    def on_mainwindow_delete_event() : bool
        this.hide()
        return true

        
init
    Gtk.init (ref args)
    new wMain()
    Gtk.main()
            
            
            
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to