Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information

Subject: Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 15:21:40 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
Hello, I experience a funny problem in Tk::BrowseEntry: The code: ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, -choices => \@posten, -state => 'readonly', -listheight => scalar (@posten))) -> pack; @posten is an array with 16 elements. If I select the last element in the dropdown list, it is not entered in the entry of BrowseEntry. All other choices are no problem. I can 'solve' this by either remove the listheight option (and getting a scrollbar) or making the listheight one more than the number of elements in @posten. In the last case, an empty line appears at the bottom of the dropdown list and clicking on this line selects the last element in @posten, the same as clicking on the last element itself. Environment: OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 perl-tk/bionic,now 1:804.033-2build1 amd64 Is this a bug or a problem with my code?
On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote: Show quoted text
> Hello, > > I experience a funny problem in Tk::BrowseEntry: > The code: > ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, > -choices => \@posten, -state => 'readonly', -listheight => scalar > (@posten))) -> pack; > > @posten is an array with 16 elements. If I select the last element in > the dropdown list, it is not entered in the entry of BrowseEntry. All > other choices are no problem. I can 'solve' this by either remove the > listheight option (and getting a scrollbar) or making the listheight one > more than the number of elements in @posten. In the last case, an empty > line appears at the bottom of the dropdown list and clicking on this > line selects the last element in @posten, the same as clicking on the > last element itself. > > Environment: > OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 > perl-tk/bionic,now 1:804.033-2build1 amd64 > > Is this a bug or a problem with my code?
I tried the following complete script on a Debian/jessie system with Tk 804.035, clicked on "16" and it appears in the entry: #!/usr/bin/perl -w use strict; use Tk; my $mw = tkinit; my $w_post; my @posten = (1..16); (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, -choices => \@posten, -state => 'readonly', -listheight => scalar (@posten))) -> pack; MainLoop; __END__ So either something happened between 804.033 and 804.035 (but I don't see anything relevant in the Changes file), or your X11 setup is different from mine (but I doubt that it matters) or your values are different and cause somehow the different behaviour. Can you check with the latest Perl/Tk first? Regards, Slaven
Subject: Re: [rt.cpan.org #133246] Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 17:18:41 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
On 29-08-2020 17:03, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
>> Hello, >> >> I experience a funny problem in Tk::BrowseEntry: >> The code: >> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, >> -choices => \@posten, -state => 'readonly', -listheight => scalar >> (@posten))) -> pack; >> >> @posten is an array with 16 elements. If I select the last element in >> the dropdown list, it is not entered in the entry of BrowseEntry. All >> other choices are no problem. I can 'solve' this by either remove the >> listheight option (and getting a scrollbar) or making the listheight one >> more than the number of elements in @posten. In the last case, an empty >> line appears at the bottom of the dropdown list and clicking on this >> line selects the last element in @posten, the same as clicking on the >> last element itself. >> >> Environment: >> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 >> perl-tk/bionic,now 1:804.033-2build1 amd64 >> >> Is this a bug or a problem with my code?
> > I tried the following complete script on a Debian/jessie system with Tk 804.035, clicked on "16" and it appears in the entry: > > #!/usr/bin/perl -w > use strict; > use Tk; > my $mw = tkinit; > my $w_post; > my @posten = (1..16); > (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, > -choices => \@posten, -state => 'readonly', -listheight => scalar > (@posten))) -> pack; > MainLoop; > __END__ > > So either something happened between 804.033 and 804.035 (but I don't see anything relevant in the Changes file), or your X11 setup is different from mine (but I doubt that it matters) or your values are different and cause somehow the different behaviour. > > Can you check with the latest Perl/Tk first? > > Regards, > Slaven >
I continued testing this problem. It appears to be triggered in another part of my code (the script in question has about 2000 lines). Thanks for your prompt response, but please wait until I located the culprit. I am converting this script (among others) from Tkx to Tk so I can get rid of ActivePerl...
Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #133246] Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 18:14:56 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
On 29-08-2020 17:03, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
>> Hello, >> >> I experience a funny problem in Tk::BrowseEntry: >> The code: >> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, >> -choices => \@posten, -state => 'readonly', -listheight => scalar >> (@posten))) -> pack; >> >> @posten is an array with 16 elements. If I select the last element in >> the dropdown list, it is not entered in the entry of BrowseEntry. All >> other choices are no problem. I can 'solve' this by either remove the >> listheight option (and getting a scrollbar) or making the listheight one >> more than the number of elements in @posten. In the last case, an empty >> line appears at the bottom of the dropdown list and clicking on this >> line selects the last element in @posten, the same as clicking on the >> last element itself. >> >> Environment: >> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 >> perl-tk/bionic,now 1:804.033-2build1 amd64 >> >> Is this a bug or a problem with my code?
> > I tried the following complete script on a Debian/jessie system with Tk 804.035, clicked on "16" and it appears in the entry: > > #!/usr/bin/perl -w > use strict; > use Tk; > my $mw = tkinit; > my $w_post; > my @posten = (1..16); > (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => 1, > -choices => \@posten, -state => 'readonly', -listheight => scalar > (@posten))) -> pack; > MainLoop; > __END__ > > So either something happened between 804.033 and 804.035 (but I don't see anything relevant in the Changes file), or your X11 setup is different from mine (but I doubt that it matters) or your values are different and cause somehow the different behaviour. > > Can you check with the latest Perl/Tk first? > > Regards, > Slaven >
OK. I removed too much code in my original report. Attached code which is as reduced as I can easily make it. Observations: If I remove the Tk::CmdLine statements, no problem is obvious. If I remove some Label definitions, the problem is also not visible. Could it be a mismatch between screen coordinates and the entry position? With kind regards, Jaap Berkhout

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.

