summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java')
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java31
1 files changed, 12 insertions, 19 deletions
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
index a4657988184..361136f08e9 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
@@ -52,39 +52,39 @@ public class GtkCheckboxPeer extends GtkComponentPeer
// The current state of the GTK checkbox.
private boolean currentState;
- public native void nativeCreate (GtkCheckboxGroupPeer group,
- boolean state);
+ public native void create (GtkCheckboxGroupPeer group);
public native void nativeSetCheckboxGroup (GtkCheckboxGroupPeer group);
public native void connectSignals ();
native void gtkSetFont (String name, int style, int size);
- public native void gtkSetLabel (String label);
+ native void gtkButtonSetLabel (String label);
+ native void gtkToggleButtonSetActive (boolean is_active);
public GtkCheckboxPeer (Checkbox c)
{
super (c);
}
- // We can't fully use the ordinary getArgs code here, due to
- // oddities of this particular widget. In particular we must be
- // able to switch between a checkbutton and a radiobutton
- // dynamically.
+ // FIXME: we must be able to switch between a checkbutton and a
+ // radiobutton dynamically.
public void create ()
{
- CheckboxGroup g = ((Checkbox) awtComponent).getCheckboxGroup ();
+ Checkbox checkbox = (Checkbox) awtComponent;
+ CheckboxGroup g = checkbox.getCheckboxGroup ();
old_group = GtkCheckboxGroupPeer.getCheckboxGroupPeer (g);
- currentState = ((Checkbox)awtComponent).getState();
- nativeCreate (old_group, currentState);
+ create (old_group);
+ gtkToggleButtonSetActive (checkbox.getState ());
+ gtkButtonSetLabel (checkbox.getLabel ());
}
public void setState (boolean state)
{
if (currentState != state)
- set ("active", state);
+ gtkToggleButtonSetActive (state);
}
public void setLabel (String label)
{
- gtkSetLabel (label);
+ gtkButtonSetLabel (label);
}
public void setCheckboxGroup (CheckboxGroup group)
@@ -100,13 +100,6 @@ public class GtkCheckboxPeer extends GtkComponentPeer
}
}
- public void getArgs (Component component, GtkArgList args)
- {
- super.getArgs (component, args);
- args.add ("active", ((Checkbox) component).getState ());
- args.add ("label", ((Checkbox) component).getLabel ());
- }
-
// Override the superclass postItemEvent so that the peer doesn't
// need information that we have.
public void postItemEvent (Object item, int stateChange)
OpenPOWER on IntegriCloud