Gtk2::Ex::SearchBox - A simple widget for specifying a search pattern (or a list of


Gtk2-Ex-SearchBox documentation  | view source Contained in the Gtk2-Ex-SearchBox distribution.

Index


NAME

Top

Gtk2::Ex::SearchBox - A simple widget for specifying a search pattern (or a list of search patterns).

DESCRIPTION

Top

A simple widget for specifying a search pattern (or a list of search patterns).

SYNOPSIS

Top

	my $searchbox = Gtk2::Ex::SearchBox->new;
	$window->add($searchbox->{widget});

METHODS

Top

new;

The constructor.

	my $searchbox = Gtk2::Ex::SearchBox->new;

If you want to allow only one pattern at a time, then you can call the constructor with 'single' as an argument.

	my $searchbox = Gtk2::Ex::SearchBox->new('single');

By default, the dropdown combobox contains the following choices.

	[
		'contains',
		'doesn\'t contain',
		'not equal to',
		'equals',
	]

But if you want to specify your own set, then you can call the constructor with two arguments.

	my $operatorlist = [
		'starts with',
		'ends with',
		'has in the middle'
	];
	my $searchbox = Gtk2::Ex::SearchBox->new('multiple', $operatorlist);

If you do not want even that combobox to the left, then send undef as the operatorlist.

	my $searchbox = Gtk2::Ex::SearchBox->new('single', undef);

Now this is just an $enty with an $ok_button !!

set_model($model);

Sets the $model. For example,

	$model = [
		{'operator' => 'contains', 'field' => 'this pattern'},
		{'operator' => 'equals', 'field' => 'that exact pattern'},
	]

get_model;

Returns the $model

For example,

	$model = [
		{'operator' => 'contains', 'field' => 'this pattern'},
		{'operator' => 'equals', 'field' => 'that exact pattern'},
	]

attach_popup_to($parent);

This method returns a Gtk2::Ex::PopupWindow. The popup window will contain a Gtk2::Ex::SearchBox widget.

to_sql_condition($datefieldname, $model);

Converts the $model into an SQL condition so that it can be used directly in and SQL statement. $fieldname is the fieldname that will be used inside the SQL condition.

signal_connect($signal, $callback);

See the SIGNALS section to see the supported signals.

SIGNALS

Top

changed;

closed;

SEE ALSO

Top

Gtk2::Ex::PopupWindow

COPYRIGHT & LICENSE

Top


Gtk2-Ex-SearchBox documentation  | view source Contained in the Gtk2-Ex-SearchBox distribution.