f



Entry widget does not work in some scenarios with latest Perl

Hi,
     Happy New Year to all. I am in some very frustrating problem.
I am developing an application where i work on a Linux platform with Perl 5.18.1 and Tk 804.031. The problem is that my Entry widget does not accept any input.

Basically if i type anything the cursor just stays in the Entry box, but does not move. Same with the TextBox. No keyboard input.

I tried to switch to Perl 5.8.8, there the scenario got modified to :
If i have just 1 Entry box, it accepts the keyboard input, but if i pack more than 1 Entry Box, only the last one accepts input.

While i tried to debug my problem at my personal laptop(Ubuntu with the same Perl/Tk versions), everything works fine.

I am totally lost as to what could be the problem.

Any help would be really helpful...

What all i tried:
1. To explicitly put focus on each of entry boxes. 
2. Put entry widgets in separate frames in the main window.

Thanks
RJ 
0
reni
1/11/2014 7:04:05 AM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

9 Replies
574 Views

Similar Articles

[PageSpeed] 20

In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> 
> Hi,
>      Happy New Year to all. I am in some very frustrating problem.
> I am developing an application where i work on a Linux platform with Perl 5.18.1 and Tk 804.031. The problem is that my Entry widget does not accept any input.
> 
> Basically if i type anything the cursor just stays in the Entry box, but does not move. Same with the TextBox. No keyboard input.
> 
> I tried to switch to Perl 5.8.8, there the scenario got modified to :
> If i have just 1 Entry box, it accepts the keyboard input, but if i pack more than 1 Entry Box, only the last one accepts input.
> 
> While i tried to debug my problem at my personal laptop(Ubuntu with the same Perl/Tk versions), everything works fine.
> 
> I am totally lost as to what could be the problem.
> 
> Any help would be really helpful...
> 
> What all i tried:
> 1. To explicitly put focus on each of entry boxes. 
> 2. Put entry widgets in separate frames in the main window.
> 
> Thanks
> RJ 

Could we see a small, self-contained program that demonstrates this?
0
Marc
1/11/2014 7:51:22 AM
On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> 
> > 
> 
> > Hi,
> 
> >      Happy New Year to all. I am in some very frustrating problem.
> 
> > I am developing an application where i work on a Linux platform with Perl 5.18.1 and Tk 804.031. The problem is that my Entry widget does not accept any input.
> 
> > 
> 
> > Basically if i type anything the cursor just stays in the Entry box, but does not move. Same with the TextBox. No keyboard input.
> 
> > 
> 
> > I tried to switch to Perl 5.8.8, there the scenario got modified to :
> 
> > If i have just 1 Entry box, it accepts the keyboard input, but if i pack more than 1 Entry Box, only the last one accepts input.
> 
> > 
> 
> > While i tried to debug my problem at my personal laptop(Ubuntu with the same Perl/Tk versions), everything works fine.
> 
> > 
> 
> > I am totally lost as to what could be the problem.
> 
> > 
> 
> > Any help would be really helpful...
> 
> > 
> 
> > What all i tried:
> 
> > 1. To explicitly put focus on each of entry boxes. 
> 
> > 2. Put entry widgets in separate frames in the main window.
> 
> > 
> 
> > Thanks
> 
> > RJ 
> 
> 
> 
> Could we see a small, self-contained program that demonstrates this?

Hi Marc,
           Here is very simple code  
--------------------------------
use Tk;
use strict;

my $mw = MainWindow->new;
$mw->title("Entry Bug");
my $f = $mw->Frame->pack(-side => 'bottom');
$f->Entry->pack;
$f->Entry->pack;

MainLoop;
---------------------------------

When i use Perl 5.18.1 with Tk 804.031, 
both the entry widgets do not take the input
but in Perl 5.8.8,the last entry widget takes the input, rest don't.

As i said earlier, same problem true if i replace Entry with Text widget.

But in my personal Ubuntu Box, everything works fine.

I suspect some nasty issue with some OS related stuff and not something
specific with a widget.

Any help or pointers will be really helpful..

RJ

0
reni
1/11/2014 9:05:29 AM
reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
>> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> [...]
> use Tk;
> use strict;
> 
> my $mw = MainWindow->new;
> $mw->title("Entry Bug");
> my $f = $mw->Frame->pack(-side => 'bottom');
> $f->Entry->pack;
> $f->Entry->pack;
> 
> MainLoop;

You did notice, you have to give the entry the keyboard-focus first, i.
e. click into it?
Or use
  my $e1=$f->Entry->pack;
  my $e2=$f->Entry->pack;
  $e1->focus();
