17 proc createToplevel { {w} {closeto ""} } {
19 if { [
winfo exists $w] } {
21 if {$docked_nb ne ""} {
26 return "already_exists"
29 set f ".fdock[
string range $w 1 end]"
31 toplevel $w -use [
winfo id $f]
35 if {![
info exists ::winGeometry($f)]} {
36 set ::winGeometry($f) ""
46 proc createToplevelFinalize {w} {
47 bind $w <Destroy> "+if {\[string equal $w %W\]} {
48 cleanup_todo_remove $w
51 proc cleanup_todo_remove { w } {
52 set dockw ".fdock[
string range $w 1 end]"
58 after idle "if {[
winfo exists $dockw]} { destroy $dockw }"
65 proc recordWinSize {win} {
66 global winWidth winHeight winX winY
67 if {![
winfo exists $win]} {
return}
68 set temp [
wm geometry $win]
71 set n [
scan $temp "%dx%d+%d+%d" width height x y]
73 set winWidth${suffix}($win) $width
74 set winHeight${suffix}($win) $height
75 set winX${suffix}($win) $x
76 set winY${suffix}($win) $y
80 proc setWinLocation {win} {
83 if {[
info exists winX${suffix}($win)] && [
info exists winY${suffix}($win)] && \
84 [
set winX${suffix}($win)] >= 0 && [
set winY${suffix}($win)] >= 0} {
85 catch [list wm geometry $win "+[
set winX${suffix}($win)]+[
set winY${suffix}($win)]"]
89 proc setWinSize {win} {
90 global winWidth winHeight
92 if {[
info exists winWidth${suffix}($win)] && [
info exists winHeight${suffix}($win)] && \
93 [
set winWidth${suffix}($win)] > 0 && [
set winHeight${suffix}($win)] > 0 } {
94 catch [list wm geometry $win "[
set winWidth${suffix}($win)]x[
set winHeight${suffix}($win)]"]