[Gtk-sharp-list] Fw: Help me with the first application!
Duong Nguyen
duongnguyen at mail.ru
Tue Dec 5 11:46:14 EST 2006
Hi, KLessou
Thanks for your answer, I have fix the problem. But once more problem was appeared:
I tried to do something with events (button clicked). Compiled successfully, but error at runtime like this:
D:\lab01\ChatClient>mono Client.exe
Button press
Stacktrace:
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
at Gtk.Application.Run () <0x00007>
at MainApplication.Main (string[]) <0x0002e>
at (wrapper runtime-invoke) System.Object.runtime_invoke_void_string[] (object
,intptr,intptr,intptr) <0xffffffff>
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
and here is the code:
using System;
using System.Net;
using System.Net.Sockets;
using System.Text; //
using System.Threading;
using Gtk;
using Glade;
public class MainWindow
{
public MainWindow()
{
Glade.XML gxml = new Glade.XML("ClientGUI.glade", "MainWindow", "");
gxml.Autoconnect(this);
gxml["MainWindow"].ShowAll();
btnConnect.Clicked += new EventHandler(OnPressBtnConnect);
}
[Widget] Button btnConnect;
public void OnPressBtnConnect(object sender, EventArgs e)
{
Console.WriteLine("Button press");
}
public class MainApplication
{
public static void Main(string[] args)
{
Application.Init();
MainWindow mw = new MainWindow();
Application.Run();
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061205/82c26f4e/attachment.html
More information about the Gtk-sharp-list
mailing list