File: fonts.c

package info (click to toggle)
cpanel 0.3.1-2.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 796 kB
  • ctags: 240
  • sloc: ansic: 2,538; makefile: 136; perl: 68
file content (51 lines) | stat: -rw-r--r-- 1,625 bytes parent folder | download
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
/*****************************************************************
 *
 *   fonts.c
 *
 *     Copyright (c) 2000  Kam Tik <kamtik@hongkong.com>
 *
 *	http://debian.kamtik.net
 *
 *     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, USA.
 *
 ******************************************************************/

#include "cpanel.h"

gchar *font_name = NULL;
GtkFontSelectionDialog *fontsel;

void pass_fonts(GtkWidget *button, GtkWidget *entry)
{
	font_name = gtk_font_selection_dialog_get_font_name(fontsel);
	gtk_entry_set_text(GTK_ENTRY(entry),font_name);
	gtk_widget_destroy(GTK_WIDGET(fontsel));
}

void getFonts(GtkWidget *entry)
{
	GtkWidget *dialog;
	
	font_name = NULL;

	dialog = gtk_font_selection_dialog_new(_("Font Selector"));
	fontsel = GTK_FONT_SELECTION_DIALOG(dialog);

	gtk_signal_connect(GTK_OBJECT(fontsel->ok_button),"clicked",
			GTK_SIGNAL_FUNC(pass_fonts), entry);
	gtk_signal_connect_object(GTK_OBJECT(fontsel->cancel_button),"clicked",
		GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(fontsel));
	gtk_signal_connect_object(GTK_OBJECT(fontsel),"destroy",
		GTK_SIGNAL_FUNC(gtk_widget_destroy),GTK_OBJECT(fontsel));

	gtk_grab_add(dialog);
	gtk_widget_show(dialog);
	gtk_main();
}