File: simple.c

package info (click to toggle)
libgnomeprintui 2.18.5-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,288 kB
  • ctags: 1,978
  • sloc: ansic: 14,824; sh: 12,444; makefile: 281; xml: 27
file content (31 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (5)
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
#include <gtk/gtk.h>
#include <libgnomeprint/gnome-print-config.h>
#include <libgnomeprintui/gnome-print-paper-selector.h>

int
main (int argc, char * argv[])
{
	GnomePrintConfig *config;
	GtkWidget *ps;
	GtkWidget *dialog;

	gtk_init (&argc, (char ***) &argv);

	config = gnome_print_config_default ();
	ps = gnome_paper_selector_new (config);
	dialog = gtk_dialog_new ();
	gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), ps);
	gtk_widget_show (ps);
	gtk_widget_show (dialog);

	gtk_timeout_add (2000, (GSourceFunc) gtk_main_quit, NULL);
	gtk_main ();

	if (!gnome_print_config_set (config, "Printer", "PDF"))
		g_assert_not_reached ();

	gtk_timeout_add (2000, (GSourceFunc) gtk_main_quit, NULL);
	gtk_main ();
	
	return 0;
}