diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-07-10 13:52:36 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-07-10 13:52:36 +0000 |
commit | 41cdef71c22e93b3b0f52400182271946987af15 (patch) | |
tree | e065d0a204d2eae5ca456ba489a2379b6951817e /perl-install | |
parent | 250dcb61b6210e1a20dcec6be089f98e9d257610 (diff) | |
download | drakx-41cdef71c22e93b3b0f52400182271946987af15.tar drakx-41cdef71c22e93b3b0f52400182271946987af15.tar.gz drakx-41cdef71c22e93b3b0f52400182271946987af15.tar.bz2 drakx-41cdef71c22e93b3b0f52400182271946987af15.tar.xz drakx-41cdef71c22e93b3b0f52400182271946987af15.zip |
- symbolic keys are back
- do not name "use once" variables
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/interactive/gtk.pm | 11 | ||||
-rw-r--r-- | perl-install/ugtk2.pm | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 67f5ca7bf..7248e735e 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -9,6 +9,7 @@ use vars qw(@ISA); use interactive; use common; use ugtk2 qw(:helpers :wrappers :create); +use Gtk2::Gdk::Keysyms; my $forgetTime = 1000; #- in milli-seconds @@ -83,13 +84,13 @@ sub create_treeview_list { my $timeout; $list_tv->signal_connect(key_press_event => sub { my ($_w, $event) = @_; - my $c = chr($event->keyval & 0xff); + my $c = chr($event->keyval & ); Glib::Source->remove($timeout) if $timeout; $timeout = ''; if ($event->keyval >= 0x100) { - &$may_go_to_next if member($event->keyval, (Gtk2::Gdk::Event::Key->Sym_Return, Gtk2::Gdk::Event::Key->Sym_KP_Enter)); - $starting_word = '' if !member($event->keyval, (Gtk2::Gdk::Event::Key->Sym_Control_L, Gtk2::Gdk::Event::Key->Sym_Control_R)); + &$may_go_to_next if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter})); + $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R})); } else { if (member('control-mask', @{$event->state})) { $c eq 's' or return 1; @@ -242,8 +243,8 @@ sub create_treeview_tree { Glib::Source->remove($timeout) if $timeout; $timeout = ''; if ($event->keyval >= 0x100) { - &$toggle if member($event->keyval, (0xFF0D, 0xFF8D)); # from gdk/gdkkeysyms.h - $starting_word = '' if !member($event->keyval, (0xFFE3, 0xFFE4)); # from gdk/gdkkeysyms.h + &$toggle if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter})); + $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R})); } else { my $next; if (member('control-mask', @{$event->state})) { diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 9221a1038..462b25c7f 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -35,6 +35,7 @@ use log; use common; use Gtk2; +use Gtk2::Gdk::Keysyms; unless ($::no_ugtk_init) { !check_for_xserver() and die "Cannot be run in console mode.\n"; @@ -542,7 +543,7 @@ sub gtktext_insert { if ($token->[1]) { my $tag = $buffer->create_tag(rand()); $tag->set(%{$token->[1]}); - $buffer->apply_tag($tag, $iter1 = $buffer->get_iter_at_offset($c), my $iter2 = $buffer->get_end_iter); + $buffer->apply_tag($tag, $iter1 = $buffer->get_iter_at_offset($c), $buffer->get_end_iter); } } } else { @@ -550,7 +551,7 @@ sub gtktext_insert { } #- the following line is needed to move the cursor to the beginning, so that if the #- textview has a scrollbar, it won't scroll to the bottom when focusing (#3633) - $buffer->place_cursor(my $iter = $buffer->get_start_iter); + $buffer->place_cursor($buffer->get_start_iter); $textview->set_wrap_mode($opts{wrap_mode} || 'word'); $textview->set_editable($opts{editable} || 0); $textview->set_cursor_visible($opts{visible} || 0); @@ -804,7 +805,7 @@ sub new { $::WizardWindow->set_uposition($::stepswidth + $::windowwidth * 0.04, $::logoheight + $::windowheight * ($::logoheight ? 0.12 : 0.05)); $::WizardWindow->signal_connect(key_press_event => sub { my (undef, $event) = @_; - my $d = ${{ 0xFFBF => 'screenshot' }}{$event->keyval}; # GDK_F2 from gdk/gdkkeysyms.h + my $d = ${{ $Gtk2::Gdk::Keysyms{F2} => 'screenshot' }}{$event->keyval}; if ($d eq 'screenshot') { common::take_screenshot(); } elsif (chr($event->keyval) eq 'e' && member('mod1-mask', @{$event->state})) { #- alt-e @@ -1243,7 +1244,7 @@ sub ask_browse_tree_info_given_widgets { my $children = sub { map { my $v = $w->{tree_model}->get($_, 0); $v } gtktreeview_children($w->{tree_model}, $_[0]) }; my $toggle = sub { if (ref($curr) && !$_[0]) { - $w->{tree}->toggle_expansion(my $path = $w->{tree_model}->get_path($curr)); + $w->{tree}->toggle_expansion($w->{tree_model}->get_path($curr)); } else { if (ref $curr) { my @_a = $children->($curr); |