[Kde-bindings] Help start with MonoDevelop and Qyoto GUI

linuxoidoz at yahoo.com.au linuxoidoz at yahoo.com.au
Mon Feb 8 13:51:23 UTC 2010


The signals are already defined in gui.cs:

...
    RetranslateUi(Dialog);
    QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), Dialog, Qt.SLOT("accept()"));
    QObject.Connect(buttonBox, Qt.SIGNAL("rejected()"), Dialog, Qt.SLOT("reject()"));


Here's my main.cs:

**********************
using System;
using Qyoto;

namespace test {

	class MainClass
	{
		public static int Main(String[] args) {
	        new QApplication(args);
			MainApp mainwindow = new MainApp();
			mainwindow.Show();
	        return QApplication.Exec();
		}
			
	}
}
**********************

and here's my MainWindow.cs:

**********************
using System;
using Qyoto;

namespace test {

	public class MainApp : QDialog{
	
		Ui_Dialog ui = new Ui_Dialog();
	
		public MainApp() {
			ui.SetupUi(this);
			Connect(ui.buttonBox, SIGNAL("clicked()"), delegate {
				ui.label.Text = "Init App";
				QMessageBox.About(this, "About Dialog", "Button clicked!");
			});
			Connect(ui.buttonBox, SIGNAL("rejected()"), qApp, SLOT("quit()"));
		}
	}
}
**********************

When I press either of the button, the window simply closes. What am I doing wrong? Thank you for your help.



More information about the Kde-bindings mailing list