Ignore:
Timestamp:
Mar 18, 2009 2:59:21 PM (15 years ago)
Author:
gah
Message:

preliminary HQ output from molvisviewer; unexpand tabs; all jpeg generation at 100%

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/grab.tcl

    r210 r1342  
    4141    set op [lindex $args 0]
    4242    if {[winfo exists $op]} {
    43         set op "set"
     43        set op "set"
    4444    } elseif {$op == "-global" && [winfo exists [lindex $args end]]} {
    45         set op "set"
     45        set op "set"
    4646    }
    4747
    4848    if {$op == "set"} {
    49         #
    50         # Handle GRAB SET specially.
    51         # Add the new grab window to the grab stack.
    52         #
    53         set state $::Rappture::grab::state
    54         set window [lindex $args end]
    55         if {[lsearch -exact $args -global] >= 0} {
    56             set state "-global"
    57         }
     49        #
     50        # Handle GRAB SET specially.
     51        # Add the new grab window to the grab stack.
     52        #
     53        set state $::Rappture::grab::state
     54        set window [lindex $args end]
     55        if {[lsearch -exact $args -global] >= 0} {
     56            set state "-global"
     57        }
    5858
    59         if {"" != $state} {
    60             # if it's a global grab, store the -global flag away for later
    61             set window [linsert $window 0 $state]
     59        if {"" != $state} {
     60            # if it's a global grab, store the -global flag away for later
     61            set window [linsert $window 0 $state]
    6262
    63             # all grabs from now on are global
    64             set ::Rappture::grab::state "-global"
    65         }
     63            # all grabs from now on are global
     64            set ::Rappture::grab::state "-global"
     65        }
    6666
    67         # add the current configuration to the grab stack
    68         set ::Rappture::grab::stack \
    69             [linsert $::Rappture::grab::stack 0 $window]
     67        # add the current configuration to the grab stack
     68        set ::Rappture::grab::stack \
     69            [linsert $::Rappture::grab::stack 0 $window]
    7070
    71         return [eval _grabset $window]
     71        return [eval _grabset $window]
    7272
    7373    } elseif {$op == "release"} {
    74         #
    75         # Handle GRAB RELEASE specially.
    76         # Release the current grab and grab the next window on the stack.
    77         # Note that the current grab is on the top of the stack.  The
    78         # next one down is the one we want to revert to.
    79         #
    80         set window [lindex $::Rappture::grab::stack 1]
    81         set ::Rappture::grab::stack [lrange $::Rappture::grab::stack 1 end]
     74        #
     75        # Handle GRAB RELEASE specially.
     76        # Release the current grab and grab the next window on the stack.
     77        # Note that the current grab is on the top of the stack.  The
     78        # next one down is the one we want to revert to.
     79        #
     80        set window [lindex $::Rappture::grab::stack 1]
     81        set ::Rappture::grab::stack [lrange $::Rappture::grab::stack 1 end]
    8282
    83         # release the current grab
    84         eval _tk_grab $args
     83        # release the current grab
     84        eval _tk_grab $args
    8585
    86         # and set the next one
    87         if {"" != $window} {
    88             if {[lindex $window 0] != "-global"} {
    89                 # no more global grabs -- resume local grabs
    90                 set ::Rappture::grab::state ""
    91             }
    92             eval _grabset $window
    93         }
    94         return ""
     86        # and set the next one
     87        if {"" != $window} {
     88            if {[lindex $window 0] != "-global"} {
     89                # no more global grabs -- resume local grabs
     90                set ::Rappture::grab::state ""
     91            }
     92            eval _grabset $window
     93        }
     94        return ""
    9595    }
    9696
     
    102102    # give it 3 tries, if necessary
    103103    for {set i 0} {$i < 3} {incr i} {
    104         set status [catch {eval _tk_grab set $args} result]
    105         if {$status == 0} {
    106             return $result
    107         }
    108         after 100; update
     104        set status [catch {eval _tk_grab set $args} result]
     105        if {$status == 0} {
     106            return $result
     107        }
     108        after 100; update
    109109    }
    110110    # oh well, we tried...
     
    121121    set w [_tk_grab current]
    122122    if {"" != $w} {
    123         _tk_grab release $w
     123        _tk_grab release $w
    124124    }
    125125    set Rappture::grab::stack ""
     
    127127
    128128    foreach win [blt::busy windows] {
    129         blt::busy release $win
     129        blt::busy release $win
    130130    }
    131131}
Note: See TracChangeset for help on using the changeset viewer.