1
/* tilp - link program for TI calculators
2
* Copyright (C) 1999-2001 Romain Lievin
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
/* Open the pixmap stored on the file 'filename' and put it in the 'pixmap'
29
variable according to the 'mask' variable */
30
void open_xpm (char *filename, GtkWidget *parent,
31
GdkPixmap **pixmap, GdkBitmap **mask)
36
style = gtk_widget_get_style (parent);
37
#if defined(__LINUX__)
38
s = g_strconcat(inst_paths.base_dir, SHARE_DIR "/pixmaps/", filename, NULL);
39
#elif defined(__WIN32__)
40
s = g_strconcat(inst_paths.base_dir, SHARE_DIR "\\pixmaps\\", filename, NULL);
43
if (access (s, F_OK) != 0)
45
g_error("Error: unable to access this file: '%s'\n", s);
49
*pixmap = gdk_pixmap_create_from_xpm (parent->window, mask,
50
&style->bg[GTK_STATE_NORMAL], s);
53
fprintf(stderr, "Error: unable to load this file into a pixmap: '%s'\n", s);