Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 61086
Status: open
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: KWittrock [...] web.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problems with Radiobutton widgets
Date: Sun, 05 Sep 2010 18:58:43 +0200
To: bug-Tk [...] rt.cpan.org
From: "K. Wittrock" <KWittrock [...] web.de>
The attached program shows various problems with Radiobuttons. Under Linux: - The program initializes the Radiobutton labelled "Widget" as the active Radiobutton. However, the "Display" button is displayed as active. - When the mouse cursor is moved to the "Widget" button (no click), it is marked as active. The "Display" button remains displayed as active. At the same time the following error message comes up: Use of uninitialized value in subroutine entry at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Tk/Button.pm line 56. - When the mouse cursor is moved away from the "Widget" button, the same error comes up, with the line no. changed to 87. - When clicking on the "Cursor" or "Widget" button, the following error message comes up: Tk::Error: Cannot copy to HASH in entersub at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Tk.pm line 250. <Button-1> (command bound to event) - When closing the program window,the following error message comes up: Speicherzugriffsfehler (in English: memory access error). Software versions: Linux linux-hqz8 2.6.27.37-0.1-default #1 SMP 2009-10-15 14:56:58 +0200 x86_64 x86_64 x86_64 GNU/Linux (in other words: OpenSuse 11.1) perl, v5.10.0 built for x86_64-linux-thread-multi Perl/Tk 804.028. Under Windows: - Initially active Radiobutton: same as under Linux. - There is no problem when moving the mouse cursor across the "Widget" button. - Clicking on the "Cursor" or "Widget" button: same as under Linux. - When closing the program window, the following error message comes up: Perl Command Line Interpreter has encountered a problem and must be terminated ... Software versions: Windows XP with SP3. perl, v5.10.1 built for MSWin32-x86-multi-thread Perl/Tk 804.028. While playing around with the program under Linux, I also saw an error like "There is a memory leak ...". I think its of no use to try to reproduce this. The program is an extract of program Pop2 in Mastering Perl/Tk, chapter 12, section Popup Menus. The screenshot there shows that the initially active Radiobutton was correctly shown somewhere in the past. Running the original program (which has the same errors) shows that in fact the "Widget" button is active. Only the display is wrong. Kind regards Klaus

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

On 2010-09-05 12:59:30, KWittrock@web.de wrote: Show quoted text
> The attached program shows various problems with Radiobuttons. > > Under Linux: > > - The program initializes the Radiobutton labelled "Widget" as the > active Radiobutton. However, the "Display" button is displayed as > active. > > - When the mouse cursor is moved to the "Widget" button (no click), it > is marked as active. The "Display" button remains displayed as > active. At the same time the following error message comes up: > > Use of uninitialized value in subroutine entry at > /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread- > multi/Tk/Button.pm line 56. > > - When the mouse cursor is moved away from the "Widget" button, the > same error comes up, with the line no. changed to 87. > > - When clicking on the "Cursor" or "Widget" button, the following > error message comes up: > > Tk::Error: Cannot copy to HASH in entersub at > /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Tk.pm > line 250. > <Button-1> > (command bound to event) > > - When closing the program window,the following error message comes > up: > Speicherzugriffsfehler (in English: memory access error). > > Software versions: > Linux linux-hqz8 2.6.27.37-0.1-default #1 SMP 2009-10-15 14:56:58 > +0200 x86_64 x86_64 x86_64 GNU/Linux > (in other words: OpenSuse 11.1) > perl, v5.10.0 built for x86_64-linux-thread-multi > Perl/Tk 804.028. > > Under Windows: > > - Initially active Radiobutton: same as under Linux. > > - There is no problem when moving the mouse cursor across the "Widget" > button. > > - Clicking on the "Cursor" or "Widget" button: same as under Linux. > > - When closing the program window, the following error message comes > up: > > Perl Command Line Interpreter has encountered a problem and must be > terminated ... > > Software versions: > Windows XP with SP3. > perl, v5.10.1 built for MSWin32-x86-multi-thread > Perl/Tk 804.028. > > While playing around with the program under Linux, I also saw an error > like "There is a memory leak ...". I think its of no use to try to > reproduce this. > > The program is an extract of program Pop2 in Mastering Perl/Tk, > chapter 12, section Popup Menus. The screenshot there shows that > the initially active Radiobutton was correctly shown somewhere in > the past. Running the original program (which has the same errors) > shows that in fact the "Widget" button is active. Only the display > is wrong. > > Kind regards > > Klaus >
It seems that using complex values for the Radiobutton -value option does not work anymore (complex means: array refs, hash refs, probably all kind of refs). I have still a working Tk 800.024 on my machine, and in fact, with this old Tk the script seems to work. It does not work anymore with Tk 804.027. Regards, Slaven
Subject: Re: [rt.cpan.org #61086] Problems with Radiobutton widgets
Date: Tue, 28 Sep 2010 14:16:58 +0200
To: bug-Tk [...] rt.cpan.org
From: "K. Wittrock" <KWittrock [...] web.de>
Am 26.09.2010 22:23, schrieb Slaven_Rezic via RT: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61086> > > On 2010-09-05 12:59:30, KWittrock@web.de wrote:
>> The attached program shows various problems with Radiobuttons. >> >> [............] >> >> The program is an extract of program Pop2 in Mastering Perl/Tk, >> chapter 12, section Popup Menus. The screenshot there shows that >> the initially active Radiobutton was correctly shown somewhere in >> the past. Running the original program (which has the same errors) >> shows that in fact the "Widget" button is active. Only the display >> is wrong. >> >> Kind regards >> >> Klaus >>
> > It seems that using complex values for the Radiobutton -value option > does not work anymore (complex means: array refs, hash refs, probably > all kind of refs). I have still a working Tk 800.024 on my machine, and > in fact, with this old Tk the script seems to work. It does not work > anymore with Tk 804.027.
Slaven, you are right, Radiobuttons have a problem when references are used for the -value option. The attached program shows that an extra reference level is introduced in this case. It would be interesting to know why this change has been done. Maybe you can find a note on this in the history of the source? The only difference between references and other scalars that I know about is the fact, that hash keys that are references cannot be dereferenced any more. A quick and dirty but easy solution to this problem might be to simply document it. Unfortunately I am starting for holidays next weekend. So I cannot modify the pop2 program before end of October. This program has the further complication that only some of the Radiobuttons have references for the -value option. Klaus
Subject: Re: [rt.cpan.org #61086] Problems with Radiobutton widgets
Date: Tue, 09 Nov 2010 18:28:35 +0100
To: bug-Tk [...] rt.cpan.org
From: "K. Wittrock" <KWittrock [...] web.de>
Now I noticed that I forgot to include the demo script in my previous email. I apologize for this. I send the missing script together with this email. In this script I simplified the problem somewhat by using a ref. to a string instead of a ref. to a widget. The default value of $text_curr_ref (set by direct assignment) behaves ok, while the value of $text_curr_ref set by a Radiobutton has an extra ref. level. I have found 2 workarounds for the pop2 program in Mastering Perl/Tk: 1. Replace the 3 Radiobuttons by pushbuttons, plus add a means to indicate which option is currently active (e. g. button colors or a Label widget). 2. Replace the 3 Radiobuttons by an Optionmenu. I tested the workarounds under Windows XP, ActivePerl v5.10.1, Tk 804.028. Klaus

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