[Mono-devel-list] Question about Glade.

Daniel Carrera dcarrera at math.umd.edu
Wed Jul 21 14:53:32 EDT 2004


Hello,

I'm getting started with Glade/Mono/C#.  I'm having problems connecting a 
toolbar button to an event.  I can connect the window 'delete_event' to a 
method successfully.  Ditto for regular buttons.  But I can't seem to get 
toolbar buttons to work.

Here is the relevant portion of the .glade file:

  <widget class="GtkToolButton" id="toolbutton1">
     <property name="visible">True</property>
     <property name="stock_id">gtk-refresh</property>
     <property name="visible_horizontal">True</property>
     <property name="visible_vertical">True</property>
     <property name="is_important">False</property>
     <signal name="clicked" handler="OnRefreshClicked" last_modification_time="Wed, 21 Jul 2004 17:49:23 GMT"/>
  </widget>

And here is the relevant portion of the C# file:

namespace OpenClipArtLibrary {
    using System;
    using Gtk;
    using Glade;
    using GtkSharp;	

    public class OCAL
    {

      [snip]

        public void OnRefreshClicked (System.Object obj, EventArgs args)
        {
            Console.WriteLine("You clicked Refresh.");
            Application.Quit();
        }
    }
}


I put the Application.Quit() there for testing purposes.  After 
compilation, clicking on 'Refresh' doesn't produce anything.  No text to 
the command-line.  The app doesn't exit.  This method is not being called 
at all.

I have been banging my head against the wall on this for two hours.  
Everything else works so far.  The 'delete_event' can find the correct 
handler.

Mono produces no error btw.

I am running Mono 1.0 with Glade 2.6.0 on Debian GNU/Linux.

Can anyone see where I goofed?

Cheers,
-- 
Daniel Carrera | No trees were harmed in the generation of this
PhD student.   | e-mail.  A significant number of electrons were,
Math Dept. UMD | however, severely inconvenienced.



More information about the Mono-devel-list mailing list