Tqst DriVq

You've added in the line of code that terminates (destroys) your GUI application. Now, press F5 to see what happens.

hfrn I k. p yw ■ ,'H en«;b arr\ p Jh oadF I rit P rag/ilia pta r9/«de/ttag < + -

rile frlrt format Qi tn Optirwi«! Windnwi r tkintcr *

^y y fflne. mijcjcX

□ pp,tit±C( lJC id ill"t MIX") ajjp . ye uinK (. l y ( ' 200 jt LdO-<-i 00 +10 C J)

auijiid fx It? a 04M PJiC Nbiplil-Lni^tx . wa v ™

tracJi_otart i ) : I r i ■ k - [11 rty ( l[Hï[]?i m ~ j j

app,destroyi )

This extra line of Code makes all the difference.

track - c.i Kcr. Sou [id j aound_t i Ac 1 track_p±aying — lntvar( \

hLi[ L. ^iiLljin = fl.il. I Ii!i(rt:i:jr O^taHin^BLrjicli nl.nrL, L.+?xl = o t art_but t on. pack. ( □ ide - LtiJr'T]

.^t un Till I. I ( hCE = Rul Ï in ( ri[i:i r 4 :c iirmirtïic] =■ L.irii:k L.tfKL. w s t Dp_button,p ack[b idfl - HHJH'J' J

app. protoc o± ( " M_L> - i. c. ..-._■■..:.■.. .,■■■', e hutdown J

app,nainLoop(1

Your GUI is not only doing what the DJ wants; it's behaving itself, too. By redefining the protocol event associated with the click on the close box, you are able to stop the track... eh... in its tracks. You also ensure that the default behavior associated with the click is performed by arranging to destroy the GUI application.

That's great!

When you click on the close box now, the GUI application disappears. Which helps explain why y°u can't see it on this page anymore!

toggle time

Was this article helpful?

0 0

Post a comment