Thursday, July 21, 2022

Lesson 7

 Today's widget is a scale, which we have turned inot a temperature scale.

The number were inverted so that 100 is at the top; it is placed in a vertical position.

(Indeed, that window can be manually widened, making it easier to move the scale 

around). The scale set provision adds the scale "to', not necessary for this design.

Also noteworthy, it is necessary ro convert the temperature reading scale.get() to a string 

before being able to print it. (Fourteen on its own gets printed just fine...)


                                                       


                                                                      


                                                                         





Wednesday, July 20, 2022

Lesson 6

 The code on Lesson 6 - for a radio box - looks a tad complex; but when all is 

said and done, the code yells "Hamburger' to the cook, so maybe not that

daunting after all.


The radiobox is a pre-defined widget that only allows the user to make one choice

from many possibilities. Our example offer both text and image versions of the choices

in question. The order() function, defined prior to the window, is a loop that goes

through the index numbers on the food array. One needs to create an x variable for this

to work, and it is an integer variable. The food choices  in the array are strings,

and the images, PhotoImage, as with previous widgets.


The pack() function here uses anchor(W) -west - for which I am adding a reference

scheme from another tutorial.

                                                        


                                                                             


                                                                           


                                                                   *     *     *         


Tuesday, July 19, 2022

Lesson(5)

 Going forward: lesson 5 deals with the checkbox widget. 

Variable x gets put within the window code, but the definition

of the display function comes before. foreground and active

foreground need not be of the same color, but here I repeat the

instruction to make it so. 









Monday, July 18, 2022

Lesson 4

 This lesson covers designing an entry widget; that is, a space in

which the user can enter text, and submit, delete or use backspace,

each with a button.


By convention, function definitions are given before ome creates a window.

And window is still the 'master' of the various widgets.

                              






                                        


Sunday, July 17, 2022

Amortization

 Been trying to make clear - in my own mind - how paymentamounts for 

amortized loans are calculated. Found the formula on the web:


'Total payment' here is the amount the borrower pays back at each agreed upon

due date.


Let's look at the simplest case possible. I borrow 100$ at 10% for two years.

What is the repayment amount I will be making (there will be tow).

Plugging my numbers in the formula, I end up making two payments of

57.62$. On the first payment, 10$ is going to yearly interest. So I have reduced

the principal I owe by 47.62. which means i enter year two owing 52.38$. That

too is going to cost me 10% over the year. So my second payment covers the 52.38$

plus 5.24$ interest. There it is: 57.62$.


It's actually a lovely formula; (1+i)^n/((1+i)^n)-1... multiplied by ...(i x loaned amount)

makes for a payments amount that is a multiple of interest units.


(Someone with a mortgage may have a slightly higher payment than the formula would

dictate. This would be due to an insurance premium being included.)


And indeed, this is not the only possible repayment model.

Amortization Calculation Formula and Payment Calculator (vertex42.com)

https://www.capital.fr/votre-argent/amortissement-dun-pret-definition-calcul-et-types-1430663#:~:text=L'amortissement%20d'un%20pr%C3%AAt%20correspond%20%C3%A0%20la%20dur%C3%A9e%20n%C3%A9cessaire,agit%20d'un%20pr%C3%AAt%20immobilier.



Lesson(3)

 

Completed the third lesson, Buttons. 


                                            

Interesting to note: the botton can have a DISABLED or ACTIVE state.  In the

former, no clicks will be recorded.                                                                                                       

Saturday, July 16, 2022

Lesson(2)


 Lesson 2 was about Label, which is what is used in the GUI to display text

or an image. What was confusing me were the layout managers. Here, we are

introduced to 2: pack() and place(). Pack is the easiest and works with top, bottom,

left and right. the coordinates are (0, 0) in the upper left-hand corner and place

works with those.


I have a borser on the image of 10, and it is raised. There is padding between the text

and the sides of the window, 20 pixrls on each of the x and y axis.


Nice touch to the series: if I go to the individual lesson YouTube video, the code

to the lesson is first thing in the comments section.