Name : perl-Gtk2-Ex-Entry-Pango
| |
Version : 0.10
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.6.1
| Date : 2023-01-27 17:18:16
|
Group : Development/Libraries/Perl
| Source RPM : perl-Gtk2-Ex-Entry-Pango-0.10-lp154.6.1.src.rpm
|
Size : 0.03 MB
| |
Packager : https://www_suse_com/
| |
Summary : Gtk2 Entry that accepts Pango markup.
|
Description :
\'Gtk2::Ex::Entry::Pango\' is a \'Gtk2::Entry\' that can accept Pango markup for various purposes (for more information about Pango text markup language see the http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html manpage).
The widget allows Pango markup to be used for input as an alternative to \'set_text\' or for setting a default value when the widget is empty. The default value when empty is ideal for standalone text entries that have no accompanying label (such as a text field for a search).
This widget allows for the text data to be entered either through the normal methods provided by \'Gtk2::Entry\' or to use the method the /set_markup manpage. It\'s possible to switch between two methods for applying the text. The standard \'Gtk2::Entry\' methods will always apply a text without styles while \'set_markup()\' will use a style.
The widget \'Gtk2::Ex::Entry::Pango\' keeps track of which style to apply by listening to the signal _changed_. This has some important consequences. If an instance needs to provide it\'s own _changed_ listener that calls \'set_markup()\' then the signal _changed_ has to be stopped otherwise the layout will be lost. The following code snippet show how to stop the emission of the _changed_ signal:
my $entry = Gtk2::Ex::Entry::Pango->new(); $entry->signal_connect(changed => sub {
my $text = $entry->get_text; if (validate($text)) { return; }
my $escaped = Glib::Markup::escape_text($text); $entry->set_markup(\"< span underline=\'error\' underline_color=\'red\'>$escaped< /span>\"); $entry->signal_stop_emission_by_name(\'changed\'); });
Another important thing to note is that \'Gtk2::Entry::set_text()\' will not update it\'s content if the input text is the same as the text already stored. This means that if set text is called with the same string it will not emit the signal _changed_ and the widget will not pickup that the markup styles have to be dropped. This is true even it the string displayed uses markup, as long as the contents are the same \'set_text()\' will not make an update. The method the /clear_markup manpage can be used for safely clearing the markup text.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-G/15.4/noarch |