Re: [Java-gnome-developer] error defining signals with glade
Brought to you by:
afcowie
From: Keith I. <ke...@ke...> - 2005-05-28 20:25:24
|
I think the method needs to be void: public void on_button1_clicked() { System.out.println("clicked"); } If you check out the tutorial on the java-gnome site, I think it explicitly says this somewhere. -K On Sat, 2005-05-28 at 22:16 +0200, Oláh Gábor wrote: > hiya, > > 2005-05-27, p keltezéssel 18.51-kor Jeff Morgan ezt írta: > > On 5/27/05, Oláh Gábor <ga...@cw...> wrote: > > > the error says: > > > java.lang.reflect.InvocationTargetException: ListenerDelegate.create > > > failure > > > > The problem here is that you have defined a callback > > (on_button_execute_clicked) but this method doesn't exist > > in your example. This is not a Java-GNOME bug. If you > > add this method you will see that it works fine. > thanks for the comment, but defining the method does no difference - i > get the same error... > > short example: > > package org.testing; > import java.io.FileNotFoundException; > import java.io.IOException; > import org.gnu.glade.GladeXMLException; > import org.gnu.glade.LibGlade; > import org.gnu.gtk.Gtk; > > public class HotplugManager { > > LibGlade glade; > > public HotplugManager() throws GladeXMLException, > FileNotFoundException, > IOException { > glade = new LibGlade("test.glade", this); > } > > public int on_button1_clicked() { > System.out.println("pressed"); > return 0; > } > > public static void main(String[] args) { > > HotplugManager hotplugman; > > Gtk.init(args); > try { > hotplugman = new HotplugManager(); > } catch(Exception e) { > e.printStackTrace(); > } > Gtk.main(); > > } > } > > test.glade: > > <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> > <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> > > <glade-interface> > > <widget class="GtkWindow" id="window1"> > <property name="visible">True</property> > <property name="title" translatable="yes">window1</property> > <property name="type">GTK_WINDOW_TOPLEVEL</property> > <property name="window_position">GTK_WIN_POS_NONE</property> > <property name="modal">False</property> > <property name="resizable">True</property> > <property name="destroy_with_parent">False</property> > <property name="decorated">True</property> > <property name="skip_taskbar_hint">False</property> > <property name="skip_pager_hint">False</property> > <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> > <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> > <property name="focus_on_map">True</property> > > <child> > <widget class="GtkVBox" id="vbox1"> > <property name="visible">True</property> > <property name="homogeneous">False</property> > <property name="spacing">0</property> > > <child> > <widget class="GtkButton" id="button1"> > <property name="visible">True</property> > <property name="can_focus">True</property> > <property name="label" translatable="yes">button</property> > <property name="use_underline">True</property> > <property name="relief">GTK_RELIEF_NORMAL</property> > <property name="focus_on_click">True</property> > <signal name="clicked" handler="on_button1_clicked" > last_modification_time="Fri, 27 May 2005 20:51:54 GMT"/> > </widget> > <packing> > <property name="padding">0</property> > <property name="expand">False</property> > <property name="fill">False</property> > </packing> > </child> > </widget> > </child> > </widget> > > </glade-interface> > > > cheers > gaboro > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |