Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Simple Calculator using Tk

by Albannach (Prior)
on Feb 20, 2004 at 01:53 UTC ( #330430=note: print w/ replies, xml ) Need Help??

in reply to Simple Calculator using Tk

A neat little job ++! Also a good choice of application for GUI practice with lots of scope for growth (consider adding a 'paper tape' feature, or date calculations for instance).

One minor thing (which bites me often too) - the generation of a bug via cut & paste. You duplicated the line to create all your menu commands, and consequently your Exit command is passed as a 'Q' button press. Unfortunately there is no 'Q' button, so the 'Q' is passed on to calc(), where it acts to clear the display and buffer.

Update: To clarify, there is nothing fundamentally wrong with cut & paste code generation, as long as you are aware of and checking carefully for this type of error. However, if you find yourself needing many copies of the same line with very minor changes, sometimes it indicates that you should consider a different structure.

I'd like to be able to assign to an luser

Comment on Re: Simple Calculator using Tk
Download Code
Replies are listed 'Best First'.
Re: Re: Simple Calculator using Tk
by eoin (Monk) on Feb 20, 2004 at 13:08 UTC
    Damn, I should have spoted that 'Q' typo. The 'Q' should be passed as a key press instead of a button press. I'll update the code correcting that.

    Regarding the cut and paste aspect. I didn;t really think about doing it any other way. I suppose I could have now that you say it, but this is the quickest and easiest(although not always the right, as you pointed out) way to do this.

    Cheers, Eoin...

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-11-25 12:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (674 votes), past polls