#ifndef __pager_h
#define __pager_h

#include "toolbox.h"

typedef struct {
  ComponentId button; // in parent window to choose this page
  ObjectId child; // the page window itself
} _page_child;

typedef struct {
  ObjectId parent;
  int x_offset; // from left of window
  int y_offset_top; // from top of window
  int y_offset_bottom;
  int width;
  // height from the parent's height

  ObjectId current_child;

  void (*pager_paged)(ComponentId button,ObjectId child);

  int children; // total pages available
  _page_child child[];

} pager;

pager *pager_init(ObjectId parent, int x, int ytop, int w, int ybottom, void (*callback)(ComponentId,ObjectId),int children, ...);
void pager_show(pager *p,int child);
ObjectId pager_get_page(pager *p, ComponentId c);

#endif