to type right away in the first entry (once the *window* has the focus,
of course).
Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).

Regards, Horst
-- 
<remove S P A M 2x from my email address to get the real one>
0
Horst
1/11/2014 11:25:07 AM
On Saturday, January 11, 2014 4:55:07 PM UTC+5:30, Horst-W. Radners wrote:
> reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
> 
> > On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> 
> >> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> 
> > [...]
> 
> > use Tk;
> 
> > use strict;
> 
> > 
> 
> > my $mw = MainWindow->new;
> 
> > $mw->title("Entry Bug");
> 
> > my $f = $mw->Frame->pack(-side => 'bottom');
> 
> > $f->Entry->pack;
> 
> > $f->Entry->pack;
> 
> > 
> 
> > MainLoop;
> 
> 
> 
> You did notice, you have to give the entry the keyboard-focus first, i.
> 
> e. click into it?
> 
> Or use
> 
>   my $e1=$f->Entry->pack;
> 
>   my $e2=$f->Entry->pack;
> 
>   $e1->focus();
> 
> to type right away in the first entry (once the *window* has the focus,
> 
> of course).
> 
> Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).
> 
> 
> 
> Regards, Horst
> 
> -- 
> 
> <remove S P A M 2x from my email address to get the real one>

Hi Horst,
          I obviously tried this. It does not work. No matter how much i click
the cursor just stays there, no amount of typing makes anything visible.
Thanks 
RJ
0
reni
1/11/2014 12:41:57 PM
In article <2c870dce-4c40-4d87-b104-d238abd34fe7@googlegroups.com>, reni.iitd@gmail.com says...
> 
> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> > In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> > > Hi,
> > 
> > >      Happy New Year to all. I am in some very frustrating problem.
> > 
> > > I am developing an application where i work on a Linux platform with Perl 5.18.1 and Tk 804.031.
> > > The problem is that my Entry widget does not accept any input. Basically if i type anything the
> > > cursor just stays in the Entry box, but does not move. Same with the TextBox. No keyboard input.
> > > 
> > > I tried to switch to Perl 5.8.8, there the scenario got modified to :
> > > If i have just 1 Entry box, it accepts the keyboard input, but if i pack more than 1 Entry Box,
> > > only the last one accepts input.
> > > 
> > > While i tried to debug my problem at my personal laptop(Ubuntu with the same Perl/Tk versions),
> > > everything works fine.
> > > 
> > > I am totally lost as to what could be the problem.
> > > 
> > > Any help would be really helpful...
> > > 
> > > What all i tried:
> > > 1. To explicitly put focus on each of entry boxes. 
> > > 2. Put entry widgets in separate frames in the main window.
> > > 
> > > Thanks
> > > RJ 
> > Could we see a small, self-contained program that demonstrates this?
> 
> Hi Marc,
>            Here is very simple code  
> --------------------------------
> use Tk;
> use strict;
> 
> my $mw = MainWindow->new;
> $mw->title("Entry Bug");
> my $f = $mw->Frame->pack(-side => 'bottom');
> $f->Entry->pack;
> $f->Entry->pack;
> 
> MainLoop;
> ---------------------------------
> 
> When i use Perl 5.18.1 with Tk 804.031, 
> both the entry widgets do not take the input
> but in Perl 5.8.8,the last entry widget takes the input, rest don't.

I'm using perl v5.10.0, Tk 804.028 on Windows 7 and of course it works.
I'm sure it's clear to you that this is some type of installation or
configuration issue, so the only suggestion I can make is to reinstall
Tk and/or perl. Best of luck.

> As i said earlier, same problem true if i replace Entry with Text widget.
> 
> But in my personal Ubuntu Box, everything works fine.
> 
> I suspect some nasty issue with some OS related stuff and not something
> specific with a widget.
> 
> Any help or pointers will be really helpful..
> 
> RJ


