math-image
view release on metacpan or search on metacpan
devel/entry-text-index.pl view on Meta::CPAN
my ($entry, $event) = @_;
$update_label->($entry,$event->x);
});
$entry->signal_connect
('notify::text' => sub {
my ($entry) = @_;
my ($x, $y) = $entry->get_pointer;
$update_label->($entry,$x);
});
}
{
my $combo = Gtk2::Ex::ComboBox::Enum->new
(enum_type => 'Gtk2::TextDirection');
Glib::Ex::ConnectProperties->new
([$entry, 'widget#direction'],
[$combo, 'active-nick']);
$vbox->pack_start ($combo, 0, 0, 0);
$entry->signal_connect
('direction-changed' => sub {
my ($entry) = @_;
print "entry direction: ",$entry->get_direction,"\n";
});
}
{
my $pname = 'xalign';
my $pspec = $entry->find_property ($pname);
my $adj = Gtk2::Adjustment->new (0,
$pspec->get_minimum,
$pspec->get_maximum,
.05, # step
.5, # page
0);
### min: $pspec->get_minimum
### max: $pspec->get_maximum
my $hbox = Gtk2::HBox->new;
$vbox->pack_start ($hbox, 0,0,0);
$hbox->pack_start (Gtk2::Label->new($pname), 0,0,0);
my $spin = Gtk2::SpinButton->new ($adj,
.05, # climb
2); # digits
$hbox->pack_start ($spin, 1,1,0);
Glib::Ex::ConnectProperties->new ([$entry,$pname],
[$spin,'value']);
}
# {
# my $button = Gtk2::CheckButton->new_with_label ('Toolitem Sensitive');
# require Glib::Ex::ConnectProperties;
# Glib::Ex::ConnectProperties->new
# ([$toolitem, 'sensitive'],
# [$button, 'active']);
# $button->show;
# $vbox->pack_start ($button, 0, 0, 0);
# }
# {
# my $button = Gtk2::CheckButton->new_with_label ('Child Sensitive');
# Glib::Ex::ConnectProperties->new
# ([$combobox, 'sensitive'],
# [$button, 'active']);
# $button->show;
# $vbox->pack_start ($button, 0, 0, 0);
# }
$entry->set_text ("ab123cd");
$toplevel->show_all;
Gtk2->main;
exit 0;
( run in 3.838 seconds using v1.01-cache-2.11-cpan-2398b32b56e )