NAME

Gtk2::Ex::DateSpinner::EntryWithCancel -- Gtk2::Entry with a cancelled property

SYNOPSIS

use Gtk2::Ex::DateSpinner::EntryWithCancel;
my $entry = Gtk2::Ex::DateSpinner::EntryWithCancel->new;

$entry->signal_connect ('editing-done',
                        sub {
                          if ($entry->get('editing-cancelled'))
                            ...
                        });

WIDGET HIERARCHY

Gtk2::Ex::DateSpinner::EntryWithCancel is a subclass of Gtk2::Entry.

Gtk2::Widget
  Gtk2::Entry
    Gtk2::Ex::DateSpinner::EntryWithCancel

And implements the interface

Gtk2::CellEditable

DESCRIPTION

Caution: This is internals of Gtk2::Ex::DateSpinner::CellRenderer. If it ends up with a use beyond that then it'll be split out and renamed.

EntryWithCancel extends Gtk2::Entry to have an "editing-cancelled" flag set when editing through the Gtk2::CellEditable interface. An an Escape key press or cancel action sets the flag.

Gtk2::Entry already has such a flag (mis-spelt editing_canceled) but doesn't make it publicly available. Is that right? At any rate this subclass gets the desired effect.

FUNCTIONS

$entry = Gtk2::Ex::DateSpinner::EntryWithCancel->new (key=>value,...)

Create and return a new EntryWithCancel object. Optional key/value pairs set initial properties as per Glib::Object->new. Eg.

my $entry = Gtk2::Ex::DateSpinner::EntryWithCancel->new
              (xalign => 0.5);
$entry->cancel ()

Emit the cancel action signal, thus performing that action (see "SIGNALS" below).

PROPERTIES

editing-cancelled (boolean, default false)

Cleared by start_editing (the Gtk2::CellEditable func) and then set to true or false under an Escape (keypress), cancel (below), or activate (Gtk2::Widget signal). editing-done handlers (the Gtk2::CellEditable signal) can then consult the value.

SIGNALS

cancel (action, no parameters)

Perform the cancel action, which is to set the editing-cancelled property, and if editing is active (from a start_editing) then emit editing-done and remove-widget.

The Escape key binding runs this signal.

SEE ALSO

Gtk2::Entry, Glib::Object

HOME PAGE

http://user42.tuxfamily.org/gtk2-ex-datespinner/index.html

LICENSE

Gtk2-Ex-DateSpinner is Copyright 2008, 2009 Kevin Ryde

Gtk2-Ex-DateSpinner is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Gtk2-Ex-DateSpinner 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 Gtk2-Ex-DateSpinner. If not, see http://www.gnu.org/licenses/.