Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: update french translation
  git-gui: update Japanese translation
  git-gui: fix shortcut for menu "Commit/Revert Changes"
  git-gui: Quote git path when starting another gui in a submodule
  git-gui: update Italian translation
  git-gui: Update Swedish translation (520t0f0u)
  git-gui: use themed tk widgets with Tk 8.5
  git-gui: Update German translation (12 new or changed strings).
  git-gui: Update translation template
  git-gui: Remove unused icon file_parttick
  git-gui: use different icon for new and modified files in the index
  git-gui: set GIT_DIR and GIT_WORK_TREE after setup
  git-gui: update shortcut tools to use _gitworktree
  git-gui: handle bare repos correctly
  git-gui: handle non-standard worktree locations
  git-gui: Support applying a range of changes at once
  git-gui: Add a special diff popup menu for submodules
  git-gui: Use git diff --submodule when available
This commit is contained in:
Junio C Hamano 2010-02-07 15:52:28 -08:00
commit 8051a03061
34 changed files with 3157 additions and 2545 deletions

View File

@ -121,6 +121,8 @@ unset oguimsg
set _appname {Git Gui}
set _gitdir {}
set _gitworktree {}
set _isbare {}
set _gitexec {}
set _githtmldir {}
set _reponame {}
@ -276,6 +278,32 @@ proc get_config {name} {
}
}
proc is_bare {} {
global _isbare
global _gitdir
global _gitworktree
if {$_isbare eq {}} {
if {[catch {
set _bare [git rev-parse --is-bare-repository]
switch -- $_bare {
true { set _isbare 1 }
false { set _isbare 0}
default { throw }
}
}]} {
if {[is_config_true core.bare]
|| ($_gitworktree eq {}
&& [lindex [file split $_gitdir] end] ne {.git})} {
set _isbare 1
} else {
set _isbare 0
}
}
}
return $_isbare
}
######################################################################
##
## handy utils
@ -649,12 +677,17 @@ if {[is_Windows]} {
## config defaults
set cursor_ptr arrow
font create font_diff -family Courier -size 10
font create font_ui
catch {
label .dummy
eval font configure font_ui [font actual [.dummy cget -font]]
destroy .dummy
if {[lsearch -exact [font names] TkDefaultFont] != -1} {
eval [linsert [font actual TkDefaultFont] 0 font configure font_ui]
eval [linsert [font actual TkFixedFont] 0 font create font_diff]
} else {
font create font_diff -family Courier -size 10
catch {
label .dummy
eval font configure font_ui [font actual [.dummy cget -font]]
destroy .dummy
}
}
font create font_uiitalic
@ -669,6 +702,9 @@ foreach class {Button Checkbutton Entry Label
}
if {![is_MacOSX]} {
option add *Menu.font font_ui
option add *Entry.borderWidth 1 startupFile
option add *Entry.relief sunken startupFile
option add *RadioButton.anchor w startupFile
}
unset class
@ -721,6 +757,18 @@ proc apply_config {} {
font configure ${font}bold -weight bold
font configure ${font}italic -slant italic
}
global use_ttk NS
set use_ttk 0
set NS {}
if {$repo_config(gui.usettk)} {
set use_ttk [package vsatisfies [package provide Tk] 8.5]
if {$use_ttk} {
set NS ttk
bind [winfo class .] <<ThemeChanged>> [list InitTheme]
pave_toplevel .
}
}
}
set default_config(branch.autosetupmerge) true
@ -747,6 +795,7 @@ set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
# TODO: this option should be added to the git-config documentation
set default_config(gui.maxfilesdisplayed) 5000
set default_config(gui.usettk) 1
set font_descs {
{fontui font_ui {mc "Main Font"}}
{fontdiff font_diff {mc "Diff/Console Font"}}
@ -1100,25 +1149,41 @@ if {![file isdirectory $_gitdir]} {
error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]
exit 1
}
# _gitdir exists, so try loading the config
load_config 0
apply_config
# try to set work tree from environment, falling back to core.worktree
if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {
set _gitworktree [get_config core.worktree]
}
if {$_prefix ne {}} {
regsub -all {[^/]+/} $_prefix ../ cdup
if {$_gitworktree eq {}} {
regsub -all {[^/]+/} $_prefix ../ cdup
} else {
set cdup $_gitworktree
}
if {[catch {cd $cdup} err]} {
catch {wm withdraw .}
error_popup [strcat [mc "Cannot move to top of working directory:"] "\n\n$err"]
exit 1
}
set _gitworktree [pwd]
unset cdup
} elseif {![is_enabled bare]} {
if {[lindex [file split $_gitdir] end] ne {.git}} {
if {[is_bare]} {
catch {wm withdraw .}
error_popup [strcat [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
error_popup [strcat [mc "Cannot use bare repository:"] "\n\n$_gitdir"]
exit 1
}
if {[catch {cd [file dirname $_gitdir]} err]} {
if {$_gitworktree eq {}} {
set _gitworktree [file dirname $_gitdir]
}
if {[catch {cd $_gitworktree} err]} {
catch {wm withdraw .}
error_popup [strcat [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
error_popup [strcat [mc "No working directory"] " $_gitworktree:\n\n$err"]
exit 1
}
set _gitworktree [pwd]
}
set _reponame [file split [file normalize $_gitdir]]
if {[lindex $_reponame end] eq {.git}} {
@ -1127,6 +1192,9 @@ if {[lindex $_reponame end] eq {.git}} {
set _reponame [lindex $_reponame end]
}
set env(GIT_DIR) $_gitdir
set env(GIT_WORK_TREE) $_gitworktree
######################################################################
##
## global init
@ -1808,15 +1876,6 @@ static unsigned char file_fulltick_bits[] = {
0x62, 0x10, 0x02, 0x10, 0xfe, 0x1f};
} -maskdata $filemask
image create bitmap file_parttick -background white -foreground "#005050" -data {
#define parttick_width 14
#define parttick_height 15
static unsigned char parttick_bits[] = {
0xfe, 0x01, 0x02, 0x03, 0x7a, 0x05, 0x02, 0x09, 0x7a, 0x1f, 0x02, 0x10,
0x7a, 0x14, 0x02, 0x16, 0x02, 0x13, 0x8a, 0x11, 0xda, 0x10, 0x72, 0x10,
0x22, 0x10, 0x02, 0x10, 0xfe, 0x1f};
} -maskdata $filemask
image create bitmap file_question -background white -foreground black -data {
#define file_question_width 14
#define file_question_height 15
@ -1857,7 +1916,7 @@ set ui_index .vpane.files.index.list
set ui_workdir .vpane.files.workdir.list
set all_icons(_$ui_index) file_plain
set all_icons(A$ui_index) file_fulltick
set all_icons(A$ui_index) file_plain
set all_icons(M$ui_index) file_fulltick
set all_icons(D$ui_index) file_removed
set all_icons(U$ui_index) file_merge
@ -1933,7 +1992,10 @@ proc incr_font_size {font {amt 1}} {
set starting_gitk_msg [mc "Starting gitk... please wait..."]
proc do_gitk {revs} {
proc do_gitk {revs {is_submodule false}} {
global current_diff_path file_states current_diff_side ui_index
global _gitdir _gitworktree
# -- Always start gitk through whatever we were loaded with. This
# lets us bypass using shell process on Windows systems.
#
@ -1944,23 +2006,78 @@ proc do_gitk {revs} {
} else {
global env
if {[info exists env(GIT_DIR)]} {
set old_GIT_DIR $env(GIT_DIR)
} else {
set old_GIT_DIR {}
}
set pwd [pwd]
cd [file dirname [gitdir]]
set env(GIT_DIR) [file tail [gitdir]]
if {!$is_submodule} {
if {![is_bare]} {
cd $_gitworktree
}
} else {
cd $current_diff_path
if {$revs eq {--}} {
set s $file_states($current_diff_path)
set old_sha1 {}
set new_sha1 {}
switch -glob -- [lindex $s 0] {
M_ { set old_sha1 [lindex [lindex $s 2] 1] }
_M { set old_sha1 [lindex [lindex $s 3] 1] }
MM {
if {$current_diff_side eq $ui_index} {
set old_sha1 [lindex [lindex $s 2] 1]
set new_sha1 [lindex [lindex $s 3] 1]
} else {
set old_sha1 [lindex [lindex $s 3] 1]
}
}
}
set revs $old_sha1...$new_sha1
}
# GIT_DIR and GIT_WORK_TREE for the submodule are not the ones
# we've been using for the main repository, so unset them.
# TODO we could make life easier (start up faster?) for gitk
# by setting these to the appropriate values to allow gitk
# to skip the heuristics to find their proper value
unset env(GIT_DIR)
unset env(GIT_WORK_TREE)
}
eval exec $cmd $revs "--" "--" &
if {$old_GIT_DIR eq {}} {
unset env(GIT_DIR)
} else {
set env(GIT_DIR) $old_GIT_DIR
set env(GIT_DIR) $_gitdir
set env(GIT_WORK_TREE) $_gitworktree
cd $pwd
ui_status $::starting_gitk_msg
after 10000 {
ui_ready $starting_gitk_msg
}
}
}
proc do_git_gui {} {
global current_diff_path
# -- Always start git gui through whatever we were loaded with. This
# lets us bypass using shell process on Windows systems.
#
set exe [list [_which git]]
if {$exe eq {}} {
error_popup [mc "Couldn't find git gui in PATH"]
} else {
global env
global _gitdir _gitworktree
# see note in do_gitk about unsetting these vars when
# running tools in a submodule
unset env(GIT_DIR)
unset env(GIT_WORK_TREE)
set pwd [pwd]
cd $current_diff_path
eval exec $exe gui &
set env(GIT_DIR) $_gitdir
set env(GIT_WORK_TREE) $_gitworktree
cd $pwd
ui_status $::starting_gitk_msg
@ -1971,6 +2088,7 @@ proc do_gitk {revs} {
}
proc do_explore {} {
global _gitworktree
set explorer {}
if {[is_Cygwin] || [is_Windows]} {
set explorer "explorer.exe"
@ -1980,7 +2098,7 @@ proc do_explore {} {
# freedesktop.org-conforming system is our best shot
set explorer "xdg-open"
}
eval exec $explorer [list [file nativename [file dirname [gitdir]]]] &
eval exec $explorer $_gitworktree &
}
set is_quitting 0
@ -1996,7 +2114,7 @@ proc do_quit {{rc {1}}} {
global ui_comm is_quitting repo_config commit_type
global GITGUI_BCK_exists GITGUI_BCK_i
global ui_comm_spell
global ret_code
global ret_code use_ttk
if {$is_quitting} return
set is_quitting 1
@ -2054,8 +2172,13 @@ proc do_quit {{rc {1}}} {
}
set cfg_geometry [list]
lappend cfg_geometry [wm geometry .]
lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
if {$use_ttk} {
lappend cfg_geometry [.vpane sashpos 0]
lappend cfg_geometry [.vpane.files sashpos 0]
} else {
lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
}
if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
set rc_geometry {}
}
@ -2344,8 +2467,6 @@ proc show_less_context {} {
##
## ui construction
load_config 0
apply_config
set ui_comm {}
# -- Menu Bar
@ -2377,10 +2498,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
#
menu .mbar.repository
.mbar.repository add command \
-label [mc "Explore Working Copy"] \
-command {do_explore}
.mbar.repository add separator
if {![is_bare]} {
.mbar.repository add command \
-label [mc "Explore Working Copy"] \
-command {do_explore}
.mbar.repository add separator
}
.mbar.repository add command \
-label [mc "Browse Current Branch's Files"] \
@ -2822,14 +2945,13 @@ default {
# -- Branch Control
#
frame .branch \
-borderwidth 1 \
-relief sunken
label .branch.l1 \
${NS}::frame .branch
if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
${NS}::label .branch.l1 \
-text [mc "Current Branch:"] \
-anchor w \
-justify left
label .branch.cb \
${NS}::label .branch.cb \
-textvariable current_branch \
-anchor w \
-justify left
@ -2839,15 +2961,20 @@ pack .branch -side top -fill x
# -- Main Window Layout
#
panedwindow .vpane -orient horizontal
panedwindow .vpane.files -orient vertical
.vpane add .vpane.files -sticky nsew -height 100 -width 200
${NS}::panedwindow .vpane -orient horizontal
${NS}::panedwindow .vpane.files -orient vertical
if {$use_ttk} {
.vpane add .vpane.files
} else {
.vpane add .vpane.files -sticky nsew -height 100 -width 200
}
pack .vpane -anchor n -side top -fill both -expand 1
# -- Index File List
#
frame .vpane.files.index -height 100 -width 200
label .vpane.files.index.title -text [mc "Staged Changes (Will Commit)"] \
${NS}::frame .vpane.files.index -height 100 -width 200
tlabel .vpane.files.index.title \
-text [mc "Staged Changes (Will Commit)"] \
-background lightgreen -foreground black
text $ui_index -background white -foreground black \
-borderwidth 0 \
@ -2857,8 +2984,8 @@ text $ui_index -background white -foreground black \
-xscrollcommand {.vpane.files.index.sx set} \
-yscrollcommand {.vpane.files.index.sy set} \
-state disabled
scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
${NS}::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
${NS}::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
pack .vpane.files.index.title -side top -fill x
pack .vpane.files.index.sx -side bottom -fill x
pack .vpane.files.index.sy -side right -fill y
@ -2866,8 +2993,8 @@ pack $ui_index -side left -fill both -expand 1
# -- Working Directory File List
#
frame .vpane.files.workdir -height 100 -width 200
label .vpane.files.workdir.title -text [mc "Unstaged Changes"] \
${NS}::frame .vpane.files.workdir -height 100 -width 200
tlabel .vpane.files.workdir.title -text [mc "Unstaged Changes"] \
-background lightsalmon -foreground black
text $ui_workdir -background white -foreground black \
-borderwidth 0 \
@ -2877,15 +3004,19 @@ text $ui_workdir -background white -foreground black \
-xscrollcommand {.vpane.files.workdir.sx set} \
-yscrollcommand {.vpane.files.workdir.sy set} \
-state disabled
scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
pack .vpane.files.workdir.title -side top -fill x
pack .vpane.files.workdir.sx -side bottom -fill x
pack .vpane.files.workdir.sy -side right -fill y
pack $ui_workdir -side left -fill both -expand 1
.vpane.files add .vpane.files.workdir -sticky nsew
.vpane.files add .vpane.files.index -sticky nsew
.vpane.files add .vpane.files.workdir
.vpane.files add .vpane.files.index
if {!$use_ttk} {
.vpane.files paneconfigure .vpane.files.workdir -sticky news
.vpane.files paneconfigure .vpane.files.index -sticky news
}
foreach i [list $ui_index $ui_workdir] {
rmsel_tag $i
@ -2895,68 +3026,69 @@ unset i
# -- Diff and Commit Area
#
frame .vpane.lower -height 300 -width 400
frame .vpane.lower.commarea
frame .vpane.lower.diff -relief sunken -borderwidth 1
${NS}::frame .vpane.lower -height 300 -width 400
${NS}::frame .vpane.lower.commarea
${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1
pack .vpane.lower.diff -fill both -expand 1
pack .vpane.lower.commarea -side bottom -fill x
.vpane add .vpane.lower -sticky nsew
.vpane add .vpane.lower
if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}
# -- Commit Area Buttons
#
frame .vpane.lower.commarea.buttons
label .vpane.lower.commarea.buttons.l -text {} \
${NS}::frame .vpane.lower.commarea.buttons
${NS}::label .vpane.lower.commarea.buttons.l -text {} \
-anchor w \
-justify left
pack .vpane.lower.commarea.buttons.l -side top -fill x
pack .vpane.lower.commarea.buttons -side left -fill y
button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
${NS}::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
-command ui_do_rescan
pack .vpane.lower.commarea.buttons.rescan -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.rescan conf -state}
button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
${NS}::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
-command do_add_all
pack .vpane.lower.commarea.buttons.incall -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.incall conf -state}
if {![is_enabled nocommitmsg]} {
button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
${NS}::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
-command do_signoff
pack .vpane.lower.commarea.buttons.signoff -side top -fill x
}
button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
${NS}::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
-command do_commit
pack .vpane.lower.commarea.buttons.commit -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.commit conf -state}
if {![is_enabled nocommit]} {
button .vpane.lower.commarea.buttons.push -text [mc Push] \
${NS}::button .vpane.lower.commarea.buttons.push -text [mc Push] \
-command do_push_anywhere
pack .vpane.lower.commarea.buttons.push -side top -fill x
}
# -- Commit Message Buffer
#
frame .vpane.lower.commarea.buffer
frame .vpane.lower.commarea.buffer.header
${NS}::frame .vpane.lower.commarea.buffer
${NS}::frame .vpane.lower.commarea.buffer.header
set ui_comm .vpane.lower.commarea.buffer.t
set ui_coml .vpane.lower.commarea.buffer.header.l
if {![is_enabled nocommit]} {
radiobutton .vpane.lower.commarea.buffer.header.new \
${NS}::radiobutton .vpane.lower.commarea.buffer.header.new \
-text [mc "New Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value new
lappend disable_on_lock \
[list .vpane.lower.commarea.buffer.header.new conf -state]
radiobutton .vpane.lower.commarea.buffer.header.amend \
${NS}::radiobutton .vpane.lower.commarea.buffer.header.amend \
-text [mc "Amend Last Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
@ -2965,7 +3097,7 @@ if {![is_enabled nocommit]} {
[list .vpane.lower.commarea.buffer.header.amend conf -state]
}
label $ui_coml \
${NS}::label $ui_coml \
-anchor w \
-justify left
proc trace_commit_type {varname args} {
@ -2997,7 +3129,7 @@ text $ui_comm -background white -foreground black \
-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
-font font_diff \
-yscrollcommand {.vpane.lower.commarea.buffer.sby set}
scrollbar .vpane.lower.commarea.buffer.sby \
${NS}::scrollbar .vpane.lower.commarea.buffer.sby \
-command [list $ui_comm yview]
pack .vpane.lower.commarea.buffer.header -side top -fill x
pack .vpane.lower.commarea.buffer.sby -side right -fill y
@ -3063,19 +3195,19 @@ proc trace_current_diff_path {varname args} {
}
trace add variable current_diff_path write trace_current_diff_path
frame .vpane.lower.diff.header -background gold
label .vpane.lower.diff.header.status \
gold_frame .vpane.lower.diff.header
tlabel .vpane.lower.diff.header.status \
-background gold \
-foreground black \
-width $max_status_desc \
-anchor w \
-justify left
label .vpane.lower.diff.header.file \
tlabel .vpane.lower.diff.header.file \
-background gold \
-foreground black \
-anchor w \
-justify left
label .vpane.lower.diff.header.path \
tlabel .vpane.lower.diff.header.path \
-background gold \
-foreground black \
-anchor w \
@ -3099,7 +3231,7 @@ bind_button3 .vpane.lower.diff.header.path "tk_popup $ctxm %X %Y"
# -- Diff Body
#
frame .vpane.lower.diff.body
${NS}::frame .vpane.lower.diff.body
set ui_diff .vpane.lower.diff.body.t
text $ui_diff -background white -foreground black \
-borderwidth 0 \
@ -3108,9 +3240,9 @@ text $ui_diff -background white -foreground black \
-xscrollcommand {.vpane.lower.diff.body.sbx set} \
-yscrollcommand {.vpane.lower.diff.body.sby set} \
-state disabled
scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
${NS}::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
-command [list $ui_diff xview]
scrollbar .vpane.lower.diff.body.sby -orient vertical \
${NS}::scrollbar .vpane.lower.diff.body.sby -orient vertical \
-command [list $ui_diff yview]
pack .vpane.lower.diff.body.sbx -side bottom -fill x
pack .vpane.lower.diff.body.sby -side right -fill y
@ -3154,15 +3286,6 @@ $ui_diff tag raise sel
#
proc create_common_diff_popup {ctxm} {
$ctxm add command \
-label [mc "Show Less Context"] \
-command show_less_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
-label [mc "Show More Context"] \
-command show_more_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
-label [mc Refresh] \
-command reshow_diff
@ -3214,10 +3337,19 @@ set ui_diff_applyhunk [$ctxm index last]
lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
$ctxm add command \
-label [mc "Apply/Reverse Line"] \
-command {apply_line $cursorX $cursorY; do_rescan}
-command {apply_range_or_line $cursorX $cursorY; do_rescan}
set ui_diff_applyline [$ctxm index last]
lappend diff_actions [list $ctxm entryconf $ui_diff_applyline -state]
$ctxm add separator
$ctxm add command \
-label [mc "Show Less Context"] \
-command show_less_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
-label [mc "Show More Context"] \
-command show_more_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
create_common_diff_popup $ctxm
set ctxmmg .vpane.lower.diff.body.ctxmmg
@ -3240,9 +3372,40 @@ $ctxmmg add command \
-command {merge_resolve_one 1}
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add separator
$ctxmmg add command \
-label [mc "Show Less Context"] \
-command show_less_context
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add command \
-label [mc "Show More Context"] \
-command show_more_context
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add separator
create_common_diff_popup $ctxmmg
proc popup_diff_menu {ctxm ctxmmg x y X Y} {
set ctxmsm .vpane.lower.diff.body.ctxmsm
menu $ctxmsm -tearoff 0
$ctxmsm add command \
-label [mc "Visualize These Changes In The Submodule"] \
-command {do_gitk -- true}
lappend diff_actions [list $ctxmsm entryconf [$ctxmsm index last] -state]
$ctxmsm add command \
-label [mc "Visualize Current Branch History In The Submodule"] \
-command {do_gitk {} true}
lappend diff_actions [list $ctxmsm entryconf [$ctxmsm index last] -state]
$ctxmsm add command \
-label [mc "Visualize All Branch History In The Submodule"] \
-command {do_gitk --all true}
lappend diff_actions [list $ctxmsm entryconf [$ctxmsm index last] -state]
$ctxmsm add separator
$ctxmsm add command \
-label [mc "Start git gui In The Submodule"] \
-command {do_git_gui}
lappend diff_actions [list $ctxmsm entryconf [$ctxmsm index last] -state]
$ctxmsm add separator
create_common_diff_popup $ctxmsm
proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
global current_diff_path file_states
set ::cursorX $x
set ::cursorY $y
@ -3253,15 +3416,26 @@ proc popup_diff_menu {ctxm ctxmmg x y X Y} {
}
if {[string first {U} $state] >= 0} {
tk_popup $ctxmmg $X $Y
} elseif {$::is_submodule_diff} {
tk_popup $ctxmsm $X $Y
} else {
set has_range [expr {[$::ui_diff tag nextrange sel 0.0] != {}}]
if {$::ui_index eq $::current_diff_side} {
set l [mc "Unstage Hunk From Commit"]
set t [mc "Unstage Line From Commit"]
if {$has_range} {
set t [mc "Unstage Lines From Commit"]
} else {
set t [mc "Unstage Line From Commit"]
}
} else {
set l [mc "Stage Hunk For Commit"]
set t [mc "Stage Line For Commit"]
if {$has_range} {
set t [mc "Stage Lines For Commit"]
} else {
set t [mc "Stage Line For Commit"]
}
}
if {$::is_3way_diff || $::is_submodule_diff
if {$::is_3way_diff
|| $current_diff_path eq {}
|| {__} eq $state
|| {_O} eq $state
@ -3276,7 +3450,7 @@ proc popup_diff_menu {ctxm ctxmmg x y X Y} {
tk_popup $ctxm $X $Y
}
}
bind_button3 $ui_diff [list popup_diff_menu $ctxm $ctxmmg %x %y %X %Y]
bind_button3 $ui_diff [list popup_diff_menu $ctxm $ctxmmg $ctxmsm %x %y %X %Y]
# -- Status Bar
#
@ -3289,12 +3463,17 @@ $main_status show [mc "Initializing..."]
catch {
set gm $repo_config(gui.geometry)
wm geometry . [lindex $gm 0]
.vpane sash place 0 \
[lindex $gm 1] \
[lindex [.vpane sash coord 0] 1]
.vpane.files sash place 0 \
[lindex [.vpane.files sash coord 0] 0] \
[lindex $gm 2]
if {$use_ttk} {
.vpane sashpos 0 [lindex $gm 1]
.vpane.files sashpos 0 [lindex $gm 2]
} else {
.vpane sash place 0 \
[lindex $gm 1] \
[lindex [.vpane sash coord 0] 1]
.vpane.files sash place 0 \
[lindex [.vpane.files sash coord 0] 0] \
[lindex $gm 2]
}
unset gm
}
@ -3371,6 +3550,8 @@ bind . <$M1B-Key-s> do_signoff
bind . <$M1B-Key-S> do_signoff
bind . <$M1B-Key-t> do_add_selection
bind . <$M1B-Key-T> do_add_selection
bind . <$M1B-Key-j> do_revert_selection
bind . <$M1B-Key-J> do_revert_selection
bind . <$M1B-Key-i> do_add_all
bind . <$M1B-Key-I> do_add_all
bind . <$M1B-Key-minus> {show_less_context;break}
@ -3389,7 +3570,7 @@ unset i
set file_lists($ui_index) [list]
set file_lists($ui_workdir) [list]
wm title . "[appname] ([reponame]) [file normalize [file dirname [gitdir]]]"
wm title . "[appname] ([reponame]) [file normalize $_gitworktree]"
focus -force $ui_comm
# -- Warn the user about environmental problems. Cygwin's Tcl
@ -3562,3 +3743,9 @@ if {[is_enabled retcode]} {
if {$picked && [is_config_true gui.autoexplore]} {
do_explore
}
# Local variables:
# mode: tcl
# indent-tabs-mode: t
# tab-width: 4
# End:

View File

@ -4,31 +4,26 @@
proc do_about {} {
global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
global ui_comm_spell
global ui_comm_spell NS use_ttk
set w .about_dialog
toplevel $w
Dialog $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
label $w.header -text [mc "About %s" [appname]] \
-font font_uibold
${NS}::label $w.header -text [mc "About %s" [appname]] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.close -text {Close} \
${NS}::frame $w.buttons
${NS}::button $w.buttons.close -text {Close} \
-default active \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
paddedlabel $w.desc \
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright"
pack $w.desc -side top -fill x -padx 5 -pady 5
set v {}
@ -52,22 +47,10 @@ proc do_about {} {
append d "git exec dir: [gitexec]\n"
append d "git-gui lib: $oguilib"
label $w.vers \
-text $v \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
paddedlabel $w.vers -text $v
pack $w.vers -side top -fill x -padx 5 -pady 5
label $w.dirs \
-text $d \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
paddedlabel $w.dirs -text $d
pack $w.dirs -side top -fill x -padx 5 -pady 5
menu $w.ctxm -tearoff 0

View File

@ -61,7 +61,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip
field tooltip_commit {} ; # Commit(s) in tooltip
constructor new {i_commit i_path i_jump} {
global cursor_ptr M1B M1T have_tk85
global cursor_ptr M1B M1T have_tk85 use_ttk NS
variable active_color
variable group_colors
@ -73,15 +73,15 @@ constructor new {i_commit i_path i_jump} {
set font_w [font measure font_diff "0"]
frame $w.header -background gold
label $w.header.commit_l \
gold_frame $w.header
tlabel $w.header.commit_l \
-text [mc "Commit:"] \
-background gold \
-foreground black \
-anchor w \
-justify left
set w_back $w.header.commit_b
label $w_back \
tlabel $w_back \
-image ::blame::img_back_arrow \
-borderwidth 0 \
-relief flat \
@ -94,20 +94,20 @@ constructor new {i_commit i_path i_jump} {
[cb _history_menu]
}
"
label $w.header.commit \
tlabel $w.header.commit \
-textvariable @commit \
-background gold \
-foreground black \
-anchor w \
-justify left
label $w.header.path_l \
tlabel $w.header.path_l \
-text [mc "File:"] \
-background gold \
-foreground black \
-anchor w \
-justify left
set w_path $w.header.path
label $w_path \
tlabel $w_path \
-background gold \
-foreground black \
-anchor w \
@ -209,10 +209,10 @@ constructor new {i_commit i_path i_jump} {
set w_columns [list $w_amov $w_asim $w_line $w_file]
scrollbar $w.file_pane.out.sbx \
${NS}::scrollbar $w.file_pane.out.sbx \
-orient h \
-command [list $w_file xview]
scrollbar $w.file_pane.out.sby \
${NS}::scrollbar $w.file_pane.out.sby \
-orient v \
-command [list scrollbar2many $w_columns yview]
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
@ -254,10 +254,10 @@ constructor new {i_commit i_path i_jump} {
-background $active_color \
-font font_ui
$w_cviewer tag raise sel
scrollbar $w.file_pane.cm.sbx \
${NS}::scrollbar $w.file_pane.cm.sbx \
-orient h \
-command [list $w_cviewer xview]
scrollbar $w.file_pane.cm.sby \
${NS}::scrollbar $w.file_pane.cm.sby \
-orient v \
-command [list $w_cviewer yview]
pack $w.file_pane.cm.sby -side right -fill y

View File

@ -10,21 +10,24 @@ field opt_fetch 1; # refetch tracking branch if used?
field opt_detach 0; # force a detached head case?
constructor dialog {} {
make_toplevel top w
global use_ttk NS
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
label $w.header -text [mc "Checkout Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Checkout Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.create -text [mc Checkout] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.create -text [mc Checkout] \
-default active \
-command [cb _checkout]
pack $w.buttons.create -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@ -33,14 +36,14 @@ constructor dialog {} {
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
labelframe $w.options -text [mc Options]
${NS}::labelframe $w.options -text [mc Options]
checkbutton $w.options.fetch \
${NS}::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
checkbutton $w.options.detach \
${NS}::checkbutton $w.options.detach \
-text [mc "Detach From Local Branch"] \
-variable @opt_detach
pack $w.options.detach -anchor nw
@ -50,6 +53,7 @@ constructor dialog {} {
bind $w <Visibility> [cb _visible]
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _checkout]\;break
wm deiconify $w
tkwait window $w
}

View File

@ -16,48 +16,48 @@ field opt_fetch 1; # refetch tracking branch if used?
field reset_ok 0; # did the user agree to reset?
constructor dialog {} {
global repo_config
global repo_config use_ttk NS
make_toplevel top w
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
label $w.header -text [mc "Create New Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Create New Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.create -text [mc Create] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.create -text [mc Create] \
-default active \
-command [cb _create]
pack $w.buttons.create -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
labelframe $w.desc -text [mc "Branch Name"]
radiobutton $w.desc.name_r \
-anchor w \
${NS}::labelframe $w.desc -text [mc "Branch Name"]
${NS}::radiobutton $w.desc.name_r \
-text [mc "Name:"] \
-value user \
-variable @name_type
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
set w_name $w.desc.name_t
entry $w_name \
-borderwidth 1 \
-relief sunken \
${NS}::entry $w_name \
-width 40 \
-textvariable @name \
-validate key \
-validatecommand [cb _validate %d %S]
grid $w.desc.name_r $w_name -sticky we -padx {0 5}
radiobutton $w.desc.match_r \
-anchor w \
${NS}::radiobutton $w.desc.match_r \
-text [mc "Match Tracking Branch Name"] \
-value match \
-variable @name_type
if {!$use_ttk} {$w.desc.match_r configure -anchor w}
grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2
grid columnconfigure $w.desc 1 -weight 1
@ -66,34 +66,34 @@ constructor dialog {} {
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
labelframe $w.options -text [mc Options]
${NS}::labelframe $w.options -text [mc Options]
frame $w.options.merge
label $w.options.merge.l -text [mc "Update Existing Branch:"]
${NS}::frame $w.options.merge
${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
pack $w.options.merge.l -side left
radiobutton $w.options.merge.no \
${NS}::radiobutton $w.options.merge.no \
-text [mc No] \
-value none \
-variable @opt_merge
pack $w.options.merge.no -side left
radiobutton $w.options.merge.ff \
${NS}::radiobutton $w.options.merge.ff \
-text [mc "Fast Forward Only"] \
-value ff \
-variable @opt_merge
pack $w.options.merge.ff -side left
radiobutton $w.options.merge.reset \
${NS}::radiobutton $w.options.merge.reset \
-text [mc Reset] \
-value reset \
-variable @opt_merge
pack $w.options.merge.reset -side left
pack $w.options.merge -anchor nw
checkbutton $w.options.fetch \
${NS}::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
checkbutton $w.options.checkout \
${NS}::checkbutton $w.options.checkout \
-text [mc "Checkout After Creation"] \
-variable @opt_checkout
pack $w.options.checkout -anchor nw
@ -109,6 +109,7 @@ constructor dialog {} {
bind $w <Visibility> [cb _visible]
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _create]\;break
wm deiconify $w
tkwait window $w
}

View File

@ -9,41 +9,40 @@ field w_check ; # revision picker for merge test
field w_delete ; # delete button
constructor dialog {} {
global current_branch
global current_branch use_ttk NS
make_toplevel top w
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
label $w.header -text [mc "Delete Local Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Delete Local Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
${NS}::frame $w.buttons
set w_delete $w.buttons.delete
button $w_delete \
${NS}::button $w_delete \
-text [mc Delete] \
-default active \
-state disabled \
-command [cb _delete]
pack $w_delete -side right
button $w.buttons.cancel \
${NS}::button $w.buttons.cancel \
-text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
labelframe $w.list -text [mc "Local Branches"]
${NS}::labelframe $w.list -text [mc "Local Branches"]
set w_heads $w.list.l
listbox $w_heads \
slistbox $w_heads \
-height 10 \
-width 70 \
-selectmode extended \
-exportselection false \
-yscrollcommand [list $w.list.sby set]
scrollbar $w.list.sby -command [list $w.list.l yview]
pack $w.list.sby -side right -fill y
-exportselection false
pack $w.list.l -side left -fill both -expand 1
pack $w.list -fill both -expand 1 -pady 5 -padx 5
@ -67,6 +66,7 @@ constructor dialog {} {
"
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _delete]\;break
wm deiconify $w
tkwait window $w
}

View File

@ -8,9 +8,10 @@ field oldname
field newname
constructor dialog {} {
global current_branch
global current_branch use_ttk NS
make_toplevel top w
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Rename Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
@ -19,27 +20,31 @@ constructor dialog {} {
set oldname $current_branch
set newname [get_config gui.newbranchtemplate]
label $w.header -text [mc "Rename Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Rename Branch"]\
-font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.rename -text [mc Rename] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.rename -text [mc Rename] \
-default active \
-command [cb _rename]
pack $w.buttons.rename -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
frame $w.rename
label $w.rename.oldname_l -text [mc "Branch:"]
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
${NS}::frame $w.rename
${NS}::label $w.rename.oldname_l -text [mc "Branch:"]
if {$use_ttk} {
ttk::combobox $w.rename.oldname_m -textvariable @oldname \
-values [load_all_heads] -state readonly
} else {
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
}
label $w.rename.newname_l -text [mc "New Name:"]
entry $w.rename.newname_t \
-borderwidth 1 \
-relief sunken \
${NS}::label $w.rename.newname_l -text [mc "New Name:"]
${NS}::entry $w.rename.newname_t \
-width 40 \
-textvariable @newname \
-validate key \
@ -60,6 +65,7 @@ constructor dialog {} {
$w.rename.newname_t icursor end
focus $w.rename.newname_t
"
wm deiconify $w
tkwait window $w
}

View File

@ -21,23 +21,23 @@ field browser_busy 1
field ls_buf {}; # Buffered record output from ls-tree
constructor new {commit {path {}}} {
global cursor_ptr M1B
make_toplevel top w
global cursor_ptr M1B use_ttk NS
make_dialog top w
wm withdraw $top
wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
set browser_commit $commit
set browser_path $browser_commit:$path
label $w.path \
${NS}::label $w.path \
-textvariable @browser_path \
-anchor w \
-justify left \
-borderwidth 1 \
-relief sunken \
-font font_uibold
if {!$use_ttk} { $w.path configure -borderwidth 1 -relief sunken}
pack $w.path -anchor w -side top -fill x
frame $w.list
${NS}::frame $w.list
set w_list $w.list.l
text $w_list -background white -foreground black \
-borderwidth 0 \
@ -49,19 +49,18 @@ constructor new {commit {path {}}} {
-xscrollcommand [list $w.list.sbx set] \
-yscrollcommand [list $w.list.sby set]
rmsel_tag $w_list
scrollbar $w.list.sbx -orient h -command [list $w_list xview]
scrollbar $w.list.sby -orient v -command [list $w_list yview]
${NS}::scrollbar $w.list.sbx -orient h -command [list $w_list xview]
${NS}::scrollbar $w.list.sby -orient v -command [list $w_list yview]
pack $w.list.sbx -side bottom -fill x
pack $w.list.sby -side right -fill y
pack $w_list -side left -fill both -expand 1
pack $w.list -side top -fill both -expand 1
label $w.status \
${NS}::label $w.status \
-textvariable @browser_status \
-anchor w \
-justify left \
-borderwidth 1 \
-relief sunken
-justify left
if {!$use_ttk} { $w.status configure -borderwidth 1 -relief sunken}
pack $w.status -anchor w -side bottom -fill x
bind $w_list <Button-1> "[cb _click 0 @%x,%y];break"
@ -78,6 +77,7 @@ constructor new {commit {path {}}} {
bind $w_list <Right> break
bind $w_list <Visibility> [list focus $w_list]
wm deiconify $top
set w $w_list
if {$path ne {}} {
_ls $this $browser_commit:$path $path
@ -263,23 +263,27 @@ field w ; # widget path
field w_rev ; # mega-widget to pick the initial revision
constructor dialog {} {
make_toplevel top w
global use_ttk NS
make_dialog top w
wm withdraw $top
wm title $top [append "[appname] ([reponame]): " [mc "Browse Branch Files"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
wm transient $top .
}
label $w.header \
${NS}::label $w.header \
-text [mc "Browse Branch Files"] \
-font font_uibold
-font font_uibold \
-anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.browse -text [mc Browse] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.browse -text [mc Browse] \
-default active \
-command [cb _open]
pack $w.buttons.browse -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@ -291,6 +295,7 @@ constructor dialog {} {
bind $w <Visibility> [cb _visible]
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _open]\;break
wm deiconify $top
tkwait window $w
}

View File

@ -17,6 +17,7 @@ variable all_families [list] ; # All fonts known to Tk
constructor pick {path title a_family a_size} {
variable all_families
global use_ttk NS
set v_family $a_family
set v_size $a_size
@ -27,29 +28,30 @@ constructor pick {path title a_family a_size} {
set f_family $pv_family
set f_size $pv_size
make_toplevel top w
make_dialog top w
wm withdraw $top
wm title $top "[appname] ([reponame]): $title"
wm geometry $top "+[winfo rootx $path]+[winfo rooty $path]"
label $w.header -text $title -font font_uibold
${NS}::label $w.header -text $title -font font_uibold -anchor center
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.select \
${NS}::frame $w.buttons
${NS}::button $w.buttons.select \
-text [mc Select] \
-default active \
-command [cb _select]
button $w.buttons.cancel \
${NS}::button $w.buttons.cancel \
-text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.select -side right
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
frame $w.inner
${NS}::frame $w.inner
frame $w.inner.family
label $w.inner.family.l \
${NS}::frame $w.inner.family
${NS}::label $w.inner.family.l \
-text [mc "Font Family"] \
-anchor w
set w_family $w.inner.family.v
@ -64,16 +66,16 @@ constructor pick {path title a_family a_size} {
-height 10 \
-yscrollcommand [list $w.inner.family.sby set]
rmsel_tag $w_family
scrollbar $w.inner.family.sby -command [list $w_family yview]
${NS}::scrollbar $w.inner.family.sby -command [list $w_family yview]
pack $w.inner.family.l -side top -fill x
pack $w.inner.family.sby -side right -fill y
pack $w_family -fill both -expand 1
frame $w.inner.size
label $w.inner.size.l \
${NS}::frame $w.inner.size
${NS