Changeset 665 for trunk


Ignore:
Timestamp:
Dec 4, 2009 5:09:58 PM (14 years ago)
Author:
toby
Message:

# on 2002/12/30 17:14:03, toby did:
update pleasewait to include latest options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 2002/08/09 16:40:59 to 2002/12/30 17:14:03
    • Property rcs:lines changed from +14 -5 to +21 -9
    • Property rcs:rev changed from 1.47 to 1.48
    r637 r665  
    285285
    286286# tell'em what is happening
    287 proc pleasewait {{message {}}} {
     287#    message    is a text message to display
     288#    statusvar  is a variable name containing a message that gets updated
     289#    parent     is the name of the parent window
     290#    button     defines a button for the window. Element 0 in $button is the
     291#               text for the button and Element 1 is the command to execute.
     292proc pleasewait {{message {}} {statusvar {}} {parent .} {button ""}} {
    288293    catch {destroy .msg}
    289294    toplevel .msg
    290295    wm transient .msg [winfo toplevel .]
    291     pack [frame .msg.f -bd 4 -relief groove]
    292     pack [message .msg.f.m -text "Please wait $message"]
     296    pack [frame .msg.f -bd 4 -relief groove] -padx 5 -pady 5
     297    pack [message .msg.f.m -text "Please wait $message"] -side top
     298    if {$statusvar != ""} {
     299        pack [label .msg.f.status -textvariable $statusvar] -side top
     300    }
     301    if {$button != ""} {
     302        pack [button .msg.f.button -text [lindex $button 0] \
     303                -command [lindex $button 1]] -side top
     304    }
    293305    wm withdraw .msg
    294306    update idletasks
    295     # place the message on top of the main window
    296     set x [expr [winfo x .] + [winfo width .]/2 - \
    297             [winfo reqwidth .msg]/2 - [winfo vrootx .]]
     307    # place the message on top of the parent window
     308    set x [expr [winfo x $parent] + [winfo width $parent]/2 - \
     309            [winfo reqwidth .msg]/2 - [winfo vrootx $parent]]
    298310    if {$x < 0} {set x 0}
    299     set y [expr [winfo y .] + [winfo height .]/2 - \
    300             [winfo reqheight .msg]/2 - [winfo vrooty .]]
     311    set y [expr [winfo y $parent] + [winfo height $parent]/2 - \
     312            [winfo reqheight .msg]/2 - [winfo vrooty $parent]]
    301313    if {$y < 0} {set y 0}
    302314    wm geom .msg +$x+$y
Note: See TracChangeset for help on using the changeset viewer.