PROGRAM(scrolled_window);
// Scrolled windows are used to create a scrollable area inside a real
// window. You may insert any type (but only one) of widget into a
// scrolled window, and it will be accessable regardless of the size
// by using the scrollbars.
// IMG: GTK.ScrolledWindow(GTK.Adjustment(),GTK.Adjustment())->add(GTK.Label("A small label")->show())->set_usize(100,80)->set_policy(GTK.POLICY_AUTOMATIC,GTK.POLICY_AUTOMATIC)
// IMG: GTK.ScrolledWindow(GTK.Adjustment(),GTK.Adjustment())->add(GTK.Label("A small label")->show())->set_usize(70,80)->set_policy(GTK.POLICY_AUTOMATIC,GTK.POLICY_AUTOMATIC)
// IMG: GTK.ScrolledWindow(GTK.Adjustment(),GTK.Adjustment())->add(GTK.Label("A small label")->show())->set_usize(80,80)
// IMG: GTK.ScrolledWindow(GTK.Adjustment(),GTK.Adjustment())->add(GTK.Label("A very huge label")->set_usize(700,700)->show())->set_usize(80,80)
INHERIT(window);
COMPLEX_FUNCTION(create, adjustment, adjustment);
NAME_ARGS(xscrollpos,yscrollpos);
COMPLEX_FUNCTION(set_hadjustment, adjustment);
NAME_ARGS(hadjustment);
COMPLEX_FUNCTION(set_vadjustment, adjustment);
NAME_ARGS(vadjustment);
// Set new adjustment objects
SUBWIDGET(hscrollbar, hscrollbar);
// The horizontal scrollbar
SUBWIDGET(vscrollbar, vscrollbar);
// The vertical scrollbar
COMPLEX_FUNCTION(set_policy, int, int);
NAME_ARGS(xpolicy,ypolicy);
// vertical and horiz policy. Both are one of CONST(GTK_POLICY)
FUNCTION(add, "function(object:object)");
ARGS(GTK.Widget);
NAME_ARGS(victim);
{
  GtkWidget *victim;
  struct object *o;

  get_all_args( "add", args, "%o", &o );
  victim = GTK_WIDGET( get_gtkobject( o ) );
  if(!(GTK_WIDGET_CLASS(GTK_OBJECT(victim)->klass)->
       set_scroll_adjustments_signal))
    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(THIS->obj),
                                          victim);
  else
    gtk_container_add( GTK_CONTAINER( THIS->obj ), victim );

  RETURN_THIS();
}

COMPLEX_FUNCTION(set_placement, int);
NAME_ARGS(window_corner_placement);
// One of CONST(GTK_CORNER)

adjustment COMPLEX_FUNCTION(get_hadjustment);
adjustment COMPLEX_FUNCTION(get_vadjustment);

CLASSMEMBER(hscrollbar_policy, int);
CLASSMEMBER(vscrollbar_policy, int);
CLASSMEMBER(hscrollbar_visible, int);
CLASSMEMBER(vscrollbar_visible, int);
CLASSMEMBER(window_placement, int);
