enter in entry fields; modal windows
- From: Michael Hartmann <michael hartmann as-netz de>
 
- To: gtk-perl-list gnome org
 
- Subject: enter in entry fields; modal windows
 
- Date: Sat, 7 Oct 2006 19:46:03 +0200
 
Hi everybody,
I'm using this code to run code when someone presses enter in a entry widget:
      $entry->signal_connect("key_press_event" => sub {
        use Gtk2::Gdk::Keysyms;
        my $key = {reverse %Gtk2::Gdk::Keysyms}->{$_[1]->keyval};
        if($key =~ m/^(KP_Enter)|(Return)$/) {
          $button->clicked;
        }
      } );
In the documentation I've found activates_default:
âactivates-defaultâ (boolean : readable / writable / private)
           Whether to activate the default widget (such as the default button     
           in a dialog) when Enter is pressed
However, I don't understand how to use it. How can I define the button that is 
activated?
I know there is more than one way to do it, but in this partitcular case: Is 
there a more elegant way to do it?
Another problem: I have two windows and one window is modal. How can I prevent 
that the window that is not modal gets the focus. At the moment all widgets 
are not sensitive, but the window can still get the focus.
Thank you.
--Michael
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]