|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
ComboBox Events bug?Hi all,
I'm trying to use the "FOCUS_OUT" event out of ComboBox, since it extends from Bin which extends from Container which finally extends from Widget, I should able to get the event, right? I'm attaching a ComboBoxListener and I get the CHANGED event. I'm attaching a ContainerListener and I _don't_ get any Container event. I'm attaching a FocusListener and I _don't_ get any focus event. So it seems that something gets wrong in ComboBox <-> Bin <-> Container. Can anyone look into this? Should I send a simple example? Any hints to fix the bug myself :)? Thanks! ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ java-gnome-developer mailing list java-gnome-developer@... https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |
|
|
Re: ComboBox Events bug?On Wed, 2006-08-02 at 08:41 +0100, Manuel Clos wrote:
> I'm trying to use the "FOCUS_OUT" event out of ComboBox, I've only used FOCUS_OUT once, but it works ok: http://research.operationaldynamics.com/source/darcsweb/?r=objective;a=headblob;f=/src/accounts/ui/ForeignAmountEntryBox.java#l118 (and two others in that file. I note that I'm using it against an Entry so that doesn't necessarily prove anything for you. You might want to have a glance there to make sure you're doing the Listener/Event correctly, though) > Can anyone look into this? Should I send a simple example? Test cases are always brilliant. They are, of course, hard to generate in a compact way so I for one always take the time to try them if someone goes to the trouble. AfC Sydney ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ java-gnome-developer mailing list java-gnome-developer@... https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |
|
|
Re: ComboBox Events bug?Hi,
Here is a compact example, showing that Entry produces focus events, while ComboBox doesn't. Andrew Cowie wrote: > Test cases are always brilliant. They are, of course, hard to generate > in a compact way so I for one always take the time to try them if > someone goes to the trouble. import org.gnu.gtk.ComboBox; import org.gnu.gtk.Entry; import org.gnu.gtk.Gtk; import org.gnu.gtk.VBox; import org.gnu.gtk.Window; import org.gnu.gtk.event.FocusEvent; import org.gnu.gtk.event.FocusListener; public class ComboTest { public ComboTest() { Window w = new Window(); VBox box = new VBox(false, 0); ComboBox cb = new ComboBox(); cb.appendText("foo"); cb.appendText("bar"); cb.addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the ComboBox"); return false; } }); Entry e = new Entry(); e.addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the Entry"); return false; } }); box.packStart(cb, false, false, 0); box.packStart(e, false, false, 0); box.setBorderWidth(20); box.setSpacing(10); w.add(box); w.showAll(); } public static void main(String[] args) { Gtk.init (args); ComboTest ct = new ComboTest(); Gtk.main (); } } |
|
|
Re: ComboBox Events bug?On Wed, 2006-08-02 at 11:50 +0100, Manuel Clos wrote:
> Here is a compact example, showing that Entry produces focus events, > while ComboBox doesn't. Duplicated. Manuel, chat with the day-shift guys in Toronto on IRC, but if none of them are able to figure this one out quickly, I'd suggest you raise a bug in Bugzilla (against java-gnome/libgtk-java) and attach your test case. Cheers, AfC Sydney ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ java-gnome-developer mailing list java-gnome-developer@... https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |
|
|
Re: ComboBox Events bug?Hi all,
Here is what I found so far: - It looks that there is no problem in java-gnome: ComboBox as Button both extend Bin, and Button is working properly. No code in the hierarchy captures the signal or prevents emiting it. - Attaching a ContainerListener to the ComboBox gives you a SET_FOCUS_CHILD event, while doing the same in the Button doesn't. - Looking at the gtk code, it looks that the combobox grabs the focus to some of his childrens, so the combobox itself never gets focus, and doesn't emit a focus signal itself. - Writing a similar example in C gives the same results: the Button emits the focus out event and the ComboBox doesn't. - I'm left to using the SET_FOCUS_CHILD of the Container when using a ComboBox. - It remains for more experienced people to decide if this is a bug / design decision from GTK, and people should use SET_FOCUS_CHILD (and we need to document it :)). Examples attached. See you! Andrew Cowie wrote: > On Wed, 2006-08-02 at 11:50 +0100, Manuel Clos wrote: >> Here is a compact example, showing that Entry produces focus events, >> while ComboBox doesn't. > > Duplicated. > > Manuel, chat with the day-shift guys in Toronto on IRC, but if none of > them are able to figure this one out quickly, I'd suggest you raise a > bug in Bugzilla (against java-gnome/libgtk-java) and attach your test > case. #include <gtk/gtk.h> void combo_hello (GtkWidget *widget, gpointer data) { g_print ("Focus out event in the combo\n"); } void button_hello (GtkWidget *widget, gpointer data) { g_print ("Focus out event in the button\n"); } int main (int argc, char *argv[]) { GtkWidget *window; GtkVBox *vbox; GtkComboBox *cb; GtkButton *b; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); vbox = gtk_vbox_new (FALSE, 0); cb = gtk_combo_box_new_text(); gtk_combo_box_append_text(cb, "foo"); gtk_combo_box_append_text(cb, "bar"); b = gtk_button_new_with_label("button"); gtk_signal_connect (GTK_OBJECT (cb), "focus_out_event", GTK_SIGNAL_FUNC (combo_hello), NULL); gtk_signal_connect (GTK_OBJECT (b), "focus_out_event", GTK_SIGNAL_FUNC (button_hello), NULL); gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(cb), FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(b), FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); gtk_widget_show_all (window); gtk_main (); return 0; } import org.gnu.gtk.Button; import org.gnu.gtk.ComboBox; import org.gnu.gtk.Container; import org.gnu.gtk.Entry; import org.gnu.gtk.Gtk; import org.gnu.gtk.VBox; import org.gnu.gtk.Widget; import org.gnu.gtk.Window; import org.gnu.gtk.event.ContainerEvent; import org.gnu.gtk.event.ContainerListener; import org.gnu.gtk.event.FocusEvent; import org.gnu.gtk.event.FocusListener; public class ComboTest { ComboBox cb; public ComboTest() { Window w = new Window(); VBox box = new VBox(false, 0); cb = new ComboBox(); cb.appendText("foo"); cb.appendText("bar"); cb.addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the ComboBox"); return false; } }); ((Container)cb).addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the Container"); return false; } }); cb.addListener(new ContainerListener() { public void containerEvent(ContainerEvent event) { System.out.print("I'm a ContainerEvent of the ComboBox: "); if (event.getType() == ContainerEvent.Type.SET_FOCUS_CHILD) { System.out.println("SET_FOCUS_CHILD"); cb.grabFocus(); } else { System.out.println(); } } }); Entry e = new Entry(); e.addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the Entry"); return false; } }); Button b = new Button("button"); b.addListener(new FocusListener() { public boolean focusEvent(FocusEvent event) { System.out.println("I'm a FocusEvent of the Button"); return false; } }); b.addListener(new ContainerListener() { public void containerEvent(ContainerEvent event) { System.out.println("I'm a ContainerEvent of the Button"); } }); box.packStart(cb, false, false, 0); box.packStart(e, false, false, 0); box.packStart(b, false, false, 0); box.setBorderWidth(20); box.setSpacing(10); w.add(box); w.showAll(); } public static void main(String[] args) { Gtk.init (args); ComboTest ct = new ComboTest(); Gtk.main (); } } |
|
|
Re: ComboBox Events bug?I went ahead and created a bug for this just in case: https://bugzilla.gnome.org/show_bug.cgi?id=599076.
Thanks! |
| Free embeddable forum powered by Nabble | Forum Help |