/* -----------------------------------------------------------------------
 * The "Hello World" applet.  This is a very simple applet that puts up
 * a button, which when pressed destroys itself (since we can't really exit
 * an applet per se).
 * -----------------------------------------------------------------------
 */

package sub_arctic.test;

/* import various pieces of the sub_arctic toolkit that we need */
import sub_arctic.lib.*;
import sub_arctic.input.*;
import sub_arctic.constraints.std_function;

/* We use a new subclass of interactor_applet (which is an applet capable of 
 * hosting a sub_arctic interface).
 */
public class hello_world_debug extends debug_interactor_applet 
  implements callback_object {

  /* initialization of sub_arctic interface when applet starts */
  public void build_ui(base_parent_interactor top) 
    {
      /* create a button centered in the top level interactor */
      button goodbye = new button("Goodbye", this);
      goodbye.set_x_constraint(std_function.centered(PARENT.W(), 0));
      goodbye.set_y_constraint(std_function.centered(PARENT.H(), 0));

      /* make the button a child of the top level */
      top.add_child(goodbye);

    }

  /* handle callback from the button. */
  public void callback(interactor from, event evt, int cb_num, Object cb_parm)
    {
      /* remove the button from the interface (since we can't exit) */
      if (from.parent() != null)
        from.parent().remove_child(from);
    }
};

/*=========================== COPYRIGHT NOTICE ===========================

This file is part of the subArctic user interface toolkit.

Copyright (c) 1996 Scott Hudson and Ian Smith
All rights reserved.

The subArctic system is freely available for most uses under the terms
and conditions described in 
  http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
and appearing in full in the lib/interactor.java source file.

The current release and additional information about this software can be 
found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/

========================================================================*/