0
A
回答
1
從Bag of TK algorithms並且在這種google mailing list thread討論:
toplevel .child
set parent .
set child .child
# This should display $child centered in $parent
set w [winfo width $parent]
set h [winfo height $parent]
set x [winfo rootx $parent]
set y [winfo rooty $parent]
set xpos "+[ expr {$x+($w-[winfo width $child])/2}]"
set ypos "+[ expr {$y+($h-[winfo height $child])/2}]"
wm geometry $child "$xpos$ypos"
相關問題
- 1. 使HTML5畫布的行爲像TclTK畫布的縮放/翻譯?
- 2. TclTk從帆布
- 3. 畫布 - 如何中心ontop
- 4. 中心圖像內畫布
- 5. WPF:畫布中的中心TextBlock
- 6. 畫布中的中心圖像
- 7. HTML中心一個div內畫布而不拉伸的畫布
- 8. 在畫布中心在公共無效onDraw(畫布畫布)的縮放位圖
- 9. 獲取畫布的中心點
- 10. HTML5適合畫布的中心內容
- 11. 更改html5畫布的視圖「中心」
- 12. 縮放畫布和保持中心
- 13. 在畫布中心繪製圓圈
- 14. 潘畫布,使點(x,y)在中心
- 15. 畫布中心等軸測圖?
- 16. 錯誤,當我嘗試中心畫布
- 17. 縮放畫布,同時保持中心
- 18. R中的TclTk對象
- 19. HTML5畫布,我的圓弧畫出中心的起點線
- 20. Android中的畫布滾動中的中心固定文本
- 21. 畫中心圓
- 22. 在畫布中獲取我的文本輸入的中心
- 23. 在flex中粘貼複製的形狀在畫布的中心
- 24. 在畫布上畫一顆心
- 25. 畫布畫中心,擦除不能正常工作
- 26. 在中心畫布上畫圓圈並旋轉視圖
- 27. 放大和縮小到畫布中的視口中心
- 28. 居中動畫視圖在頂部中心的相對佈局
- 29. 綁定到wpf畫布中的子元素中心
- 30. 如何在Android中的畫布內對齊位圖中心?