/* * (c) Copyright 1991 Sun Microsystems, Inc. All rights reserved. * See LEGAL_NOTICE file for terms of the license. * * @(#) hist.c 1.3 92/06/26 */ #include #include #include #include #include void resize(); void set_data(); #define NUM_DATA 10 Drawarea hist; Panel_item slider[NUM_DATA]; double data[NUM_DATA]; int key; main(argc, argv) int argc; char *argv[]; { Frame frame; Panel panel; Canvas_shell shell; int i; double left = 0.0; double right= NUM_DATA; double upper = 1.0; double lower = 0.0; xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); frame = (Frame) xv_create(XV_NULL, FRAME, FRAME_LABEL, argv[0], XV_WIDTH, 800, XV_HEIGHT, 400, NULL); panel = (Panel) xv_create(frame, PANEL, PANEL_LAYOUT, PANEL_VERTICAL, NULL); key = xv_unique_key(); for(i=0; i max) max = data[i]; } xv_set(hist, DRAWAREA_UPPER_Y, &max, NULL); } void set_data(item, value, event) Panel_item item; int value; Event *event; { int i; i = (int) xv_get(item, XV_KEY_DATA, key); data[i] = value; display_changes(); }