0
Marc
1/11/2014 8:18:57 PM
On 11/01/2014 5:41 AM, reni.iitd@gmail.com wrote:
> On Saturday, January 11, 2014 4:55:07 PM UTC+5:30, Horst-W. Radners wrote:
>> reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
>>
>>> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
>>
>>>> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
>>
>>> [...]
>>
>>> use Tk;
>>
>>> use strict;
>>
>>>
>>
>>> my $mw = MainWindow->new;
>>
>>> $mw->title("Entry Bug");
>>
>>> my $f = $mw->Frame->pack(-side => 'bottom');
>>
>>> $f->Entry->pack;
>>
>>> $f->Entry->pack;
>>
>>>
>>
>>> MainLoop;
>>
>>
>>
>> You did notice, you have to give the entry the keyboard-focus first, i.
>>
>> e. click into it?
>>
>> Or use
>>
>>    my $e1=$f->Entry->pack;
>>
>>    my $e2=$f->Entry->pack;
>>
>>    $e1->focus();
>>
>> to type right away in the first entry (once the *window* has the focus,
>>
>> of course).
>>
>> Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).
>>
>>
>>
>> Regards, Horst
>>
>> --
>>
>> <remove S P A M 2x from my email address to get the real one>
>
> Hi Horst,
>            I obviously tried this. It does not work. No matter how much i click
> the cursor just stays there, no amount of typing makes anything visible.
> Thanks
> RJ
>
This is just a guess, but what do you have set for your pointing device 
policy to be? If it is "Focus Follows Mouse" then you obviously have to 
also ensure that the mouse cursor is also over the widget.

Jack
0
Jack
1/12/2014 6:03:02 PM
On Sunday, January 12, 2014 11:33:02 PM UTC+5:30, Jack wrote:
> On 11/01/2014 5:41 AM, reni.iitd@gmail.com wrote:
> 
> > On Saturday, January 11, 2014 4:55:07 PM UTC+5:30, Horst-W. Radners wrote:
> 
> >> reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
> 
> >>
> 
> >>> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> 
> >>
> 
> >>>> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> 
> >>
> 
> >>> [...]
> 
> >>
> 
> >>> use Tk;
> 
> >>
> 
> >>> use strict;
> 
> >>
> 
> >>>
> 
> >>
> 
> >>> my $mw = MainWindow->new;
> 
> >>
> 
> >>> $mw->title("Entry Bug");
> 
> >>
> 
> >>> my $f = $mw->Frame->pack(-side => 'bottom');
> 
> >>
> 
> >>> $f->Entry->pack;
> 
> >>
> 
> >>> $f->Entry->pack;
> 
> >>
> 
> >>>
> 
> >>
> 
> >>> MainLoop;
> 
> >>
> 
> >>
> 
> >>
> 
> >> You did notice, you have to give the entry the keyboard-focus first, i.
> 
> >>
> 
> >> e. click into it?
> 
> >>
> 
> >> Or use
> 
> >>
> 
> >>    my $e1=$f->Entry->pack;
> 
> >>
> 
> >>    my $e2=$f->Entry->pack;
> 
> >>
> 
> >>    $e1->focus();
> 
> >>
> 
> >> to type right away in the first entry (once the *window* has the focus,
> 
> >>
> 
> >> of course).
> 
> >>
> 
> >> Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).
> 
> >>
> 
> >>
> 
> >>
> 
> >> Regards, Horst
> 
> >>
> 
> >> --
> 
> >>
> 
> >> <remove S P A M 2x from my email address to get the real one>
> 
> >
> 
> > Hi Horst,
> 
> >            I obviously tried this. It does not work. No matter how much i click
> 
> > the cursor just stays there, no amount of typing makes anything visible.
> 
> > Thanks
> 
> > RJ
> 
> >
> 
> This is just a guess, but what do you have set for your pointing device 
> 
> policy to be? If it is "Focus Follows Mouse" then you obviously have to 
> 
> also ensure that the mouse cursor is also over the widget.
> 
> 
> 
> Jack

