2001-05-14 06:34:02 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Objective Caml */
|
|
|
|
/* */
|
|
|
|
/* Jun Furuse, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 2001 Institut National de Recherche en Informatique et */
|
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#include "libgraph.h"
|
|
|
|
|
2001-12-07 02:49:30 -08:00
|
|
|
value gr_open_subwindow(value grx, value gry, value width, value height)
|
2001-05-14 06:34:02 -07:00
|
|
|
{
|
|
|
|
Window win;
|
|
|
|
|
2001-12-07 02:49:30 -08:00
|
|
|
int h = Int_val(height);
|
|
|
|
int w = Int_val(width);
|
|
|
|
int x = Int_val(grx);
|
|
|
|
int y = Int_val(gry);
|
|
|
|
|
2001-05-14 06:34:02 -07:00
|
|
|
gr_check_open();
|
|
|
|
win = XCreateSimpleWindow(grdisplay, grwindow.win,
|
2001-12-07 02:49:30 -08:00
|
|
|
x, Wcvt(y - h),
|
|
|
|
w, h,
|
2001-07-12 06:00:55 -07:00
|
|
|
0, grblack, grbackground);
|
2001-05-14 06:34:02 -07:00
|
|
|
XMapWindow(grdisplay, win);
|
|
|
|
XFlush(grdisplay);
|
2001-12-07 02:49:30 -08:00
|
|
|
return (id_of_window (win));
|
2001-05-14 06:34:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
value gr_close_subwindow(value wid)
|
|
|
|
{
|
|
|
|
Window win;
|
|
|
|
|
|
|
|
gr_check_open();
|
|
|
|
sscanf( String_val(wid), "%lu", (unsigned long *)(&win) );
|
|
|
|
XDestroyWindow(grdisplay, win);
|
|
|
|
XFlush(grdisplay);
|
|
|
|
return Val_unit;
|
|
|
|
}
|