mς &U²Ic@sΤdZdkTdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZed jo^e ƒZ ee d d d gƒZ e i de deƒee id dddddƒi ƒee id dddddƒi ƒee id ddd ƒi ƒee ƒZee dddd„ƒZee dddd„ƒZee ddƒZei ddddƒei ddddƒei ddƒei ddƒe iƒe iƒndS(sI a couple of classes for implementing partial tabbed-page like behaviour (t*tInvalidTabPagecBstZRS(N(t__name__t __module__(((t,/data/zmath/lib/python2.4/idlelib/tabpage.pyRst AlreadyExistscBstZRS(N(RR(((RRstPageTabcBstZdZd„ZRS(s) a 'page tab' like framed button cCsoti||dddtƒt|dddddtdtd d dd d |id ƒƒ|_|ii ƒdS( Nt borderwidthitrelieftpadxitpadyt takefocust indicatoronthighlightthicknessit selectcolortbg( tFramet__init__tselftparenttRIDGEt RadiobuttontFALSEtcgettbuttontpack(RR((RRs  (RRt__doc__R(((RR s t TabPageSetcBsAtZdZgd„Zed„Zd„Zd„Zd„ZRS(sH a set of 'pages' with TabButtons for controlling their display cKsΊti|||ƒ|iddƒ|idddƒ|idddƒt|ƒ|_|ii dddddt ƒt |ƒ|_ d|_ h|_x|D]}|i|ƒqŸWdS( s pageNames - a list of strings, each string will be the dictionary key to a page's data, and the name displayed on the page's tab. Should be specified in desired page order. The first page will be the default and first active page. itweightitrowtcolumntstickytN(RRRRtkwt grid_locationtcolumnconfiguret rowconfigurettabBartgridtEWt StringVart activePaget defaultPagetpagest pageNamestnametAddPage(RRR,R!R-((RRs  cCs³|o7||iiƒjo|ii|ƒq>td‚nx2|iiƒD]!}|i|didt ƒqNW|i|i ƒdidt ƒ|i|i ƒdi ƒdS(NsInvalid TabPage NamettabRtpage( tpageNameRR+tkeysR)tsetRR0tconfigRt GetActivePagetRAISEDtlift(RR1R0((Rt ChangePage,s !cCs |iiƒS(N(RR)tget(R((RR59sc Cs||iiƒjo td‚nhdt|iƒ<dt|dddtƒ<|i|<|i|di i d|d|i d |i d |ƒ|i|di d tƒ|i|did d dddtƒt|iƒd jo*||_|i i|iƒ|i ƒndS(NsTabPage Name Already ExistsR/R0RiRttexttcommandtvariabletvaluetsideRiRiR(R1RR+R2RRR%RR6RR4R8R)RtLEFTR&tNSEWtlenR*R3(RR1((RR.<s : ' cCs ||iiƒjo td‚n|i|diƒ|i|diƒ|i|diƒ|i|diƒ|i|=|ipd|_dSn||ijo&|i i ƒdi i dƒ|_n||i ƒjo|ii|iƒn|iƒdS(NsInvalid TabPage NameR/R0R iR:(R1RR+R2Rt pack_forgett grid_forgettdestroyR*R%twinfo_childrenRRR5R)R3R8(RR1((Rt RemovePageKs    &( RRRRtNoneR8R5R.RF(((RRs    t__main__R,tFoobartBaztexpandtfillR0R:tFooR itBarsAdd PageR;cCstitiƒƒS(N(ttabPageR.t entryPgNameR9(((Rthss Remove PagecCstitiƒƒS(N(RORFRPR9(((RRQjssname of page to add/remove:R iN(RtTkintert ExceptionRRRRRRtTktrootRORtTRUEtBOTHtLabelR+tEntryRPtButtont buttonAddt buttonRemovet labelPgNameR8tmainloop( R\R]ROR[RRRURRRP((Rt?s0 I  ''!