On 2020-08-29 12:16:00, j.j.berkhout@staalenberk.nl wrote: Show quoted text
> > > On 29-08-2020 17:03, Slaven_Rezic via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > > > On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
> >> Hello, > >> > >> I experience a funny problem in Tk::BrowseEntry: > >> The code: > >> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => > >> 1, > >> -choices => \@posten, -state => 'readonly', -listheight => scalar > >> (@posten))) -> pack; > >> > >> @posten is an array with 16 elements. If I select the last element > >> in > >> the dropdown list, it is not entered in the entry of BrowseEntry. > >> All > >> other choices are no problem. I can 'solve' this by either remove > >> the > >> listheight option (and getting a scrollbar) or making the listheight > >> one > >> more than the number of elements in @posten. In the last case, an > >> empty > >> line appears at the bottom of the dropdown list and clicking on this > >> line selects the last element in @posten, the same as clicking on > >> the > >> last element itself. > >> > >> Environment: > >> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 > >> perl-tk/bionic,now 1:804.033-2build1 amd64 > >> > >> Is this a bug or a problem with my code?
> > > > I tried the following complete script on a Debian/jessie system with > > Tk 804.035, clicked on "16" and it appears in the entry: > > > > #!/usr/bin/perl -w > > use strict; > > use Tk; > > my $mw = tkinit; > > my $w_post; > > my @posten = (1..16); > > (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth > > => 1, > > -choices => \@posten, -state => 'readonly', -listheight => scalar > > (@posten))) -> pack; > > MainLoop; > > __END__ > > > > So either something happened between 804.033 and 804.035 (but I don't > > see anything relevant in the Changes file), or your X11 setup is > > different from mine (but I doubt that it matters) or your values are > > different and cause somehow the different behaviour. > > > > Can you check with the latest Perl/Tk first? > > > > Regards, > > Slaven > >
> OK. > I removed too much code in my original report. > Attached code which is as reduced as I can easily make it. > Observations: > If I remove the Tk::CmdLine statements, no problem is obvious. > If I remove some Label definitions, the problem is also not visible. > Could it be a mismatch between screen coordinates and the entry > position?
I still don't see a problem with the attached script, even if I enable the commented out Tk::CmdLine lines. On a Debian system there's probably no "Ubuntu" font available. But I tried the script also on a Xubuntu 20.04 system, still without problems: clicking on the "16" value puts the value into the entry. Regards, Slaven
Subject: Re: [rt.cpan.org #133246] Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 19:15:02 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
On 29-08-2020 18:30, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > On 2020-08-29 12:16:00, j.j.berkhout@staalenberk.nl wrote:
>> >> >> On 29-08-2020 17:03, Slaven_Rezic via RT wrote:
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > >>> >>> On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
>>>> Hello, >>>> >>>> I experience a funny problem in Tk::BrowseEntry: >>>> The code: >>>> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth => >>>> 1, >>>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>>> (@posten))) -> pack; >>>> >>>> @posten is an array with 16 elements. If I select the last element >>>> in >>>> the dropdown list, it is not entered in the entry of BrowseEntry. >>>> All >>>> other choices are no problem. I can 'solve' this by either remove >>>> the >>>> listheight option (and getting a scrollbar) or making the listheight >>>> one >>>> more than the number of elements in @posten. In the last case, an >>>> empty >>>> line appears at the bottom of the dropdown list and clicking on this >>>> line selects the last element in @posten, the same as clicking on >>>> the >>>> last element itself. >>>> >>>> Environment: >>>> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 >>>> perl-tk/bionic,now 1:804.033-2build1 amd64 >>>> >>>> Is this a bug or a problem with my code?
>>> >>> I tried the following complete script on a Debian/jessie system with >>> Tk 804.035, clicked on "16" and it appears in the entry: >>> >>> #!/usr/bin/perl -w >>> use strict; >>> use Tk; >>> my $mw = tkinit; >>> my $w_post; >>> my @posten = (1..16); >>> (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth >>> => 1, >>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>> (@posten))) -> pack; >>> MainLoop; >>> __END__ >>> >>> So either something happened between 804.033 and 804.035 (but I don't >>> see anything relevant in the Changes file), or your X11 setup is >>> different from mine (but I doubt that it matters) or your values are >>> different and cause somehow the different behaviour. >>> >>> Can you check with the latest Perl/Tk first? >>> >>> Regards, >>> Slaven >>>
>> OK. >> I removed too much code in my original report. >> Attached code which is as reduced as I can easily make it. >> Observations: >> If I remove the Tk::CmdLine statements, no problem is obvious. >> If I remove some Label definitions, the problem is also not visible. >> Could it be a mismatch between screen coordinates and the entry >> position?
> > I still don't see a problem with the attached script, even if I enable the commented out Tk::CmdLine lines. On a Debian system there's probably no "Ubuntu" font available. But I tried the script also on a Xubuntu 20.04 system, still without problems: clicking on the "16" value puts the value into the entry. > > Regards, > Slaven >
I changed the font to 'Liberation" (which I think is on Debian systems as well) with the same result. The reason for the *Label*Font is that without this the font used for labels is a rather small bold font.
Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.

