File: GtkComboBoxEntry.xs

package info (click to toggle)
libgtk2-perl 2:1.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 (99 lines) | stat: -rw-r--r-- 2,774 bytes parent folder | download | duplicates (7)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * 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::ComboBoxEntry	PACKAGE = Gtk2::ComboBoxEntry	PREFIX = gtk_combo_box_entry_

=for object Gtk2::ComboBoxEntry - A text entry field with a dropdown list

=cut

=for position SYNOPSIS

=head1 SYNOPSIS

  # the easy way
  $combo_box_entry = Gtk2::ComboBoxEntry->new_text;
  foreach (qw(one two three four five)) {
      $combo_box_entry->append_text ($_);
  }

  # or the powerful way.  there always has to be at least
  # one text column in the model, but you can have anything
  # else in it that you want, just like Gtk2::ComboBox.
  $combo_box_entry = Gtk2::ComboBoxEntry->new ($model, $text_index);

  # to mess with with entry directly, get the child:
  $current_text = $combo_box_entry->child->get_text;

=cut

=for position DESCRIPTION

=head1 DESCRIPTION

A ComboBoxEntry is a widget that allows the user to choose from a list of valid
choices or enter a different value.  It is very similar to a ComboBox, but
displays the selected value in an entry to allow modifying it.

The ComboBoxEntry has a Gtk2::Entry as its child.  To get or set the
currently-displayed text, just manipulate the entry normally.

=cut

 ## GtkWidget *gtk_combo_box_entry_new (void);
 ## GtkWidget *gtk_combo_box_entry_new_with_model (GtkTreeModel *model, gint text_column);
=for apidoc new_with_model
=for signature $entry = Gtk2::ComboBoxEntry->new_with_model ($model, $text_column)
=for arg model (GtkTreeModel)
=for arg text_column (int)
=for arg ... (__hide__)
Alias for new, with two arguments.
=cut

=for apidoc
=for signature $entry = Gtk2::ComboBoxEntry->new
=for signature $entry = Gtk2::ComboBoxEntry->new ($model, $text_column)
=for arg model (GtkTreeModel)
=for arg text_column (int)
=for arg ... (__hide__)
=cut
GtkWidget *
gtk_combo_box_entry_new (class, ...)
    ALIAS:
	new_with_model = 1
    CODE:
	if (ix == 1 || items == 3) {
		RETVAL = gtk_combo_box_entry_new_with_model
					(SvGtkTreeModel (ST (1)), SvIV (ST (2)));
	} else if (ix == 0 && items == 1) {
		RETVAL = gtk_combo_box_entry_new ();
	} else {
		croak ("Usage: Gtk2::ComboBoxEntry->new ()\n"
		       "    OR\n"
		       "       Gtk2::ComboBoxEntry->new (model, text_column)\n"
		       "    OR\n"
		       "       Gtk2::ComboBoxEntry->new_with_model (model, text_column)\n"
		       "    wrong number of arguments");
	}
    OUTPUT:
	RETVAL

gint gtk_combo_box_entry_get_text_column (GtkComboBoxEntry *entry_box);

void gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box, gint text_column);

#if GTK_CHECK_VERSION (2, 4, 0)

GtkWidget *
gtk_combo_box_entry_new_text (class)
    C_ARGS:
	/* void */

#endif