tall_man has asked for the wisdom of the Perl Monks concerning the following question:

Dear Wise Monks,

I am using the perlplusplugin for a project where a perl/Tk main window needs to be embedded in a netscape application.

Version info:
Linux xxx.yyy.com 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001 i686 unknown
This is perl, v5.6.1 built for i386-linux
/usr/local/netscape6.23/run-mozilla.sh /usr/local/netscape6.23/mozilla-bin -v

In order to embed a window in a running Netscape window, I use code like this:

my $mw; my $top = $Plugin::brinfo{xwindow_id}; if ($^O !~ /Win/ && defined($top)) { $mw = MainWindow->new( -use => $top); } else { $mw = MainWindow->new(); $top = undef; }
My problem is that perl/Tk Entry and Text widgets in the embedded window will not get the focus when I click on them. All other sorts of widgets (list boxes and buttons for example) seem to work correctly.

The only way I have been able to work around this: if I drag some other window (which need not be a perl/Tk one) around on top of the netscape window and cause it to lose focus, then the next Entry widget the mouse moves over will usually get the focus.

Does anyone have any suggestions on what could be going wrong and how to handle it? Thanks for your help.

Replies are listed 'Best First'.
Re: Perl/Tk in a plugin: Edits won't take focus
by tall_man (Parson) on Feb 12, 2003 at 05:13 UTC
    As a follow-up, I should mention that sometimes when I try to type into an entry, the keystrokes show up in the Netscape search entry field, which suggests to me that Netscape is grabbing the focus away from my window that is embedded on its page.