Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > b8240933842cee58f4e7ce03017867c5 > files > 107

libsx-devel-2.05-18.fc12.i686.rpm

#include <stdio.h>
#include <stdlib.h>
#include "libsx.h"


void quit(Widget w, void *data)
{
  exit(0);
}


void draw_stuff(Widget w, int width, int height, void *data)
{
  ClearDrawArea();
  DrawLine(50,50, width-50, height-50);   /* just draw a diagonal line */
}
  


int main(int argc, char **argv)
{
  Widget w[2];


  argc = OpenDisplay(argc, argv);
  if (argc == 0)                   /* woops, couldn't get started */
    exit(5);
  
  /* could process our own command line options here. */
  
  w[0] = MakeButton("Quit", quit, NULL);
  w[1] = MakeDrawArea(500,500, draw_stuff, NULL);

  SetWidgetPos(w[1], PLACE_UNDER, w[0], NO_CARE, NULL);

  ShowDisplay();
  GetStandardColors();

  MainLoop();   /* off we go! */
}