Well, I have tried all these suspects.
I am suspecting anything to do with the OS, as things run fine on my personal Ubuntu machine.
0
reni
1/14/2014 5:55:28 AM
On Tuesday, January 14, 2014 11:25:28 AM UTC+5:30, reni...@gmail.com wrote:
> On Sunday, January 12, 2014 11:33:02 PM UTC+5:30, Jack wrote:
> 
> > On 11/01/2014 5:41 AM, reni.iitd@gmail.com wrote:
> 
> > 
> 
> > > On Saturday, January 11, 2014 4:55:07 PM UTC+5:30, Horst-W. Radners wrote:
> 
> > 
> 
> > >> reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>>> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> [...]
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> use Tk;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> use strict;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> my $mw = MainWindow->new;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> $mw->title("Entry Bug");
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> my $f = $mw->Frame->pack(-side => 'bottom');
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> $f->Entry->pack;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> $f->Entry->pack;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>> MainLoop;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> You did notice, you have to give the entry the keyboard-focus first, i.
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> e. click into it?
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> Or use
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>    my $e1=$f->Entry->pack;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>    my $e2=$f->Entry->pack;
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>    $e1->focus();
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> to type right away in the first entry (once the *window* has the focus,
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> of course).
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> Regards, Horst
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> --
> 
> > 
> 
> > >>
> 
> > 
> 
> > >> <remove S P A M 2x from my email address to get the real one>
> 
> > 
> 
> > >
> 
> > 
> 
> > > Hi Horst,
> 
> > 
> 
> > >            I obviously tried this. It does not work. No matter how much i click
> 
> > 
> 
> > > the cursor just stays there, no amount of typing makes anything visible.
> 
> > 
> 
> > > Thanks
> 
> > 
> 
> > > RJ
> 
> > 
> 
> > >
> 
> > 
> 
> > This is just a guess, but what do you have set for your pointing device 
> 
> > 
> 
> > policy to be? If it is "Focus Follows Mouse" then you obviously have to 
> 
> > 
> 
> > also ensure that the mouse cursor is also over the widget.
> 
> > 
> 
> > 
> 
> > 
> 
> > Jack
> 
> 
> 
> Well, I have tried all these suspects.
> 
> I am suspecting anything to do with the OS, as things run fine on my personal Ubuntu machine.

Problem resolved. Finally it boiled down to my XMODIFIERS env variable.

unsetenv XMODIFIERS did the job.
0
reni
1/14/2014 6:39:51 AM
On Tuesday, 14 January 2014 12:09:51 UTC+5:30, reni...@gmail.com  wrote:
> On Tuesday, January 14, 2014 11:25:28 AM UTC+5:30, reni...@gmail.com wrote:
> > On Sunday, January 12, 2014 11:33:02 PM UTC+5:30, Jack wrote:
> > 
> > > On 11/01/2014 5:41 AM, reni.iitd@gmail.com wrote:
> > 
> > > 
> > 
> > > > On Saturday, January 11, 2014 4:55:07 PM UTC+5:30, Horst-W. Radners wrote:
> > 
> > > 
> > 
> > > >> reni.iitd@gmail.com schrieb am 11.01.2014 10:05:
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> On Saturday, January 11, 2014 1:21:22 PM UTC+5:30, Marc Dashevsky wrote:
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>>> In article <7da8952d-b488-4902-b8de-f1ddae436201@googlegroups.com>, reni.iitd@gmail.com says...
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> [...]
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> use Tk;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> use strict;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> my $mw = MainWindow->new;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> $mw->title("Entry Bug");
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> my $f = $mw->Frame->pack(-side => 'bottom');
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> $f->Entry->pack;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> $f->Entry->pack;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>> MainLoop;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> You did notice, you have to give the entry the keyboard-focus first, i.
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> e. click into it?
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> Or use
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>    my $e1=$f->Entry->pack;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>    my $e2=$f->Entry->pack;
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>    $e1->focus();
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> to type right away in the first entry (once the *window* has the focus,
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> of course).
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> Your example works fine for me then (Linux, Perl v5.18.1, Tk v804.031).
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> Regards, Horst
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> --
> > 
> > > 
> > 
> > > >>
> > 
> > > 
> > 
> > > >> <remove S P A M 2x from my email address to get the real one>
> > 
> > > 
> > 
> > > >
> > 
> > > 
> > 
> > > > Hi Horst,
> > 
> > > 
> > 
> > > >            I obviously tried this. It does not work. No matter how much i click
> > 
> > > 
> > 
> > > > the cursor just stays there, no amount of typing makes anything visible.
> > 
> > > 
> > 
> > > > Thanks
> > 
> > > 
> > 
> > > > RJ
> > 
> > > 
> > 
> > > >
> > 
> > > 
> > 
> > > This is just a guess, but what do you have set for your pointing device 
> > 
> > > 
> > 
> > > policy to be? If it is "Focus Follows Mouse" then you obviously have to 
> > 
> > > 
> > 
> > > also ensure that the mouse cursor is also over the widget.
> > 
> > > 
> > 
> > > 
> > 
> > > 
> > 
> > > Jack
> > 
> > 
> > 
> > Well, I have tried all these suspects.
> > 
> > I am suspecting anything to do with the OS, as things run fine on my personal Ubuntu machine.
> 
> Problem resolved. Finally it boiled down to my XMODIFIERS env variable.
> 
> unsetenv XMODIFIERS did the job.

Reni, faced similar issue but it got resolved with the unsetenv solution. 
Thanks,
Sudhir
0
sudhirspatli
3/11/2015 9:05:24 AM
Reply: