Re: [Vala] getting started with vala and glade
- From: Al Thomas <astavale yahoo co uk>
- To: Chris Bare <chris bare gmail com>, "vala-list gnome org" <vala-list gnome org>
- Subject: Re: [Vala] getting started with vala and glade
- Date: Sun, 26 Jun 2016 23:58:30 +0000 (UTC)
From: Chris Bare <chris bare gmail com>
Subject: [Vala] getting started with vala and glade
I have a very simple vala program that is trying to load a glade ui file.
The window appears briefly, but then the program exits without error.
What am I missing?
You need to add the ApplicationWindow to your Application. So add "this.add_window( window );":
using Gtk;
public class Thelma : Gtk.Application {
protected override void activate () {
var builder = new Builder ();
builder.set_application( this );
builder.add_from_file ("test.ui");
var window = builder.get_object ("mainWindow") as ApplicationWindow;
window.show_all ();
this.add_window( window );
}
}
public int main (string[] args) {
return new Thelma().run (args);
}
The non Builder version did this with:var window = new Gtk.ApplicationWindow (this);
Regards,
Al
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]