math-image

 view release on metacpan or  search on metacpan

lib/App/MathImage/Gtk2/OeisEntry.pm  view on Meta::CPAN

# Copyright 2011, 2012, 2013 Kevin Ryde

# This file is part of Math-Image.
#
# Math-Image 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.
#
# Math-Image 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 Math-Image.  If not, see <http://www.gnu.org/licenses/>.


# go to no extension when combobox nothing selected ...


package App::MathImage::Gtk2::OeisEntry;
use 5.008;
use strict;
use warnings;
use Gtk2 1.220;  # for Gtk2::EVENT_PROPAGATE()
use POSIX ();
use Module::Load;
use List::Util 'max';
use Locale::TextDomain 1.19 ('App-MathImage');

use Glib::Ex::ObjectBits;
use App::MathImage::Gtk2::Ex::ArrowButton;

use Regexp::Common 'no_defaults';
use App::MathImage::Regexp::Common::OEIS;

# uncomment this to run the ### lines
#use Smart::Comments;

our $VERSION = 110;

Gtk2::Rc->parse_string (<<'HERE');
style "App__MathImage__Gtk2__OeisEntry_style" {
  xthickness = 0
  ythickness = 0
}
widget_class "*App__MathImage__Gtk2__OeisEntry*GtkAspectFrame" style:application "App__MathImage__Gtk2__OeisEntry_style"
HERE

use Glib::Object::Subclass
  'Gtk2::HBox',
  signals => {
              # size_request  => \&_do_size_request,
              # size_allocate => \&_do_size_allocate,
              activate => { param_types => [ ] },
              scroll => { param_types => [ 'Gtk2::ScrollType' ],
                          flags => ['run-first','action'],
                          class_closure => \&_do_scroll_action,
                        },
              # query-tooltip new in 2.12
              (Gtk2::Widget->signal_query('query_tooltip')
               ? (query_tooltip => \&_do_query_tooltip)
               : ()),
             },
  properties => [ Glib::ParamSpec->string
                  ('text',
                   __('A-number'),
                   'Blurb.',
                   'A000290',
                   Glib::G_PARAM_READWRITE),

                  Glib::ParamSpec->int
                  ('width-chars',
                   __('Width in characters'),
                   'Blurb.',
                   -1, POSIX::INT_MAX(),
                   -1,
                   Glib::G_PARAM_READWRITE),



( run in 1.906 second using v1.01-cache-2.11-cpan-59e3e3084b8 )