File: icon.c

package info (click to toggle)
quickplot 0.4.3-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 352 kB
  • ctags: 276
  • sloc: ansic: 4,124; makefile: 124; sh: 12
file content (58 lines) | stat: -rw-r--r-- 1,744 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/***************************************************************
LanceMan's quickplot --- a fast interactive 2D plotter

Copyright (C) 1998, 1999  Lance Arsenault

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Or look at http://www.gnu.org/copyleft/gpl.html .

**********************************************************************/
/* $Id: icon.c,v 1.1 1998/02/28 18:09:06 lance Exp $ */
/*
**  Create a nice icon image
*/
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>

#include "QuickPlotIcon.xbm"

void SetIconImage(Widget w, Boolean flag)
{
  Pixmap pixmap;
  Pixel foreground, background;
  unsigned int depth;
  unsigned int width = QuickPlotIcon_width;
  unsigned int height = QuickPlotIcon_height;

  XtVaGetValues(w,XtNdepth, &depth, NULL);
  foreground = XBlackPixelOfScreen(XtScreen(w));
  background = XWhitePixelOfScreen(XtScreen(w));

  pixmap = XCreatePixmapFromBitmapData(
	    XtDisplay(w),
	    XRootWindowOfScreen(XtScreen(w)),
	    (char *) QuickPlotIcon_bits,
	    width,
	    height,
	    foreground,
	    background,
	    depth);
  XtVaSetValues(w, XtNiconPixmap, pixmap, NULL);

}