/* -*- c -*- */

PROGRAM(frame);
// Used to visually group objects.
// IMG: GTK.Frame("Title")->add(GTK.Label("Contents")->show())
// IMG: GTK.Frame()->add(GTK.Label("Contents")->show())
// IMG: GTK.Frame()->add(GTK.Label("Contents")->show())->set_shadow_type(GTK.SHADOW_IN)
INHERIT(container);
FUNCTION(create, "function(string|void:void)")
NAME_ARGS(label_text);
{
  char *title = NULL;
  if(args)
  {
    if((sp[-1].type == T_STRING) && sp[-1].u.string->len)
      title = sp[-1].u.string->str;
  }
  if(THIS->obj) error("GTK.Frame->create() can only be called once.\n");
  THIS->obj = GTK_OBJECT( gtk_frame_new( title ) );
  pgtk__init_this_object();
}
// The argument is the title of the frame.
COMPLEX_FUNCTION(set_label, string);
NAME_ARGS(label_text);
COMPLEX_FUNCTION(set_label_align, float, float);
NAME_ARGS(xalign,yalign);
// Arguments are xalignment and yalignment.
// 0.0 is left or topmost, 1.0 is right or bottommost.

COMPLEX_FUNCTION(set_shadow_type,int);
NAME_ARGS(shadow_type);
// type is one of CONST(GTK_SHADOW)

