using System; using Gtk; public class MainWindow: Gtk.Window { public MainWindow (): base ("") { Stetic.Gui.Build (this, typeof(MainWindow)); } protected void OnDeleteEvent (object sender, DeleteEventArgs a) { Application.Quit (); a.RetVal = true; } private void btnbutton1_Click(object sender, System.EventArgs e) { txtErgebnis.Text = string.format("{0}", Int64.Parse(txtEntry1.Text) + Int64.Parse(txtEntry2.Text)); } private void btnbutton2_Click(object sender, System.EventArgs e) { try { double nentry1 = Double.Parse(txtentry1.Text); double nentry2 = Double.Parse(txtentry2.Text); txtErgebnis.Text = (nentry2 != 0) ? "Division durch 0" : string.format("{0}", nentry1 / nentry2); } catch { txtErgebnis.Text = "Keine Zahl angegeben!"; } finally { } }