[Gtk-sharp-list] glade-sharp Autoconnect
Mon, 08 Dec 2003 23:52:06 -0500
On Mon, 2003-12-08 at 23:36, Greg Hamilton wrote:
> Hi, I'm new to Mono and gtk-sharp and I've run into a problem which I
> haven't been able to solve with the docs or Google.
> I'm trying to follow the glade example here
> The c# source builds and runs and the window and button defined in the
> glade xml file are displayed but the button click and window destroy
> events aren't handled. The example uses autoconnect to set up the
> connections. Is there something wrong with the example?
The example glade file is missing <signal> tags marking a function that
is supposed to be connected to a signal handler. In the Glade UI, you
can create the connections in the Signals tab of a widget. The XML tags
look something like this:
<signal name="activate" handler="OnFileSave" />
So (warning: untested) you'd want to add lines like:
<widget class="GtkWindow" id="window2">
<signal name="delete" handler="OnWindowDeleteEvent" />
<widget class="GtkButton" id="button1">
<signal name="clicked" handler="OnButton1Clicked" />
Peter Williams firstname.lastname@example.org
"[Ninjas] are cool; and by cool, I mean totally sweet."
-- REAL Ultimate Power