From 4c639a67d6353529519a8328eb997c7d05daf53c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 11 Aug 2009 15:36:41 +0200 Subject: [PATCH] Move helper functions to front In a subsequent patch, we'll need to have defined helper functions before we construct the GUI. Signed-off-by: Johannes Schindelin --- lilycontrib.tcl | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/lilycontrib.tcl b/lilycontrib.tcl index 95f459a5cf..2a92c27ccb 100755 --- a/lilycontrib.tcl +++ b/lilycontrib.tcl @@ -2,24 +2,10 @@ package require Tk -wm title . "LilyPond Contributor's GUI" -button .update -text "Update LilyPond" -command update_lilypond -panedwindow .output -text .output.text -width 80 -height 15 \ - -xscrollcommand [list .output.horizontal set] \ - -yscrollcommand [list .output.vertical set] -scrollbar .output.horizontal -orient h -command [list .output.text xview] -scrollbar .output.vertical -orient v -command [list .output.text yview] -pack .output.horizontal -side bottom -fill x -pack .output.vertical -side right -fill y -pack .output.text -expand true -anchor nw -fill both -pack .update .output +# Helper functions set lily_dir $env(HOME)/lilypond cd $lily_dir -if {![file exists $lily_dir]} { - .update configure -text "Clone LilyPond" -} proc write_to_output {s} { .output.text insert insert $s @@ -78,3 +64,30 @@ proc update_lilypond {} { } write_to_output "Done.\n" } + +# GUI + +wm title . "LilyPond Contributor's GUI" + +# Buttons + +panedwindow .buttons +button .buttons.update -text "Update LilyPond" -command update_lilypond +if {![file exists $lily_dir]} { + .update configure -text "Clone LilyPond" +} +pack .buttons.update -side left + +# Output + +panedwindow .output +text .output.text -width 80 -height 15 \ + -xscrollcommand [list .output.horizontal set] \ + -yscrollcommand [list .output.vertical set] +scrollbar .output.horizontal -orient h -command [list .output.text xview] +scrollbar .output.vertical -orient v -command [list .output.text yview] +pack .output.horizontal -side bottom -fill x +pack .output.vertical -side right -fill y +pack .output.text -expand true -anchor nw -fill both + +pack .buttons .output -- 2.11.4.GIT