Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Different behavior of Tk program in two versions of Perl

by vagabonding electron (Curate)
on Jul 02, 2018 at 09:33 UTC ( #1217724=note: print w/replies, xml ) Need Help??


in reply to Re: Different behavior of Tk program in two versions of Perl
in thread Different behavior of Tk program in two versions of Perl

Thank you very much for your reply! I am ageing but can still read well :-))

Thank you for the hints to the other Tk modules too. I will certainly read the documentation.

The posted "minimal example" is a part of a bigger application, I just did not change the menu portion here.

The simple sort in the real application is actually performed per mouse click on the column header. The menu is for the advanced sort, that is on column1 then on column2 then on column3 (there are more than 3 columns in the real application too). This intention is not obvious with the short test file provided, I admit. I should make many Harrys with different dates to show that.

Probably I did not describe the actual problem sufficiently. It is as follows. If I start the dialog where the user choose the columns to sort on, the entries should be empty. They are empty in v.5.16 but are partially set in v.5.26 and I do not understand why.

Thanks again!

Update: Just thought - probably your example behaves differently in v.5.16 and v.5.26 too? Cannot check it now (have only 5.16 here), will do it @home and report.

Update 2: Now @home I run your example with v.5.16 and v.5.26 and I do see different behaviour. Whereas under v.5.16 the BrowseEntry always start with "inits", it starts sometimes with "inits" and sometimes with 1 under v.5.26 (I have to start skript more times in sequence to see this effect).

So, first I learned that the minimal working example can be really small. :-) Thank you very much again, also for the hints about the other modules.

Second, however, I see that this different behaviour is not just me. I would like to understand why. Is it something I should worry about?

Update 3: I added two print statements to your example: print "Debug1: $init\n"; straight after $db->BrowseEntry(-variable, \$init, -choices, \@choices,)->pack; and print "Debug2: $init\n"; straight after $db->Show;. Under v.5.16 the output is always Debug1: inits for the first print statement and the chosen value for the second print statement. Unter v.5.26 the first print statement is sometimes Debug1: inits and sometimes Debug1: 1. The second print statement is the same way as under v.5.16. Still curious, why $init is set to the first value of @choices under v.5.26 and also not always but somehow randomly.

Replies are listed 'Best First'.
Re^3: Different behavior of Tk program in two versions of Perl
by Anonymous Monk on Jul 02, 2018 at 18:10 UTC
    Um. Does solution work for you (initialize variable from choices array with empty being the first )? Yes even with more columns it should still work by clicking header, thats as advanced as it needs to get :) i cant see a reason otherwise. Multiple dropdowns is definitely too laborious esp as number of columns increases. In the spirit of that approach would be a listbox with reorderable items where each item is a 3 radio buttons: asc desc ignore and label column header (and maybe uparrow button move item up in order...) Try both and see what makes more sense to you, i dont see extra popup clicks as advancement :)

      This is certainly worth trying, thank you very much for the idea.

Re^3: Different behavior of Tk program in two versions of Perl
by Anonymous Monk on Jul 02, 2018 at 18:13 UTC

    Second, however, I see that this different behaviour is not just me. I would like to understand why. Is it something I should worry about?

    dont worry about it use solution that provides consistent behaviour across all perl versions

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217724]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-12-09 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?