GtkChoicePeer.java (postItemEvent): Rename to...

2003-12-22  Fernando Nasser  <fnasser@redhat.com>

        * gnu/java/awt/peer/gtk/GtkChoicePeer.java (postItemEvent): Rename to...        (choicePostItemEvent): Change signature to more specific String object.
        * java/awt/Choice.java (add): Generate ItemEvent for the first item
        added.
        (insert): Generate ItemEvent if insertion caused
        selection to change.
        (remove): Generate ItemEvent if removal cause selection to change.
        (removeAll): Change algorithm to prevent generation of ItemEvents.
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
        (connect_choice_item_selectable_hook): Change argument type.
        Fix argument value.
        Make sure resources are feed by registering callback.
        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append): Adjust call to the
        above function.
        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add): Ditto.
        (item_activate): Ditto.
        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove): Destroy removed
        menuitem.
        (item_removed): New function.  Free resources.
        * jni/gtk-peer/gtkpeer.h (item_event_hook_info): Change member type and
        name.
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
        (Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): Obtain MethodID for
        choicePostItemEvent.

From-SVN: r74979
This commit is contained in:
Fernando Nasser 2003-12-23 19:24:00 +00:00 committed by Fernando Nasser
parent 459ac19fa5
commit baba70d019
6 changed files with 120 additions and 29 deletions

View file

@ -84,10 +84,10 @@ public class GtkChoicePeer extends GtkComponentPeer
}
*/
protected void postItemEvent (Object item, int stateChange)
protected void choicePostItemEvent (String label, int stateChange)
{
if (stateChange == ItemEvent.SELECTED)
((Choice) awtComponent).select ((String) item);
super.postItemEvent (item, stateChange);
((Choice) awtComponent).select (label);
super.postItemEvent (label, stateChange);
}
}