[Gtk-sharp-list] GTK Window Events
jtemple
jtemple at yhti.net
Fri Aug 6 18:24:01 EDT 2010
***Newbie Alert***
Okay, I've been working with C#/.Net for a few years now. I'm working on a
side project that I'd like to run cross platform so I've decided to give
GTK# a try. I've downloaded the latest GTK# and MONO. I'm trying a VERY
basic program to add a page to a notebook control. What I'm having trouble
with is getting an event to fire when the program starts. I've tried Shown,
Mapped, Realized all without success. Here's the code I have so far:
using System;
using Gtk;
public partial class MainWindow : Gtk.Window
{
public MainWindow () : base(Gtk.WindowType.Toplevel)
{
Build ();
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
protected virtual void OnExitActionActivated (object sender,
System.EventArgs e)
{
Application.Quit();
}
protected virtual void OnShown (object sender, System.EventArgs e)
{
notebook1.AppendPage(new Button("Test"), new Label("Test"));
}
}
I'm also not seeing where MonoDevelop is adding the code to fire the event.
I just used the GUI to generate the form and the code posted here. I'm
missing something, aren't I? :)
--
View this message in context: http://mono.1490590.n4.nabble.com/GTK-Window-Events-tp2316890p2316890.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
More information about the Gtk-sharp-list
mailing list