File: GtkFileChooserDialog.xs

package info (click to toggle)
libgtk2-perl 2%3A1.2499-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,668 kB
  • ctags: 594
  • sloc: perl: 22,100; ansic: 122; makefile: 17
file content (67 lines) | stat: -rw-r--r-- 2,104 bytes parent folder | download | duplicates (6)
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
59
60
61
62
63
64
65
66
67
/*
 * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

MODULE = Gtk2::FileChooserDialog PACKAGE = Gtk2::FileChooserDialog PREFIX = gtk_file_chooser_dialog_

BOOT:
	/* GtkFileChooserDialog implements the GtkFileChooserIface */
	gperl_prepend_isa ("Gtk2::FileChooserDialog", "Gtk2::FileChooser");

=for apidoc Gtk2::FileChooserDialog::new_with_backend
=for signature widget = Gtk2::FileChooserDialog->new_with_backend ($title, $parent, $action, $backend, ...)
=for arg backend (gchar*)
=for arg ... (list) list of button-text => response-id pairs
=cut

=for apidoc Gtk2::FileChooserDialog::new
=for arg ... list of button-text => response-id pairs
=cut

GtkWidget *
gtk_file_chooser_dialog_new (class, gchar *title, GtkWindow_ornull *parent, GtkFileChooserAction action, ...)
    ALIAS:
	Gtk2::FileChooserDialog::new_with_backend = 1
    PREINIT:
	gint i, first_index;
	gchar *backend;
    CODE:
	if (ix == 1) {
		first_index = 5;
		backend = SvGChar (ST (4));
	} else {
		first_index = 4;
		backend = NULL;
	}

	if (0 != (items - first_index) % 2) {
		if (ix == 1)
			croak ("Usage: Gtk2::FileChooserDialog->new_with_backend (title, parent, action, backend, button-text => response-id, ...)\n"
			       "   expecting list of button-text => response-id pairs");
		else
			croak ("Usage: Gtk2::FileChooserDialog->new (title, parent, action, button-text => response-id, ...)\n"
			       "   expecting list of button-text => response-id pairs");
	}

	RETVAL = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG,
	                       "title", title,
	                       "action", action,
	                       "file-system-backend", backend,
	                       NULL);

	if (parent)
		gtk_window_set_transient_for (GTK_WINDOW (RETVAL), parent);

	for (i = first_index ; i < items ; i+=2) {
		gchar * button_text = SvGChar (ST (i));
		gint response_id = SvGtkResponseType (ST (i+1));
		gtk_dialog_add_button (GTK_DIALOG (RETVAL), button_text, response_id);
	}
    OUTPUT:
	RETVAL