tkml Wiki
Simple Tcl/Tk library for XML-based GUI creation
Status: Beta
Brought to you by:
portucalle
The code shown below will display a table showing some matches played by Fulham during the 2011-2012 season. To use it, save the code in a file (for example fulham.xml), launch a tcl shell and run the following commands:
package require tkml mlObject::loadXml -file fulham.xml
Here's the code:
<root title="Some Fulham Matches on Premier League 2011-2012"> <code> proc sb1ShowOther {} { # Select the 'notice' label # set obj [mlObject::findObjectById "notice"] # Make it display a message # $obj setc cdata "Note: This is just example code" } </code> <frame> <spinbox id="sb1"> Arsenal Aston Villa Blackburn Rovers Bolton Wanderers Chelsea Everton Fulham Liverpool Manchester City Manchester United Newcastle United Norwich City Queens Park Ra… Stoke City Sunderland Swansea City Tottenham Hotspur West Bromwich … Wigan Athletic Wolverhampton … </spinbox> <button padx="5" pady="0" command="sb1ShowOther">Go</button> <label id="notice" padx="5"></label> </frame> <panedwindow> <labelframe label=Home> <table> <tr> <td><label font="TkHeadingFont">phase</label></td> <td><label font="TkHeadingFont">season</label></td> <td><label font="TkHeadingFont">competition</label></td> <td><label font="TkHeadingFont">home</label></td> <td><label font="TkHeadingFont">away</label></td> <td><label font="TkHeadingFont">result</label></td> </tr> <tr> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">1</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">2011-2012</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Premier League</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Fulham</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Aston Villa</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">0 0</label></td> </tr> <tr> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">4</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">2011-2012</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Premier League</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Fulham</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Blackburn Rovers</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">1 1</label></td> </tr> <tr> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">5</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">2011-2012</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Premier League</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Fulham</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">Manchester City</label></td> <td background="yellow"><label font="TkDefaultFont 8" justify="center" background="yellow">2 2</label></td> </tr> </table> </labelframe> <labelframe label=Away> <table> <tr> <td><label font="TkHeadingFont">phase</label></td> <td><label font="TkHeadingFont">season</label></td> <td><label font="TkHeadingFont">competition</label></td> <td><label font="TkHeadingFont">home</label></td> <td><label font="TkHeadingFont">away</label></td> <td><label font="TkHeadingFont">result</label></td> </tr> <tr> <td background="red"><label font="TkDefaultFont 8" background="red">2</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">2011-2012</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Premier League</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Wolverhampton …</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Fulham</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">2 0</label></td> </tr> <tr> <td background="red"><label font="TkDefaultFont 8" background="red">3</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">2011-2012</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Premier League</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Newcastle United</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">Fulham</label></td> <td background="red"><label font="TkDefaultFont 8" background="red">2 1</label></td> </tr> <tr> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">6</label></td> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">2011-2012</label></td> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">Premier League</label></td> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">West Bromwich …</label></td> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">Fulham</label></td> <td background="yellow"><label font="TkDefaultFont 8" background="yellow">0 0</label></td> </tr> </table> </labelframe> </panedwindow> </root>