On 2020-08-29 13:15:48, j.j.berkhout@staalenberk.nl wrote: Show quoted text
> > > On 29-08-2020 18:30, Slaven_Rezic via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > > > On 2020-08-29 12:16:00, j.j.berkhout@staalenberk.nl wrote:
> >> > >> > >> On 29-08-2020 17:03, Slaven_Rezic via RT wrote:
> >>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > >>> > >>> On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
> >>>> Hello, > >>>> > >>>> I experience a funny problem in Tk::BrowseEntry: > >>>> The code: > >>>> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth > >>>> => > >>>> 1, > >>>> -choices => \@posten, -state => 'readonly', -listheight => scalar > >>>> (@posten))) -> pack; > >>>> > >>>> @posten is an array with 16 elements. If I select the last > >>>> element > >>>> in > >>>> the dropdown list, it is not entered in the entry of BrowseEntry. > >>>> All > >>>> other choices are no problem. I can 'solve' this by either remove > >>>> the > >>>> listheight option (and getting a scrollbar) or making the > >>>> listheight > >>>> one > >>>> more than the number of elements in @posten. In the last case, an > >>>> empty > >>>> line appears at the bottom of the dropdown list and clicking on > >>>> this > >>>> line selects the last element in @posten, the same as clicking on > >>>> the > >>>> last element itself. > >>>> > >>>> Environment: > >>>> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 > >>>> perl-tk/bionic,now 1:804.033-2build1 amd64 > >>>> > >>>> Is this a bug or a problem with my code?
> >>> > >>> I tried the following complete script on a Debian/jessie system > >>> with > >>> Tk 804.035, clicked on "16" and it appears in the entry: > >>> > >>> #!/usr/bin/perl -w > >>> use strict; > >>> use Tk; > >>> my $mw = tkinit; > >>> my $w_post; > >>> my @posten = (1..16); > >>> (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth > >>> => 1, > >>> -choices => \@posten, -state => 'readonly', -listheight => scalar > >>> (@posten))) -> pack; > >>> MainLoop; > >>> __END__ > >>> > >>> So either something happened between 804.033 and 804.035 (but I > >>> don't > >>> see anything relevant in the Changes file), or your X11 setup is > >>> different from mine (but I doubt that it matters) or your values > >>> are > >>> different and cause somehow the different behaviour. > >>> > >>> Can you check with the latest Perl/Tk first? > >>> > >>> Regards, > >>> Slaven > >>>
> >> OK. > >> I removed too much code in my original report. > >> Attached code which is as reduced as I can easily make it. > >> Observations: > >> If I remove the Tk::CmdLine statements, no problem is obvious. > >> If I remove some Label definitions, the problem is also not visible. > >> Could it be a mismatch between screen coordinates and the entry > >> position?
> > > > I still don't see a problem with the attached script, even if I > > enable the commented out Tk::CmdLine lines. On a Debian system > > there's probably no "Ubuntu" font available. But I tried the script > > also on a Xubuntu 20.04 system, still without problems: clicking on > > the "16" value puts the value into the entry. > > > > Regards, > > Slaven > >
> > I changed the font to 'Liberation" (which I think is on Debian systems > as well) with the same result. The reason for the *Label*Font is that > without this the font used for labels is a rather small bold font.
According to fc-list I don't have "Liberation", but "Liberation Sans" (and other variants), so I tried Tk::CmdLine::SetArguments (-font => "{Liberation Sans}"); Tk::CmdLine::SetResources ('*Label*font: {Liberation Sans} 12 normal', 'widgetDefault'); but still "16" is selectable. Are you trying your script with Tk 804.035?
Subject: Re: [rt.cpan.org #133246] Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 19:57:07 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
On 29-08-2020 19:36, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > On 2020-08-29 13:15:48, j.j.berkhout@staalenberk.nl wrote:
>> >> >> On 29-08-2020 18:30, Slaven_Rezic via RT wrote:
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > >>> >>> On 2020-08-29 12:16:00, j.j.berkhout@staalenberk.nl wrote:
>>>> >>>> >>>> On 29-08-2020 17:03, Slaven_Rezic via RT wrote:
>>>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > >>>>> >>>>> On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
>>>>>> Hello, >>>>>> >>>>>> I experience a funny problem in Tk::BrowseEntry: >>>>>> The code: >>>>>> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth >>>>>> => >>>>>> 1, >>>>>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>>>>> (@posten))) -> pack; >>>>>> >>>>>> @posten is an array with 16 elements. If I select the last >>>>>> element >>>>>> in >>>>>> the dropdown list, it is not entered in the entry of BrowseEntry. >>>>>> All >>>>>> other choices are no problem. I can 'solve' this by either remove >>>>>> the >>>>>> listheight option (and getting a scrollbar) or making the >>>>>> listheight >>>>>> one >>>>>> more than the number of elements in @posten. In the last case, an >>>>>> empty >>>>>> line appears at the bottom of the dropdown list and clicking on >>>>>> this >>>>>> line selects the last element in @posten, the same as clicking on >>>>>> the >>>>>> last element itself. >>>>>> >>>>>> Environment: >>>>>> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 >>>>>> perl-tk/bionic,now 1:804.033-2build1 amd64 >>>>>> >>>>>> Is this a bug or a problem with my code?
>>>>> >>>>> I tried the following complete script on a Debian/jessie system >>>>> with >>>>> Tk 804.035, clicked on "16" and it appears in the entry: >>>>> >>>>> #!/usr/bin/perl -w >>>>> use strict; >>>>> use Tk; >>>>> my $mw = tkinit; >>>>> my $w_post; >>>>> my @posten = (1..16); >>>>> (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth >>>>> => 1, >>>>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>>>> (@posten))) -> pack; >>>>> MainLoop; >>>>> __END__ >>>>> >>>>> So either something happened between 804.033 and 804.035 (but I >>>>> don't >>>>> see anything relevant in the Changes file), or your X11 setup is >>>>> different from mine (but I doubt that it matters) or your values >>>>> are >>>>> different and cause somehow the different behaviour. >>>>> >>>>> Can you check with the latest Perl/Tk first? >>>>> >>>>> Regards, >>>>> Slaven >>>>>
>>>> OK. >>>> I removed too much code in my original report. >>>> Attached code which is as reduced as I can easily make it. >>>> Observations: >>>> If I remove the Tk::CmdLine statements, no problem is obvious. >>>> If I remove some Label definitions, the problem is also not visible. >>>> Could it be a mismatch between screen coordinates and the entry >>>> position?
>>> >>> I still don't see a problem with the attached script, even if I >>> enable the commented out Tk::CmdLine lines. On a Debian system >>> there's probably no "Ubuntu" font available. But I tried the script >>> also on a Xubuntu 20.04 system, still without problems: clicking on >>> the "16" value puts the value into the entry. >>> >>> Regards, >>> Slaven >>>
>> >> I changed the font to 'Liberation" (which I think is on Debian systems >> as well) with the same result. The reason for the *Label*Font is that >> without this the font used for labels is a rather small bold font.
> > According to fc-list I don't have "Liberation", but "Liberation Sans" (and other variants), so I tried > > Tk::CmdLine::SetArguments (-font => "{Liberation Sans}"); > Tk::CmdLine::SetResources ('*Label*font: {Liberation Sans} 12 normal', 'widgetDefault'); > > but still "16" is selectable. > > Are you trying your script with Tk 804.035? > >
No, my Tk version is 804.033, perl version is 5.26.1.
Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #133246] Problem selecting last entry in dropdown list
Date: Sat, 29 Aug 2020 20:13:21 +0200
To: bug-Tk [...] rt.cpan.org
From: "J.J. Berkhout" <j.j.berkhout [...] staalenberk.nl>
On 29-08-2020 19:36, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > > > On 2020-08-29 13:15:48, j.j.berkhout@staalenberk.nl wrote:
>> >> >> On 29-08-2020 18:30, Slaven_Rezic via RT wrote:
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > >>> >>> On 2020-08-29 12:16:00, j.j.berkhout@staalenberk.nl wrote:
>>>> >>>> >>>> On 29-08-2020 17:03, Slaven_Rezic via RT wrote:
>>>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133246 > >>>>> >>>>> On 2020-08-29 10:33:55, j.j.berkhout@staalenberk.nl wrote:
>>>>>> Hello, >>>>>> >>>>>> I experience a funny problem in Tk::BrowseEntry: >>>>>> The code: >>>>>> ($Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth >>>>>> => >>>>>> 1, >>>>>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>>>>> (@posten))) -> pack; >>>>>> >>>>>> @posten is an array with 16 elements. If I select the last >>>>>> element >>>>>> in >>>>>> the dropdown list, it is not entered in the entry of BrowseEntry. >>>>>> All >>>>>> other choices are no problem. I can 'solve' this by either remove >>>>>> the >>>>>> listheight option (and getting a scrollbar) or making the >>>>>> listheight >>>>>> one >>>>>> more than the number of elements in @posten. In the last case, an >>>>>> empty >>>>>> line appears at the bottom of the dropdown list and clicking on >>>>>> this >>>>>> line selects the last element in @posten, the same as clicking on >>>>>> the >>>>>> last element itself. >>>>>> >>>>>> Environment: >>>>>> OS: Linux Mint 19.3 Cinnamon, kernel 4.15.0-112 >>>>>> perl-tk/bionic,now 1:804.033-2build1 amd64 >>>>>> >>>>>> Is this a bug or a problem with my code?
>>>>> >>>>> I tried the following complete script on a Debian/jessie system >>>>> with >>>>> Tk 804.035, clicked on "16" and it appears in the entry: >>>>> >>>>> #!/usr/bin/perl -w >>>>> use strict; >>>>> use Tk; >>>>> my $mw = tkinit; >>>>> my $w_post; >>>>> my @posten = (1..16); >>>>> (my $Be = $mw -> BrowseEntry (-variable => \$w_post, -autolistwidth >>>>> => 1, >>>>> -choices => \@posten, -state => 'readonly', -listheight => scalar >>>>> (@posten))) -> pack; >>>>> MainLoop; >>>>> __END__ >>>>> >>>>> So either something happened between 804.033 and 804.035 (but I >>>>> don't >>>>> see anything relevant in the Changes file), or your X11 setup is >>>>> different from mine (but I doubt that it matters) or your values >>>>> are >>>>> different and cause somehow the different behaviour. >>>>> >>>>> Can you check with the latest Perl/Tk first? >>>>> >>>>> Regards, >>>>> Slaven >>>>>
>>>> OK. >>>> I removed too much code in my original report. >>>> Attached code which is as reduced as I can easily make it. >>>> Observations: >>>> If I remove the Tk::CmdLine statements, no problem is obvious. >>>> If I remove some Label definitions, the problem is also not visible. >>>> Could it be a mismatch between screen coordinates and the entry >>>> position?
>>> >>> I still don't see a problem with the attached script, even if I >>> enable the commented out Tk::CmdLine lines. On a Debian system >>> there's probably no "Ubuntu" font available. But I tried the script >>> also on a Xubuntu 20.04 system, still without problems: clicking on >>> the "16" value puts the value into the entry. >>> >>> Regards, >>> Slaven >>>
>> >> I changed the font to 'Liberation" (which I think is on Debian systems >> as well) with the same result. The reason for the *Label*Font is that >> without this the font used for labels is a rather small bold font.
> > According to fc-list I don't have "Liberation", but "Liberation Sans" (and other variants), so I tried > > Tk::CmdLine::SetArguments (-font => "{Liberation Sans}"); > Tk::CmdLine::SetResources ('*Label*font: {Liberation Sans} 12 normal', 'widgetDefault'); > > but still "16" is selectable. > > Are you trying your script with Tk 804.035? > >
Followup: The same script runs flawlessly with the same Tk version but perl 5.30.0 (on another machine (laptop) with Linux Mint Cinnamon 20, kernel 5.4.0-42. I have a workaround for now, and plan to upgrade my machines in the near future, so for now there is no need for further research, more so while it seems the error is not in Tk. Sorry to have bothered you and thanks for your effort. Have a nice weekend and stay healthy. With kind regards, Jaap.
Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.