summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/linux-build.yml4
-rw-r--r--.github/workflows/linux-with-tcl8-build.yml (renamed from .github/workflows/linux-with-tcl86-build.yml)9
-rw-r--r--.github/workflows/linux-with-tcl91-build.yml (renamed from .github/workflows/linux-with-tcl9-build.yml)7
-rw-r--r--.github/workflows/mac-build.yml8
-rw-r--r--.github/workflows/onefiledist.yml14
-rw-r--r--.github/workflows/win-build.yml9
-rw-r--r--.project2
-rw-r--r--README.md4
-rw-r--r--changes.md4
-rw-r--r--doc/3DBorder.378
-rw-r--r--doc/AddOption.31
-rw-r--r--doc/BindTable.319
-rw-r--r--doc/CanvPsY.35
-rw-r--r--doc/CanvTkwin.33
-rw-r--r--doc/CanvTxtInfo.33
-rw-r--r--doc/Clipboard.31
-rw-r--r--doc/ClrSelect.31
-rw-r--r--doc/ConfigWidg.391
-rw-r--r--doc/ConfigWind.31
-rw-r--r--doc/CoordToWin.31
-rw-r--r--doc/CrtCmHdlr.31
-rw-r--r--doc/CrtConsoleChan.31
-rw-r--r--doc/CrtErrHdlr.31
-rw-r--r--doc/CrtGenHdlr.31
-rw-r--r--doc/CrtImgType.345
-rw-r--r--doc/CrtItemType.344
-rw-r--r--doc/CrtPhImgFmt.388
-rw-r--r--doc/CrtSelHdlr.37
-rw-r--r--doc/CrtWindow.31
-rw-r--r--doc/DeleteImg.31
-rw-r--r--doc/DrawFocHlt.33
-rw-r--r--doc/EventHndlr.31
-rw-r--r--doc/FindPhoto.33
-rw-r--r--doc/FontId.39
-rw-r--r--doc/FreeXId.330
-rw-r--r--doc/GeomReq.313
-rw-r--r--doc/GetAnchor.37
-rw-r--r--doc/GetBitmap.399
-rw-r--r--doc/GetCapStyl.35
-rw-r--r--doc/GetClrmap.37
-rw-r--r--doc/GetColor.319
-rw-r--r--doc/GetCursor.321
-rw-r--r--doc/GetFont.319
-rw-r--r--doc/GetGC.33
-rw-r--r--doc/GetHINSTANCE.31
-rw-r--r--doc/GetHWND.31
-rw-r--r--doc/GetImage.31
-rw-r--r--doc/GetJoinStl.35
-rw-r--r--doc/GetJustify.316
-rw-r--r--doc/GetOption.31
-rw-r--r--doc/GetPixels.326
-rw-r--r--doc/GetPixmap.35
-rw-r--r--doc/GetRelief.37
-rw-r--r--doc/GetRootCrd.31
-rw-r--r--doc/GetScroll.37
-rw-r--r--doc/GetSelect.31
-rw-r--r--doc/GetUid.31
-rw-r--r--doc/GetVRoot.33
-rw-r--r--doc/GetVisual.38
-rw-r--r--doc/Grab.32
-rw-r--r--doc/HWNDToWindow.31
-rw-r--r--doc/HandleEvent.31
-rw-r--r--doc/IdToWindow.31
-rw-r--r--doc/ImgChanged.31
-rw-r--r--doc/Inactive.35
-rw-r--r--doc/InternAtom.35
-rw-r--r--doc/MainLoop.31
-rw-r--r--doc/MainWin.35
-rw-r--r--doc/MaintGeom.31
-rw-r--r--doc/ManageGeom.31
-rw-r--r--doc/MapWindow.31
-rw-r--r--doc/MeasureChar.316
-rw-r--r--doc/MoveToplev.33
-rw-r--r--doc/Name.31
-rw-r--r--doc/NameOfImg.31
-rw-r--r--doc/OwnSelect.31
-rw-r--r--doc/ParseArgv.368
-rw-r--r--doc/QWinEvent.31
-rw-r--r--doc/Restack.31
-rw-r--r--doc/RestrictEv.31
-rw-r--r--doc/SetAppName.31
-rw-r--r--doc/SetCaret.31
-rw-r--r--doc/SetClass.31
-rw-r--r--doc/SetClassProcs.33
-rw-r--r--doc/SetGrid.31
-rw-r--r--doc/SetOptions.3152
-rw-r--r--doc/SetVisual.33
-rw-r--r--doc/StrictMotif.31
-rw-r--r--doc/TextLayout.329
-rw-r--r--doc/TkInitStubs.31
-rw-r--r--doc/Tk_Init.310
-rw-r--r--doc/Tk_Main.32
-rw-r--r--doc/WinUtil.39
-rw-r--r--doc/WindowId.33
-rw-r--r--doc/bind.n13
-rw-r--r--doc/bitmap.n12
-rw-r--r--doc/busy.n26
-rw-r--r--doc/button.n22
-rw-r--r--doc/canvas.n284
-rw-r--r--doc/checkbutton.n26
-rw-r--r--doc/chooseColor.n14
-rw-r--r--doc/chooseDirectory.n30
-rw-r--r--doc/clipboard.n17
-rw-r--r--doc/colors.n3
-rw-r--r--doc/console.n19
-rw-r--r--doc/cursors.n2
-rw-r--r--doc/dialog.n18
-rw-r--r--doc/entry.n57
-rw-r--r--doc/event.n84
-rw-r--r--doc/focus.n22
-rw-r--r--doc/focusNext.n7
-rw-r--r--doc/font.n85
-rw-r--r--doc/fontchooser.n43
-rw-r--r--doc/frame.n6
-rw-r--r--doc/getOpenFile.n37
-rw-r--r--doc/grab.n18
-rw-r--r--doc/grid.n114
-rw-r--r--doc/image.n27
-rw-r--r--doc/label.n26
-rw-r--r--doc/labelframe.n22
-rw-r--r--doc/listbox.n54
-rw-r--r--doc/loadTk.n6
-rw-r--r--doc/menu.n88
-rw-r--r--doc/menubutton.n4
-rw-r--r--doc/message.n4
-rw-r--r--doc/messageBox.n61
-rw-r--r--doc/nsimage.n52
-rw-r--r--doc/option.n20
-rw-r--r--doc/options.n4
-rw-r--r--doc/pack.n82
-rw-r--r--doc/palette.n4
-rw-r--r--doc/panedwindow.n51
-rw-r--r--doc/photo.n241
-rw-r--r--doc/place.n48
-rw-r--r--doc/popup.n6
-rw-r--r--doc/radiobutton.n17
-rw-r--r--doc/raise.n10
-rw-r--r--doc/scale.n14
-rw-r--r--doc/scrollbar.n39
-rw-r--r--doc/selection.n55
-rw-r--r--doc/send.n10
-rw-r--r--doc/spinbox.n76
-rw-r--r--doc/sysnotify.n7
-rw-r--r--doc/systray.n9
-rw-r--r--doc/text.n135
-rw-r--r--doc/tk.n14
-rw-r--r--doc/tk_mac.n34
-rw-r--r--doc/tkerror.n6
-rw-r--r--doc/tkvars.n10
-rw-r--r--doc/tkwait.n7
-rw-r--r--doc/toplevel.n4
-rw-r--r--doc/ttk_panedwindow.n2
-rw-r--r--doc/ttk_scrollbar.n2
-rw-r--r--doc/ttk_treeview.n16
-rw-r--r--doc/winfo.n106
-rw-r--r--doc/wish.139
-rw-r--r--doc/wm.n141
-rw-r--r--generic/tk.decls88
-rw-r--r--generic/tk.h189
-rw-r--r--generic/tkBind.c4
-rw-r--r--generic/tkCanvArc.c4
-rw-r--r--generic/tkCanvBmap.c4
-rw-r--r--generic/tkCanvImg.c4
-rw-r--r--generic/tkCanvLine.c8
-rw-r--r--generic/tkCanvPoly.c4
-rw-r--r--generic/tkCanvPs.c4
-rw-r--r--generic/tkCanvText.c20
-rw-r--r--generic/tkCanvWind.c4
-rw-r--r--generic/tkCanvas.c129
-rw-r--r--generic/tkCmds.c8
-rw-r--r--generic/tkConsole.c4
-rw-r--r--generic/tkDList.h4
-rw-r--r--generic/tkDecls.h185
-rw-r--r--generic/tkEntry.c24
-rw-r--r--generic/tkFont.c41
-rw-r--r--generic/tkFrame.c70
-rw-r--r--generic/tkIcu.c2
-rw-r--r--generic/tkImage.c23
-rw-r--r--generic/tkImgBmap.c2
-rw-r--r--generic/tkImgPhoto.c247
-rw-r--r--generic/tkInt.decls469
-rw-r--r--generic/tkInt.h86
-rw-r--r--generic/tkIntDecls.h164
-rw-r--r--generic/tkIntPlatDecls.h270
-rw-r--r--generic/tkIntXlibDecls.h795
-rw-r--r--generic/tkMain.c24
-rw-r--r--generic/tkMenu.c6
-rw-r--r--generic/tkMenu.h2
-rw-r--r--generic/tkMenuDraw.c4
-rw-r--r--generic/tkMessage.c57
-rw-r--r--generic/tkObj.c29
-rw-r--r--generic/tkOldConfig.c30
-rw-r--r--generic/tkOldTest.c416
-rw-r--r--generic/tkPack.c365
-rw-r--r--generic/tkPkgConfig.c57
-rw-r--r--generic/tkPlatDecls.h22
-rw-r--r--generic/tkRectOval.c6
-rw-r--r--generic/tkScrollbar.c64
-rw-r--r--generic/tkScrollbar.h19
-rw-r--r--generic/tkSelect.c6
-rw-r--r--generic/tkSquare.c29
-rw-r--r--generic/tkStubInit.c436
-rw-r--r--generic/tkTest.c10
-rw-r--r--generic/tkText.c64
-rw-r--r--generic/tkText.h68
-rw-r--r--generic/tkTextDisp.c16
-rw-r--r--generic/tkTextIndex.c29
-rw-r--r--generic/tkTextMark.c38
-rw-r--r--generic/tkTextTag.c324
-rw-r--r--generic/tkUtil.c72
-rw-r--r--generic/tkWindow.c78
-rw-r--r--generic/ttk/ttk.decls4
-rw-r--r--generic/ttk/ttkClamTheme.c25
-rw-r--r--generic/ttk/ttkClassicTheme.c40
-rw-r--r--generic/ttk/ttkDecls.h13
-rw-r--r--generic/ttk/ttkDefaultTheme.c14
-rw-r--r--generic/ttk/ttkElements.c34
-rw-r--r--generic/ttk/ttkEntry.c32
-rw-r--r--generic/ttk/ttkInit.c10
-rw-r--r--generic/ttk/ttkLabel.c8
-rw-r--r--generic/ttk/ttkNotebook.c14
-rw-r--r--generic/ttk/ttkProgress.c4
-rw-r--r--generic/ttk/ttkStubInit.c4
-rw-r--r--generic/ttk/ttkTheme.h3
-rw-r--r--generic/ttk/ttkThemeInt.h6
-rw-r--r--generic/ttk/ttkTreeview.c45
-rw-r--r--generic/ttk/ttkWidget.c2
-rw-r--r--library/demos/anilabel.tcl2
-rw-r--r--library/demos/aniwave.tcl2
-rw-r--r--library/demos/arrow.tcl2
-rw-r--r--library/demos/bind.tcl2
-rw-r--r--library/demos/bitmap.tcl2
-rw-r--r--library/demos/browse2
-rw-r--r--library/demos/button.tcl2
-rw-r--r--library/demos/check.tcl2
-rw-r--r--library/demos/clrpick.tcl2
-rw-r--r--library/demos/colors.tcl2
-rw-r--r--library/demos/combo.tcl2
-rw-r--r--library/demos/cscroll.tcl2
-rw-r--r--library/demos/ctext.tcl2
-rw-r--r--library/demos/entry1.tcl2
-rw-r--r--library/demos/entry2.tcl2
-rw-r--r--library/demos/entry3.tcl2
-rw-r--r--library/demos/filebox.tcl2
-rw-r--r--library/demos/floor.tcl2
-rw-r--r--library/demos/fontchoose.tcl2
-rw-r--r--library/demos/form.tcl2
-rw-r--r--library/demos/goldberg.tcl2
-rw-r--r--library/demos/hello2
-rw-r--r--library/demos/hscale.tcl2
-rw-r--r--library/demos/icon.tcl2
-rw-r--r--library/demos/image1.tcl2
-rw-r--r--library/demos/image2.tcl2
-rw-r--r--library/demos/items.tcl2
-rw-r--r--library/demos/ixset2
-rw-r--r--library/demos/knightstour.tcl2
-rw-r--r--library/demos/label.tcl2
-rw-r--r--library/demos/labelframe.tcl2
-rw-r--r--library/demos/mac_styles.tcl16
-rw-r--r--library/demos/mac_tabs.tcl3
-rw-r--r--library/demos/mac_wm.tcl3
-rw-r--r--library/demos/mclist.tcl2
-rw-r--r--library/demos/menu.tcl2
-rw-r--r--library/demos/menubu.tcl2
-rw-r--r--library/demos/msgbox.tcl2
-rw-r--r--library/demos/paned1.tcl2
-rw-r--r--library/demos/paned2.tcl2
-rw-r--r--library/demos/pendulum.tcl2
-rw-r--r--library/demos/plot.tcl2
-rw-r--r--library/demos/puzzle.tcl2
-rw-r--r--library/demos/radio.tcl2
-rw-r--r--library/demos/rmt2
-rw-r--r--library/demos/rolodex2
-rw-r--r--library/demos/ruler.tcl2
-rw-r--r--library/demos/sayings.tcl2
-rw-r--r--library/demos/search.tcl2
-rw-r--r--library/demos/spin.tcl2
-rw-r--r--library/demos/states.tcl2
-rw-r--r--library/demos/style.tcl2
-rw-r--r--library/demos/tcolor2
-rw-r--r--library/demos/text.tcl2
-rw-r--r--library/demos/textpeer.tcl2
-rw-r--r--library/demos/timer2
-rw-r--r--library/demos/toolbar.tcl2
-rw-r--r--library/demos/tree.tcl2
-rw-r--r--library/demos/ttkbut.tcl2
-rw-r--r--library/demos/ttkmenu.tcl2
-rw-r--r--library/demos/ttknote.tcl2
-rw-r--r--library/demos/ttkpane.tcl2
-rw-r--r--library/demos/ttkprogress.tcl2
-rw-r--r--library/demos/ttkscale.tcl2
-rw-r--r--library/demos/ttkspin.tcl2
-rw-r--r--library/demos/twind.tcl2
-rw-r--r--library/demos/unicodeout.tcl2
-rw-r--r--library/demos/vscale.tcl2
-rw-r--r--library/demos/widget2
-rw-r--r--library/menu.tcl27
-rw-r--r--library/obsolete.tcl178
-rw-r--r--library/palette.tcl27
-rw-r--r--library/tclIndex493
-rw-r--r--library/tearoff.tcl12
-rw-r--r--library/tk.tcl8
-rw-r--r--library/ttk/clamTheme.tcl6
-rw-r--r--library/unsupported.tcl269
-rw-r--r--macosx/README6
-rw-r--r--macosx/Tk.xcodeproj/project.pbxproj4
-rw-r--r--macosx/tkMacOSXClipboard.c4
-rw-r--r--macosx/tkMacOSXColor.c52
-rw-r--r--macosx/tkMacOSXColor.h4
-rw-r--r--macosx/tkMacOSXDefault.h6
-rw-r--r--macosx/tkMacOSXDraw.c191
-rw-r--r--macosx/tkMacOSXEmbed.c10
-rw-r--r--macosx/tkMacOSXEvent.c16
-rw-r--r--macosx/tkMacOSXFileTypes.c6
-rw-r--r--macosx/tkMacOSXFont.c38
-rw-r--r--macosx/tkMacOSXHLEvents.c90
-rw-r--r--macosx/tkMacOSXImage.c102
-rw-r--r--macosx/tkMacOSXInit.c78
-rw-r--r--macosx/tkMacOSXKeyEvent.c22
-rw-r--r--macosx/tkMacOSXKeyboard.c6
-rw-r--r--macosx/tkMacOSXMenu.c11
-rw-r--r--macosx/tkMacOSXMenubutton.c236
-rw-r--r--macosx/tkMacOSXMenus.c20
-rw-r--r--macosx/tkMacOSXMouseEvent.c9
-rw-r--r--macosx/tkMacOSXNotify.c60
-rw-r--r--macosx/tkMacOSXPrint.c208
-rw-r--r--macosx/tkMacOSXPrivate.h34
-rw-r--r--macosx/tkMacOSXScale.c8
-rw-r--r--macosx/tkMacOSXSubwindows.c139
-rw-r--r--macosx/tkMacOSXSysTray.c30
-rw-r--r--macosx/tkMacOSXTest.c63
-rw-r--r--macosx/tkMacOSXWindowEvent.c287
-rw-r--r--macosx/tkMacOSXWm.c299
-rw-r--r--macosx/tkMacOSXXStubs.c8
-rw-r--r--macosx/ttkMacOSXTheme.c116
-rw-r--r--macosx/ttkMacOSXTheme.h2
-rw-r--r--tests/bevel.tcl4
-rw-r--r--tests/bind.test6
-rw-r--r--tests/butGeom2.tcl4
-rw-r--r--tests/button.test6
-rw-r--r--tests/canvImg.test2
-rw-r--r--tests/canvas.test7
-rw-r--r--tests/clrpick.test2
-rw-r--r--tests/cluster.test2
-rw-r--r--tests/config.test10
-rw-r--r--tests/constraints.tcl18
-rw-r--r--tests/event.test319
-rw-r--r--tests/focus.test6
-rw-r--r--tests/font.test13
-rw-r--r--tests/image.test4
-rw-r--r--tests/imgPPM.test5
-rw-r--r--tests/imgPhoto.test6
-rw-r--r--tests/menu.test98
-rw-r--r--tests/menuDraw.test2
-rw-r--r--tests/message.test2
-rw-r--r--tests/pack.test14
-rw-r--r--tests/panedwindow.test2
-rw-r--r--tests/raise.test1
-rw-r--r--tests/scrollbar.test28
-rw-r--r--tests/textDisp.test12
-rw-r--r--tests/textTag.test18
-rw-r--r--tests/ttk/checkbutton.test2
-rw-r--r--tests/ttk/entry.test4
-rw-r--r--tests/ttk/panedwindow.test2
-rw-r--r--tests/ttk/scale.test2
-rw-r--r--tests/ttk/scrollbar.test2
-rw-r--r--tests/ttk/treetags.test6
-rw-r--r--tests/ttk/treeview.test57
-rw-r--r--tests/ttk/ttk.test5
-rw-r--r--tests/unixWm.test60
-rw-r--r--tests/visual_bb.test2
-rw-r--r--tests/window.test3
-rw-r--r--tests/winfo.test2
-rw-r--r--tests/wm.test2
-rw-r--r--tests/xmfbox.test7
-rw-r--r--unix/Makefile.in17
-rwxr-xr-xunix/configure180
-rw-r--r--unix/configure.ac27
-rw-r--r--unix/tcl.m438
-rw-r--r--unix/tk.spec6
-rw-r--r--unix/tkAppInit.c19
-rw-r--r--unix/tkConfig.h.in18
-rw-r--r--unix/tkUnix.c2
-rw-r--r--unix/tkUnixDefault.h6
-rw-r--r--unix/tkUnixFont.c246
-rw-r--r--unix/tkUnixKey.c2
-rw-r--r--unix/tkUnixMenu.c6
-rw-r--r--unix/tkUnixPort.h9
-rw-r--r--unix/tkUnixRFont.c4
-rw-r--r--win/Makefile.in6
-rw-r--r--win/README2
-rwxr-xr-xwin/configure43
-rw-r--r--win/configure.ac27
-rw-r--r--win/makefile.vc6
-rw-r--r--win/rc/tktest.rc8
-rw-r--r--win/tcl.m48
-rw-r--r--win/tkWinDefault.h6
-rw-r--r--win/tkWinDialog.c6
-rw-r--r--win/tkWinFont.c10
-rw-r--r--win/tkWinGDI.c26
-rw-r--r--win/tkWinKey.c4
-rw-r--r--win/tkWinMenu.c12
-rw-r--r--win/tkWinPort.h9
-rw-r--r--win/tkWinWm.c36
-rw-r--r--win/tkWinX.c2
-rw-r--r--win/ttkWinTheme.c4
-rw-r--r--win/ttkWinXPTheme.c8
-rw-r--r--win/winMain.c19
-rw-r--r--xlib/X11/keysymdef.h24
409 files changed, 6130 insertions, 7812 deletions
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
index 98fe4ca..ee5d2e7 100644
--- a/.github/workflows/linux-build.yml
+++ b/.github/workflows/linux-build.yml
@@ -39,7 +39,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
@@ -143,7 +143,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
diff --git a/.github/workflows/linux-with-tcl86-build.yml b/.github/workflows/linux-with-tcl8-build.yml
index ba83125..557b0e9 100644
--- a/.github/workflows/linux-with-tcl86-build.yml
+++ b/.github/workflows/linux-with-tcl8-build.yml
@@ -1,4 +1,4 @@
-name: Linux (with Tcl 8.6)
+name: Linux (with Tcl 8.7)
on:
push:
branches:
@@ -26,6 +26,7 @@ jobs:
cfgopt:
- ""
- "CFLAGS=-DTK_NO_DEPRECATED=1"
+ - "--disable-shared"
- "--disable-xft"
- "--disable-xss"
- "--enable-symbols"
@@ -38,7 +39,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-6-branch
+ ref: core-8-branch
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
@@ -69,7 +70,7 @@ jobs:
working-directory: tcl/unix
- name: Configure (opts=${{ matrix.cfgopt }})
run: |
- ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH --disable-zipfs "--prefix=$HOME/install dir" || {
+ ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || {
cat config.log
echo "::error::Failure during Configure"
exit 1
@@ -123,7 +124,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-6-branch
+ ref: core-8-branch
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl91-build.yml
index 323b314..4672b54 100644
--- a/.github/workflows/linux-with-tcl9-build.yml
+++ b/.github/workflows/linux-with-tcl91-build.yml
@@ -1,4 +1,4 @@
-name: Linux (with Tcl 9.0)
+name: Linux (with Tcl 9.1)
on:
push:
branches:
@@ -26,6 +26,7 @@ jobs:
cfgopt:
- ""
- "CFLAGS=-DTK_NO_DEPRECATED=1"
+ - "--disable-shared"
- "--disable-xft"
- "--disable-xss"
- "--enable-symbols"
@@ -38,7 +39,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: main
+ ref: tip-626
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
@@ -123,7 +124,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: main
+ ref: tip-626
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml
index b945ab7..2b7fede 100644
--- a/.github/workflows/mac-build.yml
+++ b/.github/workflows/mac-build.yml
@@ -23,11 +23,11 @@ jobs:
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl
+ - name: Check out Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Prepare checked out repositories
run: |
@@ -75,11 +75,11 @@ jobs:
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl
+ - name: Check out Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Prepare checked out repositories
env:
diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml
index 4104ed2..0fbbdfd 100644
--- a/.github/workflows/onefiledist.yml
+++ b/.github/workflows/onefiledist.yml
@@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl 8.7
+ - name: Checkout Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Setup Environment
run: |
@@ -58,7 +58,7 @@ jobs:
# TODO: need the Tk version separately for distro naming below
- name: Package
run: |
- cp bin/wish8.7 ${BUILD_NAME}
+ cp bin/wish9.0 ${BUILD_NAME}
chmod +x ${BUILD_NAME}
tar -cf ${BUILD_NAME}.tar ${BUILD_NAME}
working-directory: ${{ env.INST_DIR }}
@@ -88,11 +88,11 @@ jobs:
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl 8.7
+ - name: Checkout Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Checkout create-dmg
uses: actions/checkout@v4
@@ -176,11 +176,11 @@ jobs:
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl 8.7
+ - name: Checkout Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Setup Environment
run: |
diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml
index 2161add..8e90256 100644
--- a/.github/workflows/win-build.yml
+++ b/.github/workflows/win-build.yml
@@ -24,18 +24,17 @@ jobs:
config:
- ""
- "OPTS=symbols"
- - "OPTS=symbols STATS=compdbg,memdbg"
- "OPTS=static"
steps:
- name: Checkout Tk
uses: actions/checkout@v4
with:
path: tk
- - name: Checkout Tcl 8.7
+ - name: Checkout Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Init MSVC
uses: ilammy/msvc-dev-cmd@v1
@@ -121,11 +120,11 @@ jobs:
install: git mingw-w64-x86_64-toolchain make zip
- name: Checkout Tk
uses: actions/checkout@v4
- - name: Checkout Tcl 8.7
+ - name: Checkout Tcl 9.0
uses: actions/checkout@v4
with:
repository: tcltk/tcl
- ref: core-8-branch
+ ref: main
path: tcl
- name: Prepare
run: |
diff --git a/.project b/.project
index cc5f605..0d24f11 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>tk8.7</name>
+ <name>tk9.0</name>
<comment></comment>
<projects>
</projects>
diff --git a/README.md b/README.md
index ec8b931..adb76b5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# README: Tk
-This is the **Tk 8.7b1** source distribution.
+This is the **Tk 9.0b3** source distribution.
You can get any source release of Tk from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
@@ -25,7 +25,7 @@ This directory contains the sources and documentation for Tk, a
cross-platform GUI toolkit implemented with the Tcl scripting language.
For details on features, incompatibilities, and potential problems with
-this release, see [the Tcl/Tk 8.7 Web page](https://www.tcl-lang.org/software/tcltk/8.7.html)
+this release, see [the Tcl/Tk 9.0 Web page](https://www.tcl-lang.org/software/tcltk/9.0.html)
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
diff --git a/changes.md b/changes.md
index 220ffd1..23674a4 100644
--- a/changes.md
+++ b/changes.md
@@ -4,9 +4,9 @@ changes to the Tk source code at
> [Tk Source Code](https://core.tcl-lang.org/tk/)
-Release Tk 8.7b1 arises from the check-in with tag core-8-7-b1.
+Release Tk 9.0b3 arises from the check-in with tag core-9-0-b3.
-Highlighted differences between Tk 8.7 and Tk 8.6 are summarized below,
+Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below,
with focus on changes important to programmers using the Tk library and
writing Tcl scripts containing Tk commands.
diff --git a/doc/3DBorder.3 b/doc/3DBorder.3
index a6deb30..d609d6d 100644
--- a/doc/3DBorder.3
+++ b/doc/3DBorder.3
@@ -13,58 +13,49 @@ Tk_Alloc3DBorderFromObj, Tk_ClipDrawableToRect, Tk_DrawHighlightBorder, Tk_Get3D
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
-.sp
+
Tk_3DBorder
-\fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR
+\fBTk_Alloc3DBorderFromObj\fR(\fIinterp, tkwin, objPtr\fR)
.sp
-void
-\fBTk_ClipDrawableToRect(\fIdisplay, drawable, x, y, width, height\fB)\fR
+\fBTk_ClipDrawableToRect\fR(\fIdisplay, drawable, x, y, width, height\fR)
.sp
-void
-\fBTk_DrawHighlightBorder(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fB)\fR
+\fBTk_DrawHighlightBorder\fR(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fR)
.sp
Tk_3DBorder
-\fBTk_Get3DBorder(\fIinterp, tkwin, colorName\fB)\fR
+\fBTk_Get3DBorder\fR(\fIinterp, tkwin, colorName\fR)
.sp
-void
-\fBTk_Get3DBorderColors(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fB)\fR
+\fBTk_Get3DBorderColors\fR(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fR)
.sp
Tk_3DBorder
-\fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_Get3DBorderFromObj\fR(\fItkwin, objPtr\fR)
.sp
-void
-\fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR
+\fBTk_Draw3DRectangle\fR(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fR)
.sp
-void
-\fBTk_Fill3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR
+\fBTk_Fill3DRectangle\fR(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fR)
.sp
-void
-\fBTk_Draw3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR
+\fBTk_Draw3DPolygon\fR(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fR)
.sp
-void
-\fBTk_Fill3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR
+\fBTk_Fill3DPolygon\fR(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fR)
.sp
-void
-\fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fB)\fR
+\fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fR)
.sp
-void
-\fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fB)\fR
+\fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fR)
.sp
-void
-\fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR
+\fBTk_SetBackgroundFromBorder\fR(\fItkwin, border\fR)
.sp
const char *
-\fBTk_NameOf3DBorder(\fIborder\fB)\fR
+\fBTk_NameOf3DBorder\fR(\fIborder\fR)
.sp
XColor *
-\fBTk_3DBorderColor(\fIborder\fB)\fR
+\fBTk_3DBorderColor\fR(\fIborder\fR)
.sp
GC *
-\fBTk_3DBorderGC(\fItkwin, border, which\fB)\fR
+\fBTk_3DBorderGC\fR(\fItkwin, border, which\fR)
.sp
-\fBTk_Free3DBorderFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_Free3DBorderFromObj\fR(\fItkwin, objPtr\fR)
.sp
-\fBTk_Free3DBorder(\fIborder\fB)\fR
+\fBTk_Free3DBorder\fR(\fIborder\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_3DBorder" borderWidth
.AP Tcl_Interp *interp in
@@ -100,7 +91,8 @@ Width of border in pixels. Positive means border is inside rectangle
given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means
border is outside rectangle.
.AP int highlightWidth in
-Width of ring around the outside of the widget if the widget has received the input focus.
+Width of ring around the outside of the widget if the widget has received the
+input focus.
.AP int relief in
Indicates 3-D position of interior of value relative to exterior;
should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR,
@@ -147,9 +139,11 @@ Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR.
.AP XColor *bgColorPtr out
Pointer to location in which to store the background color of the given border.
.AP XColor *darkColorPtr out
-Pointer to location in which to store the color for darker areas of the given border.
+Pointer to location in which to store the color for darker areas of the
+given border.
.AP XColor *lightColorPtr out
-Pointer to location in which to store the color for lighter areas of the given border.
+Pointer to location in which to store the color for lighter areas of the
+given border.
.AP GC fgGC in
Foreground X graphics context.
.AP GC fgGC in
@@ -180,12 +174,15 @@ information about the return value in \fIobjPtr\fR, which speeds up
future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
.PP
-\fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable d to the given rectangle. If width or height are negative, reset to no clipping.
-Subsequent drawing into d is offset and clipped as specified.
-The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at compile time.
+\fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable \fId\fR
+to the given rectangle. If \fIwidth\fR or \fIheight\fR are negative, reset
+to no clipping.
+Subsequent drawing into \fId\fR is offset and clipped as specified.
+The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at
+compile time.
.PP
-\fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of a widget
-to indicate that it has received the input focus.
+\fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of
+a widget to indicate that it has received the input focus.
On the Macintosh, this puts a 1 pixel border in the bgGC color between
the widget and the focus ring, except in the case where highlightWidth
is 1, in which case the border is left out.
@@ -226,8 +223,8 @@ which of several three-dimensional effects is desired:
\fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should
appear raised relative to the exterior of the rectangle, and
\fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed.
-\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should appear to be
-a groove or ridge around the exterior of the rectangle.
+\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should
+appear to be a groove or ridge around the exterior of the rectangle.
.PP
\fBTk_Fill3DRectangle\fR is somewhat like \fBTk_Draw3DRectangle\fR except
that it first fills the rectangular area with the background color
@@ -325,4 +322,5 @@ There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or
\fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR
or \fBTk_Get3DBorder\fR.
.SH KEYWORDS
-3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect
+3D, background, border, color, depressed, illumination, value, polygon,
+raised, shadow, three-dimensional effect
diff --git a/doc/AddOption.3 b/doc/AddOption.3
index fc46492..9d20a55 100644
--- a/doc/AddOption.3
+++ b/doc/AddOption.3
@@ -16,6 +16,7 @@ void
.sp
Tcl_Obj *
\fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR)
+.fi
.SH ARGUMENTS
.AP Tk_Window tkwin in
Token for window.
diff --git a/doc/BindTable.3 b/doc/BindTable.3
index 1d3a85b..960801d 100644
--- a/doc/BindTable.3
+++ b/doc/BindTable.3
@@ -15,24 +15,25 @@ Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding
\fB#include <tk.h>\fR
.sp
Tk_BindingTable
-\fBTk_CreateBindingTable(\fIinterp\fB)\fR
+\fBTk_CreateBindingTable\fR(\fIinterp\fR)
.sp
-\fBTk_DeleteBindingTable(\fIbindingTable\fB)\fR
+\fBTk_DeleteBindingTable\fR(\fIbindingTable\fR)
.sp
unsigned long
-\fBTk_CreateBinding(\fIinterp, bindingTable, object, eventString, script, append\fB)\fR
+\fBTk_CreateBinding\fR(\fIinterp, bindingTable, object, eventString, script, append\fR)
.sp
int
-\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
+\fBTk_DeleteBinding\fR(\fIinterp, bindingTable, object, eventString\fR)
.sp
const char *
-\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
+\fBTk_GetBinding\fR(\fIinterp, bindingTable, object, eventString\fR)
.sp
-\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR
+\fBTk_GetAllBindings\fR(\fIinterp, bindingTable, object\fR)
.sp
-\fBTk_DeleteAllBindings(\fIbindingTable, object\fB)\fR
+\fBTk_DeleteAllBindings\fR(\fIbindingTable, object\fR)
.sp
-\fBTk_BindEvent(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fB)\fR
+\fBTk_BindEvent\fR(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_BindingTable bindingTable
.AP Tcl_Interp *interp in
@@ -55,7 +56,7 @@ X event to match against bindings in \fIbindingTable\fR.
.AP Tk_Window tkwin in
Identifier for any window on the display where the event occurred.
Used to find display-related information such as key maps.
-.AP int numObjects in
+.AP Tcl_Size numObjects in
Number of object identifiers pointed to by \fIobjectPtr\fR.
.AP "void **" objectPtr in
Points to an array of object identifiers: bindings will be considered
diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3
index 1e4e320..5b613fb 100644
--- a/doc/CanvPsY.3
+++ b/doc/CanvPsY.3
@@ -29,8 +29,9 @@ int
.sp
int
\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR)
+.fi
.SH ARGUMENTS
-.AS int "numPoints"
+.AS Tcl_Size "numPoints"
.AP Tk_Canvas canvas in
A token that identifies a canvas widget for which Postscript is
being generated.
@@ -58,7 +59,7 @@ Pointer to an array of coordinates for one or more
points specified in canvas coordinates.
The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3,
and so on.
-.AP int numPoints in
+.AP Tcl_Size numPoints in
Number of points at \fIcoordPtr\fR.
.BE
.SH DESCRIPTION
diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3
index 5cb29fa..0862d82 100644
--- a/doc/CanvTkwin.3
+++ b/doc/CanvTkwin.3
@@ -30,6 +30,7 @@ int
Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR;
.sp
Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR;
+.fi
.SH ARGUMENTS
.AS Tk_ItemType *drawableXPtr
.AP Tk_Canvas canvas in
@@ -149,7 +150,7 @@ static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
static const Tk_ConfigSpec configSpecs[] = {
...
- {TK_CONFIG_CUSTOM, "\-tags", NULL, NULL,
+ {TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
...
};
diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3
index 1dd2354..9bc280b 100644
--- a/doc/CanvTxtInfo.3
+++ b/doc/CanvTxtInfo.3
@@ -15,6 +15,7 @@ Tk_CanvasTextInfo \- additional information for managing text items in canvases
.sp
Tk_CanvasTextInfo *
\fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Canvas canvas
.AP Tk_Canvas canvas in
@@ -31,7 +32,7 @@ a structure that is shared between Tk and all the items that display
text.
The structure has the following form:
.CS
-typedef struct Tk_CanvasTextInfo {
+typedef struct {
Tk_3DBorder \fIselBorder\fR;
int \fIselBorderWidth\fR;
XColor *\fIselFgColorPtr\fR;
diff --git a/doc/Clipboard.3 b/doc/Clipboard.3
index cc09018..a4fcb6b 100644
--- a/doc/Clipboard.3
+++ b/doc/Clipboard.3
@@ -19,6 +19,7 @@ int
.sp
int
\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ClipboardClear tkwin
.AP Tcl_Interp *interp in
diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3
index 1b942b5..27dcd45 100644
--- a/doc/ClrSelect.3
+++ b/doc/ClrSelect.3
@@ -15,6 +15,7 @@ Tk_ClearSelection \- Deselect a selection
\fB#include <tk.h>\fR
.sp
\fBTk_ClearSelection\fR(\fItkwin, selection\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3
index 58712db..61c49e8 100644
--- a/doc/ConfigWidg.3
+++ b/doc/ConfigWidg.3
@@ -15,15 +15,16 @@ Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- proce
\fB#include <tk.h>\fR
.sp
int
-\fBTk_ConfigureWidget(\fIinterp, tkwin, specs, argc, argv, widgRec, flags\fB)\fR
+\fBTk_ConfigureWidget\fR(\fIinterp, tkwin, specs, objc, objv, widgRec, flags\fR)
.sp
int
-\fBTk_ConfigureInfo(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR
+\fBTk_ConfigureInfo\fR(\fIinterp, tkwin, specs, widgRec, argvName, flags\fR)
.sp
int
-\fBTk_ConfigureValue(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR
+\fBTk_ConfigureValue\fR(\fIinterp, tkwin, specs, widgRec, argvName, flags\fR)
.sp
-\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
+\fBTk_FreeOptions\fR(\fIspecs, widgRec, display, flags\fR)
+.fi
.SH ARGUMENTS
.AS void *widgRec in/out
.AP Tcl_Interp *interp in
@@ -33,9 +34,9 @@ Window used to represent widget (needed to set up X resources).
.AP "const Tk_ConfigSpec" *specs in
Pointer to table specifying legal configuration options for this
widget.
-.AP int argc in
-Number of arguments in \fIargv\fR.
-.AP "const char" **argv in
+.AP Tcl_Size objc in
+Number of arguments in \fIobjv\fR.
+.AP "Tcl_Obj *const *" objv in
Command-line options for configuring widget.
.AP char *widgRec in/out
Points to widget record structure. Fields in this structure get
@@ -62,8 +63,8 @@ order to free up resources.
.BE
.SH DESCRIPTION
.PP
-Note: \fBTk_ConfigureWidget\fR should be replaced with the new
-\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is
+Note that \fBTk_ConfigureWidget\fR should be replaced with the new
+\fBTcl_Obj\fR based API, \fBTk_SetOptions\fR. The old interface is
retained for backward compatibility.
.PP
\fBTk_ConfigureWidget\fR is called to configure various aspects of a
@@ -75,16 +76,16 @@ It is typically
invoked when widgets are created, and again when the \fBconfigure\fR
command is invoked for a widget.
Although intended primarily for widgets, \fBTk_ConfigureWidget\fR
-can be used in other situations where \fIargc-argv\fR information
+can be used in other situations where \fIobjc-objv\fR information
is to be used to fill in a record structure, such as configuring
graphical elements for a canvas widget or entries of a menu.
.PP
\fBTk_ConfigureWidget\fR processes
a table specifying the configuration options that are supported
-(\fIspecs\fR) and a collection of command-line arguments (\fIargc\fR and
-\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR).
+(\fIspecs\fR) and a collection of command-line arguments (\fIobjc\fR and
+\fIobjv\fR) to fill in fields of a record (\fIwidgRec\fR).
It uses the option database and defaults specified in \fIspecs\fR
-to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
+to fill in fields of \fIwidgRec\fR that are not specified in \fIobjv\fR.
\fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this
case it does not modify \fIinterp\fR.
If an error
@@ -120,12 +121,12 @@ The \fIargvName\fR field is a string such as
.QW \-font
or
.QW \-bg ,
-which is compared with the values in \fIargv\fR (if \fIargvName\fR is
+which is compared with the values in \fIobjv\fR (if \fIargvName\fR is
NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The
\fIdbName\fR and \fIdbClass\fR fields are used to look up a value
for this option in the option database. The \fIdefValue\fR field
specifies a default value for this configuration option if no
-value is specified in either \fIargv\fR or the option database.
+value is specified in either \fIobjv\fR or the option database.
\fIOffset\fR indicates where in \fIwidgRec\fR to store information
about this option, and \fIspecFlags\fR contains additional information
to control the processing of this configuration option (see FLAGS
@@ -133,14 +134,14 @@ below).
The last field, \fIcustomPtr\fR, is only used if \fItype\fR is
\fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below.
.PP
-\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which
+\fBTk_ConfigureWidget\fR first processes \fIobjv\fR to see which
(if any) configuration options are specified there. \fIArgv\fR
must contain an even number of fields; the first of each pair
of fields must match the \fIargvName\fR of some entry in \fIspecs\fR
(unique abbreviations are acceptable),
and the second field of the pair contains the value for that
configuration option. If there are entries in \fIspec\fR for which
-there were no matching entries in \fIargv\fR,
+there were no matching entries in \fIobjv\fR,
\fBTk_ConfigureWidget\fR uses the \fIdbName\fR and \fIdbClass\fR
fields of the \fIspecs\fR entry to probe the option database; if
a value is found, then it is used as the value for the option.
@@ -149,7 +150,7 @@ Finally, if no entry is found in the option database, the
value for the configuration option. If the \fIdefValue\fR is
NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in
\fIflags\fR, then there is no default value and this \fIspecs\fR entry
-will be ignored if no value is specified in \fIargv\fR or the
+will be ignored if no value is specified in \fIobjv\fR or the
option database.
.PP
Once a string value has been determined for a configuration option,
@@ -171,6 +172,7 @@ to do with the string value of that configuration option. The
legal values for \fItype\fR, and the corresponding actions, are:
.TP
\fBTK_CONFIG_ACTIVE_CURSOR\fR
+.
The value
must be an ASCII string identifying a cursor in a form
suitable for passing to \fBTk_GetCursor\fR.
@@ -185,12 +187,14 @@ If the previous value of the target
was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR.
.TP
\fBTK_CONFIG_ANCHOR\fR
+.
The value must be an ASCII string identifying an anchor point in one of the ways
accepted by \fBTk_GetAnchor\fR.
The string is converted to a \fBTk_Anchor\fR by calling
\fBTk_GetAnchor\fR and the result is stored in the target.
.TP
\fBTK_CONFIG_BITMAP\fR
+.
The value must be an ASCII string identifying a bitmap in a form
suitable for passing to \fBTk_GetBitmap\fR. The value is converted
to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result
@@ -201,6 +205,7 @@ If the previous value of the target
was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR.
.TP
\fBTK_CONFIG_BOOLEAN\fR
+.
The value must be an ASCII string specifying a boolean value. Any
of the values
.QW true ,
@@ -220,6 +225,7 @@ The target is expected to be an integer; for true values it will
be set to 1 and for false values it will be set to 0.
.TP
\fBTK_CONFIG_BORDER\fR
+.
The value must be an ASCII string identifying a border color in a form
suitable for passing to \fBTk_Get3DBorder\fR. The value is converted
to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result
@@ -230,6 +236,7 @@ If the previous value of the target
was not NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR.
.TP
\fBTK_CONFIG_CAP_STYLE\fR
+.
The value must be
an ASCII string identifying a cap style in one of the ways
accepted by \fBTk_GetCapStyle\fR.
@@ -238,6 +245,7 @@ to the cap style by calling
\fBTk_GetCapStyle\fR and the result is stored in the target.
.TP
\fBTK_CONFIG_COLOR\fR
+.
The value must be an ASCII string identifying a color in a form
suitable for passing to \fBTk_GetColor\fR. The value is converted
to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result
@@ -248,27 +256,32 @@ If the previous value of the target
was not NULL, then it is freed by passing it to \fBTk_FreeColor\fR.
.TP
\fBTK_CONFIG_CURSOR\fR
+.
This option is identical to \fBTK_CONFIG_ACTIVE_CURSOR\fR except
that the new cursor is not made the active one for \fItkwin\fR.
.TP
\fBTK_CONFIG_CUSTOM\fR
+.
This option allows applications to define new option types.
The \fIcustomPtr\fR field of the entry points to a structure
defining the new option type.
See the section \fBCUSTOM OPTION TYPES\fR below for details.
.TP
\fBTK_CONFIG_DOUBLE\fR
+.
The value must be an ASCII floating-point number in
the format accepted by \fBstrtol\fR. The string is converted
to a \fBdouble\fR value, and the value is stored in the
target.
.TP
\fBTK_CONFIG_END\fR
+.
Marks the end of the table. The last entry in \fIspecs\fR
must have this type; all of its other fields are ignored and it
will never match any arguments.
.TP
\fBTK_CONFIG_FONT\fR
+.
The value must be an ASCII string identifying a font in a form
suitable for passing to \fBTk_GetFont\fR. The value is converted
to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result
@@ -279,6 +292,7 @@ If the previous value of the target
was not NULL, then it is freed by passing it to \fBTk_FreeFont\fR.
.TP
\fBTK_CONFIG_INT\fR
+.
The value must be an ASCII integer string
in the format accepted by \fBstrtol\fR (e.g.
.QW 0
@@ -289,6 +303,7 @@ numbers, respectively). The string is converted to an integer
value and the integer is stored in the target.
.TP
\fBTK_CONFIG_JOIN_STYLE\fR
+.
The value must be
an ASCII string identifying a join style in one of the ways
accepted by \fBTk_GetJoinStyle\fR.
@@ -297,6 +312,7 @@ to the join style by calling
\fBTk_GetJoinStyle\fR and the result is stored in the target.
.TP
\fBTK_CONFIG_JUSTIFY\fR
+.
The value must be
an ASCII string identifying a justification method in one of the
ways accepted by \fBTk_GetJustify\fR.
@@ -304,26 +320,29 @@ The string is converted to a \fBTk_Justify\fR by calling
\fBTk_GetJustify\fR and the result is stored in the target.
.TP
\fBTK_CONFIG_MM\fR
+.
The value must specify a screen distance in one of the forms acceptable
to \fBTk_GetScreenMM\fR.
The string is converted to double-precision floating-point distance
in millimeters and the value is stored in the target.
.TP
\fBTK_CONFIG_PIXELS\fR
+.
The value must specify screen units in one of the forms acceptable
to \fBTk_GetPixels\fR.
The string is converted to an integer distance in pixels and the
value is stored in the target.
.TP
\fBTK_CONFIG_RELIEF\fR
+.
The value must be an ASCII string identifying a relief in a form
suitable for passing to \fBTk_GetRelief\fR. The value is converted
to an integer relief value by calling \fBTk_GetRelief\fR and the result
is stored in the target.
.TP
\fBTK_CONFIG_STRING\fR
-A copy
-of the value is made by allocating memory space with
+.
+A copy of the value is made by allocating memory space with
\fBTcl_Alloc\fR and copying the value into the dynamically-allocated
space. A pointer to the new string is stored in the target.
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
@@ -332,20 +351,22 @@ If the previous value of the target was not NULL, then it is
freed by passing it to \fBTcl_Free\fR.
.TP
\fBTK_CONFIG_SYNONYM\fR
+.
This \fItype\fR value identifies special entries in \fIspecs\fR that
-are synonyms for other entries. If an \fIargv\fR value matches the
+are synonyms for other entries. If an \fIobjv\fR value matches the
\fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used
directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR
for another entry whose \fIargvName\fR is the same as the \fIdbName\fR
field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just
-as if its \fIargvName\fR had matched the \fIargv\fR value. The
-synonym mechanism allows multiple \fIargv\fR values to be used for
+as if its \fIargvName\fR had matched the \fIobjv\fR value. The
+synonym mechanism allows multiple \fIobjv\fR values to be used for
a single configuration option, such as
.QW \-background
and
.QW \-bg .
.TP
\fBTK_CONFIG_UID\fR
+.
The value is translated to a \fBTk_Uid\fR
(by passing it to \fBTk_GetUid\fR). The resulting value
is stored in the target.
@@ -353,6 +374,7 @@ If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value
is an empty string then the target will be set to NULL.
.TP
\fBTK_CONFIG_WINDOW\fR
+.
The value must be a window path name. It is translated to a
\fBTk_Window\fR token and the token is stored in the target.
.SH "GROUPED ENTRIES"
@@ -381,10 +403,11 @@ options. These values are used in three different ways as
described below.
.PP
First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has
-the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
+the \fBTK_CONFIG_ARGV_ONLY\fR bit set
+(i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
then the option database and
\fIdefValue\fR fields are not used. In this case, if an entry in
-\fIspecs\fR does not match a field in \fIargv\fR then nothing happens:
+\fIspecs\fR does not match a field in \fIobjv\fR then nothing happens:
the corresponding target is not modified. This feature is useful
when the goal is to modify certain configuration options while
leaving others in their current state, such as when a \fBconfigure\fR
@@ -395,16 +418,19 @@ to control the processing of that entry. Each \fIspecFlags\fR
field may consists of an OR-ed combination of the following values:
.TP
\fBTK_CONFIG_COLOR_ONLY\fR
+.
If this bit is set then the entry will only be considered if the
display for \fItkwin\fR has more than one bit plane. If the display
is monochromatic then this \fIspecs\fR entry will be ignored.
.TP
\fBTK_CONFIG_MONO_ONLY\fR
+.
If this bit is set then the entry will only be considered if the
display for \fItkwin\fR has exactly one bit plane. If the display
is not monochromatic then this \fIspecs\fR entry will be ignored.
.TP
\fBTK_CONFIG_NULL_OK\fR
+.
This bit is only relevant for some types of entries (see the
descriptions of the various entry types above).
If this bit is set, it indicates that an empty string value
@@ -418,6 +444,7 @@ If this bit is not set then empty strings are processed as strings,
which generally results in an error.
.TP
\fBTK_CONFIG_DONT_SET_DEFAULT\fR
+.
If this bit is one, it means that the \fIdefValue\fR field of the
entry should only be used for returning the default value in
\fBTk_ConfigureInfo\fR.
@@ -428,14 +455,6 @@ This flag provides a performance optimization where it is expensive
to process the default string: the client can compute the default
once, save the value, and provide it before calling
\fBTk_ConfigureWidget\fR.
-.TP
-\fBTK_CONFIG_OPTION_SPECIFIED\fR
-This bit is
-deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR
-so that callers could detect what entries were specified in
-\fIargv\fR, but it was removed because it was inherently
-thread-unsafe. Code that wishes to detect what options were specified
-should use \fBTk_SetOptions\fR instead.
.PP
The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
used to specify different default values for
@@ -533,7 +552,7 @@ Applications can extend the built-in configuration types with additional
configuration types by writing procedures to parse and print options
of the a type and creating a structure pointing to those procedures:
.CS
-typedef struct Tk_CustomOption {
+typedef struct {
Tk_OptionParseProc *\fIparseProc\fR;
Tk_OptionPrintProc *\fIprintProc\fR;
void *\fIclientData\fR;
@@ -545,13 +564,13 @@ typedef int \fBTk_OptionParseProc\fR(
Tk_Window \fItkwin\fR,
char *\fIvalue\fR,
char *\fIwidgRec\fR,
- int \fIoffset\fR);
+ Tcl_Size \fIoffset\fR);
typedef const char *\fBTk_OptionPrintProc\fR(
void *\fIclientData\fR,
Tk_Window \fItkwin\fR,
char *\fIwidgRec\fR,
- int \fIoffset\fR,
+ Tcl_Size \fIoffset\fR,
Tcl_FreeProc **\fIfreeProcPtr\fR);
.CE
The Tk_CustomOption structure contains three fields, which are pointers
diff --git a/doc/ConfigWind.3 b/doc/ConfigWind.3
index 3e83387..c5e035a 100644
--- a/doc/ConfigWind.3
+++ b/doc/ConfigWind.3
@@ -39,6 +39,7 @@ Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetW
\fBTk_DefineCursor\fR(\fItkwin, cursor\fR)
.sp
\fBTk_UndefineCursor\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS XSetWindowAttributes borderWidth
.AP Tk_Window tkwin in
diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3
index 1ebd681..be2663d 100644
--- a/doc/CoordToWin.3
+++ b/doc/CoordToWin.3
@@ -16,6 +16,7 @@ Tk_CoordsToWindow \- Find window containing a point
.sp
Tk_Window
\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP int rootX in
diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3
index 1ba6f63..a19206c 100644
--- a/doc/CrtCmHdlr.3
+++ b/doc/CrtCmHdlr.3
@@ -16,6 +16,7 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced
\fBTk_CreateClientMessageHandler\fR(\fIproc\fR)
.sp
\fBTk_DeleteClientMessageHandler\fR(\fIproc\fR)
+.fi
.SH ARGUMENTS
.AP Tk_ClientMessageProc *proc in
Procedure to invoke whenever a ClientMessage X event occurs on any display.
diff --git a/doc/CrtConsoleChan.3 b/doc/CrtConsoleChan.3
index d8e0740..cae5242 100644
--- a/doc/CrtConsoleChan.3
+++ b/doc/CrtConsoleChan.3
@@ -14,6 +14,7 @@ Tk_InitConsoleChannels \- Install the console channels as standard channels
\fB#include <tk.h>\fR
.sp
\fBTk_InitConsoleChannels\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp in
.AP Tcl_Interp *interp in
diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3
index 09dcf8b..6e874b7 100644
--- a/doc/CrtErrHdlr.3
+++ b/doc/CrtErrHdlr.3
@@ -18,6 +18,7 @@ Tk_ErrorHandler
\fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR)
.sp
\fBTk_DeleteErrorHandler\fR(\fIhandler\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_ErrorHandler" clientData
.AP Display *display in
diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3
index aaf3285..b203e19 100644
--- a/doc/CrtGenHdlr.3
+++ b/doc/CrtGenHdlr.3
@@ -17,6 +17,7 @@ Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback
\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR)
.sp
\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_GenericProc" clientData
.AP Tk_GenericProc *proc in
diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3
index b15a851..ddfbc54 100644
--- a/doc/CrtImgType.3
+++ b/doc/CrtImgType.3
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
-Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image
+Tk_CreateImageType, Tk_GetImageModelData \- define new kind of image
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -18,8 +18,7 @@ Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of
.sp
void *
\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
-.sp
-\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
+.fi
.SH ARGUMENTS
.AS "const Tk_ImageType" *typePtrPtr
.AP "const Tk_ImageType" *typePtr in
@@ -34,8 +33,6 @@ Name of existing image.
.AP Tk_ImageType **typePtrPtr out
Points to word in which to store a pointer to type information for
the given image, if it exists.
-.AP int argc in
-Number of arguments
.AP char ***argvPtr in/out
Pointer to argument list
.BE
@@ -58,7 +55,7 @@ The first data structure is a Tk_ImageType structure, which contains
the name of the image type and pointers to five procedures provided
by the image manager to deal with images of this type:
.CS
-typedef struct Tk_ImageType {
+typedef struct {
const char *\fIname\fR;
Tk_ImageCreateProc *\fIcreateProc\fR;
Tk_ImageGetProc *\fIgetProc\fR;
@@ -241,42 +238,6 @@ and the return value is the clientData value returned by the
\fIcreateProc\fR when the image was created (this is typically a
pointer to the image model data structure). If no such image exists
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
-.SH "LEGACY INTERFACE SUPPORT"
-.PP
-In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
-was incompatibly different, with the following prototype:
-.CS
-typedef int \fBTk_ImageCreateProc\fR(
- Tcl_Interp *\fIinterp\fR,
- char *\fIname\fR,
- int \fIargc\fR,
- char **\fIargv\fR,
- Tk_ImageType *\fItypePtr\fR,
- Tk_ImageModel \fImodel\fR,
- void **\fImodelDataPtr\fR);
-.CE
-Legacy programs and libraries dating from those days may still
-contain code that defines extended Tk image types using the old
-interface. The Tk header file will still support this legacy
-interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
-defined.
-.PP
-When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
-see the routine \fBTk_InitImageArgs\fR in use. This was a migration
-tool used to create stub-enabled extensions that could be loaded
-into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer
-provides this routine, but uses a macro to convert any attempted
-calls of this routine into an empty comment. Any stub-enabled
-extension providing an extended image type via the legacy interface
-that is compiled against Tk 8.5 headers and linked against the
-Tk 8.5 stub library will produce a file that can be loaded only
-into interps with Tk 8.5 or later; that is, the normal stub-compatibility
-rules. If a developer needs to generate from such code a file
-that is loadable into interps with Tk 8.4 or earlier, they must
-use Tk 8.4 headers and stub libraries to do so.
-.PP
-Any new code written today should not make use of the legacy
-interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO"
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
.SH KEYWORDS
diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3
index 82fc26e..3fb2d9f 100644
--- a/doc/CrtItemType.3
+++ b/doc/CrtItemType.3
@@ -17,10 +17,12 @@ Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item
.sp
Tk_ItemType *
\fBTk_GetItemTypes\fR()
+.fi
.SH ARGUMENTS
.AS Tk_ItemType *typePtr
.AP Tk_ItemType *typePtr in
Structure that defines the new type of canvas item.
+Note that this is not \fIconst\fR; Tk may write to these structures.
.BE
.SH INTRODUCTION
.PP
@@ -71,7 +73,7 @@ typedef struct Tk_ItemType {
Tk_ItemCoordProc *\fIcoordProc\fR;
Tk_ItemDeleteProc *\fIdeleteProc\fR;
Tk_ItemDisplayProc *\fIdisplayProc\fR;
- int \fIalwaysRedraw\fR;
+ int \fIflags\fR;
Tk_ItemPointProc *\fIpointProc\fR;
Tk_ItemAreaProc *\fIareaProc\fR;
Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
@@ -82,7 +84,7 @@ typedef struct Tk_ItemType {
Tk_ItemSelectionProc *\fIselectionProc\fR;
Tk_ItemInsertProc *\fIinsertProc\fR;
Tk_ItemDCharsProc *\fIdCharsProc\fR;
- Tk_ItemType *\fInextPtr\fR;
+ struct Tk_ItemType *\fInextPtr\fR;
.VS "8.7, TIP164"
Tk_ItemRotateProc *\fIrotateProc\fR;
.VE "8.7, TIP164"
@@ -113,7 +115,7 @@ the first field.
For example, the item record for bitmap items is defined as follows:
.PP
.CS
-typedef struct BitmapItem {
+typedef struct {
Tk_Item \fIheader\fR;
double \fIx\fR, \fIy\fR;
Tk_Anchor \fIanchor\fR;
@@ -169,7 +171,7 @@ If there already existed an item type by this name then
the new item type replaces the old one.
.SS "FLAGS (IN ALWAYSREDRAW)"
.PP
-The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
+The \fItypePtr\->flags\fR field
contains a collection of flag bits that modify how the canvas core interacts
with the item. The following bits are defined:
.TP
@@ -180,14 +182,6 @@ is redrawn, rather than only when the bounding box of the item overlaps the
area being redrawn. This is used by window items, for example, which need to
unmap subwindows that are not on the screen.
.TP
-\fBTK_CONFIG_OBJS\fR
-.
-Indicates that operations which would otherwise take a string (or array of
-strings) actually take a Tcl_Obj reference (or an array of such references).
-The operations to which this applies are the \fIconfigProc\fR, the
-\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
-\fIinsertProc\fR.
-.TP
\fBTK_MOVABLE_POINTS\fR
.VS 8.6
Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
@@ -229,9 +223,6 @@ Tk has already initialized the item's header (the first
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
arguments to the \fBcreate\fR command after the \fItype\fR
argument.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, in the widget command:
.PP
.CS
@@ -261,7 +252,8 @@ to retrieve option information in the \fBitemcget\fR and
\fBitemconfigure\fR widget commands.
\fItypePtr\->configSpecs\fR must point to the configuration table
for this type.
-Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
+.PP
+Note that Tk provides a custom option type \fBtk_CanvasTagsOption\fR
for implementing the \fB\-tags\fR option; see an existing type
manager for an example of how to use it in \fIconfigSpecs\fR.
.SS CONFIGPROC
@@ -285,9 +277,6 @@ The \fIinterp\fR argument identifies the interpreter in which the
widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget, and \fIitemPtr\fR is a pointer to the item being configured.
\fIobjc\fR and \fIobjv\fR contain the configuration options.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, if the following command is invoked:
.PP
.CS
@@ -324,9 +313,6 @@ typedef int \fBTk_ItemCoordProc\fR(
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
describe the coordinate arguments.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
-contain a pointer to an array of constant strings.
For example, if the following widget command is invoked:
.PP
.CS
@@ -401,9 +387,9 @@ of \fIdst\fR.
.PP
Normally an item's \fIdisplayProc\fR is only invoked if the item
overlaps the area being displayed.
-However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
+However, if bit zero of \fItypePtr\->flags\fR is 1,
(i.e.\|
-.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
+.QW "\fItypePtr\->flags & 1 == 1\fR" )
then \fIdisplayProc\fR is invoked during every redisplay operation,
even if the item does not overlap the area of redisplay; this is useful for
cases such as window items, where the subwindow needs to be unmapped when it
@@ -577,8 +563,8 @@ they used to have coordinates \fIx\fR and \fIy\fR, they will have new
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
.PP
.CS
-\fIrelX\fR = \fIx\fR - \fIoriginX\fR
-\fIrelY\fR = \fIy\fR - \fIoriginY\fR
+\fIrelX\fR = \fIx\fR \(mi \fIoriginX\fR
+\fIrelY\fR = \fIy\fR \(mi \fIoriginY\fR
\fIx\(fm\fR = \fIoriginX\fR + \fIrelX\fR \(mu cos(\fIangleRad\fR) + \fIrelY\fR \(mu sin(\fIangleRad\fR)
\fIy\(fm\fR = \fIoriginY\fR \(mi \fIrelX\fR \(mu sin(\fIangleRad\fR) + \fIrelY\fR \(mu cos(\fIangleRad\fR)
.CE
@@ -616,9 +602,6 @@ have the usual meaning.
\fIindexObj\fR contains a textual description of an index,
and \fIindexPtr\fR points to an integer value that should be
filled in with a numerical index.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
-actually contain a pointer to a constant string.
It is up to the type manager to decide what forms of index
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
\fBend\fR, etc.).
@@ -702,9 +685,6 @@ typedef void \fBTk_ItemInsertProc\fR(
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
contains new text to insert just before the character given
by \fIindex\fR.
-Note that if \fBTK_CONFIG_OBJS\fR is not set in the
-\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
-actually contain a pointer to a constant string to be inserted.
If the item supports modification of the coordinates list by this
.PP
The type manager should insert the text and recompute the bounding
diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3
index c7accdb..ff6f839 100644
--- a/doc/CrtPhImgFmt.3
+++ b/doc/CrtPhImgFmt.3
@@ -58,7 +58,7 @@ by the handler to deal with files and strings in this format. The
Tk_PhotoImageFormatVersion3 structure contains the following fields:
.VS 8.7
.CS
-typedef struct Tk_PhotoImageFormatVersion3 {
+typedef struct {
const char *\fIname\fR;
Tk_ImageFileMatchProcVersion3 *\fIfileMatchProc\fR;
Tk_ImageStringMatchProcVersion3 *\fIstringMatchProc\fR;
@@ -151,7 +151,7 @@ return 0.
Tk to call to read data from an image file into a photo image.
\fIformatPtr->fileReadProc\fR must match the following prototype:
.CS
-typedef int \fBTk_ImageFileReadProc\fR(
+typedef int \fBTk_ImageFileReadProcVersion3\fR(
Tcl_Interp *\fIinterp\fR,
Tcl_Channel \fIchan\fR,
const char *\fIfileName\fR,
@@ -184,7 +184,7 @@ The return value is a standard Tcl return value.
for Tk to call to read data from a string into a photo image.
\fIformatPtr->stringReadProc\fR must match the following prototype:
.CS
-typedef int \fBTk_ImageStringReadProc\fR(
+typedef int \fBTk_ImageStringReadProcVersion3\fR(
Tcl_Interp *\fIinterp\fR,
Tcl_Obj *\fIdata\fR,
Tcl_Obj *\fIformat\fR,
@@ -216,7 +216,7 @@ The return value is a standard Tcl return value.
Tk to call to write data from a photo image to a file.
\fIformatPtr->fileWriteProc\fR must match the following prototype:
.CS
-typedef int \fBTk_ImageFileWriteProc\fR(
+typedef int \fBTk_ImageFileWriteProcVersion3\fR(
Tcl_Interp *\fIinterp\fR,
const char *\fIfileName\fR,
Tcl_Obj *\fIformat\fR,
@@ -245,7 +245,7 @@ for Tk to call to translate image data from a photo image into a
string.
\fIformatPtr->stringWriteProc\fR must match the following prototype:
.CS
-typedef int \fBTk_ImageStringWriteProc\fR(
+typedef int \fBTk_ImageStringWriteProcVersion3\fR(
Tcl_Interp *\fIinterp\fR,
Tcl_Obj *\fIformat\fR,
Tcl_Obj *\fImetadataIn\fR,
@@ -276,7 +276,6 @@ level by including dictionary keys into the metadata property of the
image. Image metadata may be written to image data on file write or
image data output.
.PP
-.PP
.SS "METADATA KEYS"
.PP
The metadata may contain any key.
@@ -285,16 +284,13 @@ documentation. See the photo image manual page for currently defined
keys for the system drivers.
.PP
The following rules may give guidance to name metadata keys:
-.RS
-Abreviation are in upper case
-.RE
-.RS
+.IP \(bu
+Abbreviations are in upper case.
+.IP \(bu
Words are in US English in small case (except proper nouns)
-.RE
-.RS
+.IP \(bu
Vertical DPI is expressed as DPI/aspect. The reason is, that some
image formats may feature aspect and no resolution value.
-.RE
.SS "METADATA INPUT"
.PP
Each driver function gets a Tcl object pointer \fBmetadataIn\fR as
@@ -306,17 +302,20 @@ A typical driver code snipped to check for a metadata key is:
.CS
if (NULL != metadataIn) {
Tcl_Obj *itemData;
- Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), &itemData));
+ Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1),
+ &itemData));
+ // use value reference in itemData
+}
.CE
.PP
-The \-metadata command option data of the following commands is passed
+The \fB\-metadata\fR command option data of the following commands is passed
to the driver: \fBimage create\fR, \fBconfigure\fR, \fBput\fR,
\fBread\fR, \fBdata\fR and \fBwrite\fR.
-If no \-metadata command option available or not given, the metadata
+If no \fB\-metadata\fR command option available or not given, the metadata
property of the image is passed to the driver using the following
commands: \fBcget\fR, \fBconfigure\fR, \fBdata\fR and \fBwrite\fR.
.PP
-Note that setting the \-metadata property of an image using
+Note that setting the \fB\-metadata\fR property of an image using
\fBconfigure\fR without any other option does not invoke any driver
function.
.PP
@@ -328,12 +327,12 @@ this purpose.
.SS "METADATA OUTPUT"
.PP
The image match and read driver functions may set keys in a prepared
-matadata dict to return them.
-Those functions get a Tcl object pointer \fBmetadataOut\fR as
+metadata dict to return them.
+Those functions get a Tcl object pointer \fImetadataOut\fR as
parameter.
-metadataOut may be NULL to indicate, that no metadata return is
-attended(\fBput\fR, \fBread\fR subcommands).
-\fBmetadataOut\fR is initialized to an empty unshared dict object if
+\fImetadataOut\fR may be NULL to indicate, that no metadata return is
+required (\fBput\fR, \fBread\fR subcommands). The variable pointed to
+by \fImetadataOut\fR is initialized to an empty unshared dict object if
metadata return is attended (\fBimage create\fR command, \fBconfigure\fR
subcommand). The driver may set dict keys in this object to return
metadata.
@@ -343,7 +342,9 @@ corresponding read function.
A sample driver code snippet is:
.CS
if (NULL != metadataOut) {
- Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), Tcl_NewStringObj(xmpMetadata);
+ Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1),
+ Tcl_NewStringObj(xmpMetadata));
+}
.CE
.PP
The metadata keys returned by the driver are merged into the present
@@ -376,7 +377,7 @@ A driver using the version 2 interface invokes \fBTk_CreatePhotoImageFormat\fR
for driver registration. The Tk_PhotoImageFormat structure
contains the following fields:
.CS
-typedef struct Tk_PhotoImageFormat {
+typedef struct {
const char *\fIname\fR;
Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
@@ -457,45 +458,6 @@ typedef int \fBTk_ImageStringWriteProc\fR(
Tcl_Obj *\fIformat\fR,
Tk_PhotoImageBlock *\fIblockPtr\fR);
.CE
-.PP
-.SH "LEGACY INTERFACE SUPPORT"
-.PP
-In Tk 8.2 and earlier, the definition of all the function pointer
-types stored in fields of a \fBTk_PhotoImageFormat\fR struct were
-incompatibly different. Legacy programs and libraries dating from
-those days may still contain code that defines extended Tk photo image
-formats using the old interface. The Tk header file will still support
-this legacy interface if the code is compiled with the
-macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces
-are used if the first character of \fIformatPtr->name\fR is an
-uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts
-are used to forgive the type mismatch. For example,
-.CS
-static Tk_PhotoImageFormat myFormat = {
- "MyFormat",
- (Tk_ImageFileMatchProc *) FileMatch,
- NULL,
- (Tk_ImageFileReadProc *) FileRead,
- NULL,
- NULL,
- NULL
-};
-.CE
-would define a minimal \fBTk_PhotoImageFormat\fR that operates provide
-only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR
-are written according to the legacy interfaces of Tk 8.2 or earlier.
-.PP
-Any stub-enabled extension providing an extended photo image format
-via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro
-that is compiled against Tk 8.5 headers and linked against the
-Tk 8.5 stub library will produce a file that can be loaded only
-into interps with Tk 8.5 or later; that is, the normal stub-compatibility
-rules. If a developer needs to generate from such code a file
-that is loadable into interps with Tk 8.4 or earlier, they must
-use Tk 8.4 headers and stub libraries to do so.
-.PP
-Any new code written today should not make use of the legacy
-interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO"
Tk_FindPhoto, Tk_PhotoPutBlock
.SH KEYWORDS
diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3
index b3c749c..1984c82 100644
--- a/doc/CrtSelHdlr.3
+++ b/doc/CrtSelHdlr.3
@@ -17,6 +17,7 @@ Tk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a sel
\fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR)
.sp
\fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR)
+.fi
.SH ARGUMENTS
.AS Tk_SelectionProc clientData
.AP Tk_Window tkwin in
@@ -54,11 +55,11 @@ the selection. The most common form is STRING.
\fIProc\fR should have arguments and result that match the
type \fBTk_SelectionProc\fR:
.CS
-typedef int \fBTk_SelectionProc\fR(
+typedef Tcl_Size \fBTk_SelectionProc\fR(
void *\fIclientData\fR,
- int \fIoffset\fR,
+ Tcl_Size \fIoffset\fR,
char *\fIbuffer\fR,
- int \fImaxBytes\fR);
+ Tcl_Size \fImaxBytes\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.
diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3
index b254460..e6b4437 100644
--- a/doc/CrtWindow.3
+++ b/doc/CrtWindow.3
@@ -26,6 +26,7 @@ Tk_Window
\fBTk_DestroyWindow\fR(\fItkwin\fR)
.sp
\fBTk_MakeWindowExist\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *topLevScreen
.AP Tcl_Interp *interp out
diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3
index eb6db1e..43944b7 100644
--- a/doc/DeleteImg.3
+++ b/doc/DeleteImg.3
@@ -14,6 +14,7 @@ Tk_DeleteImage \- Destroy an image.
\fB#include <tk.h>\fR
.sp
\fBTk_DeleteImage\fR(\fIinterp, name\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3
index 59cd069..1e343e3 100644
--- a/doc/DrawFocHlt.3
+++ b/doc/DrawFocHlt.3
@@ -13,7 +13,8 @@ Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget
.nf
\fB#include <tk.h>\fR
.sp
-\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR
+\fBTk_DrawFocusHighlight\fR(\fItkwin, gc, width, drawable\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *joinPtr
.AP Tk_Window tkwin in
diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3
index 128f8ee..4e3c9d9 100644
--- a/doc/EventHndlr.3
+++ b/doc/EventHndlr.3
@@ -21,6 +21,7 @@ Tk_CreateEventHandler, Tk_DeleteEventHandler, Tk_GetButtonMask, Tk_SendVirtualEv
\fBTk_GetButtonMask\fR(\fIbutton\fR)
.sp
\fBTk_SendVirtualEvent\fR(\fItkwin, eventName, detail\fR)
+.fi
.SH ARGUMENTS
.AS "unsigned long" clientData
.AP unsigned button in
diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3
index 8b28478..066371e 100644
--- a/doc/FindPhoto.3
+++ b/doc/FindPhoto.3
@@ -32,17 +32,16 @@ zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
int
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
.sp
-void
\fBTk_PhotoBlank\fR(\fIhandle\fR)
.sp
int
\fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR)
.sp
-void
\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR)
.sp
int
\fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR)
+.fi
.SH ARGUMENTS
.AS Tk_PhotoImageBlock window_path
.AP Tcl_Interp *interp in
diff --git a/doc/FontId.3 b/doc/FontId.3
index 9d35ae6..fa1427c 100644
--- a/doc/FontId.3
+++ b/doc/FontId.3
@@ -15,12 +15,13 @@ fonts
\fB#include <tk.h>\fR
.sp
Font
-\fBTk_FontId(\fItkfont\fB)\fR
+\fBTk_FontId\fR(\fItkfont\fR)
.sp
-\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR
+\fBTk_GetFontMetrics\fR(\fItkfont, fmPtr\fR)
.sp
int
-\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR
+\fBTk_PostscriptFontName\fR(\fItkfont, dsPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_FontMetrics *dsPtr
.AP Tk_Font tkfont in
@@ -69,7 +70,7 @@ Postscript font name may be incorrect or not exist on the printer.
The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
return information about a font and is defined as follows:
.CS
-typedef struct Tk_FontMetrics {
+typedef struct {
int \fIascent\fR;
int \fIdescent\fR;
int \fIlinespace\fR;
diff --git a/doc/FreeXId.3 b/doc/FreeXId.3
deleted file mode 100644
index 84fef26..0000000
--- a/doc/FreeXId.3
+++ /dev/null
@@ -1,30 +0,0 @@
-'\"
-'\" Copyright (c) 1990 The Regents of the University of California.
-'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
-.so man.macros
-.BS
-.SH NAME
-Tk_FreeXId \- make X resource identifier available for reuse
-.SH SYNOPSIS
-.nf
-\fB#include <tk.h>\fR
-.sp
-\fBTk_FreeXId(\fIdisplay, id\fB)\fR
-.SH ARGUMENTS
-.AS Display *display out
-.AP Display *display in
-Display for which \fIid\fR was allocated.
-.AP XID id in
-Identifier of X resource (window, font, pixmap, cursor, graphics
-context, or colormap) that is no longer in use.
-.BE
-.SH DESCRIPTION
-.PP
-This function is deprecated, it doesn't do anything since 2008-08-19.
-.SH KEYWORDS
-resource identifier
diff --git a/doc/GeomReq.3 b/doc/GeomReq.3
index 7670521..e6f2eed 100644
--- a/doc/GeomReq.3
+++ b/doc/GeomReq.3
@@ -21,6 +21,7 @@ Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetIntern
\fBTk_SetInternalBorder\fR(\fItkwin, width\fR)
.sp
\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR)
+.fi
.SH ARGUMENTS
.AS baseHeight clientData
.AP Tk_Window tkwin in
@@ -36,13 +37,17 @@ Desired minimum requested height for \fItkwin\fR, in pixel units.
.AP int width in
Space to leave for internal border for \fItkwin\fR, in pixel units.
.AP int left in
-Space to leave for left side of internal border for \fItkwin\fR, in pixel units.
+Space to leave for left side of internal border for \fItkwin\fR,
+in pixel units.
.AP int right in
-Space to leave for right side of internal border for \fItkwin\fR, in pixel units.
+Space to leave for right side of internal border for \fItkwin\fR,
+in pixel units.
.AP int top in
-Space to leave for top side of internal border for \fItkwin\fR, in pixel units.
+Space to leave for top side of internal border for \fItkwin\fR,
+in pixel units.
.AP int bottom in
-Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units.
+Space to leave for bottom side of internal border for \fItkwin\fR,
+in pixel units.
.BE
.SH DESCRIPTION
.PP
diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3
index 5d41ad6..658911a 100644
--- a/doc/GetAnchor.3
+++ b/doc/GetAnchor.3
@@ -15,13 +15,14 @@ Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR
+\fBTk_GetAnchorFromObj\fR(\fIinterp, objPtr, anchorPtr\fR)
.sp
int
-\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
+\fBTk_GetAnchor\fR(\fIinterp, string, anchorPtr\fR)
.sp
const char *
-\fBTk_NameOfAnchor(\fIanchor\fB)\fR
+\fBTk_NameOfAnchor\fR(\fIanchor\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_Anchor" *anchorPtr
.AP Tcl_Interp *interp in
diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3
index 88418c7..f470638 100644
--- a/doc/GetBitmap.3
+++ b/doc/GetBitmap.3
@@ -15,25 +15,26 @@ Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_Na
\fB#include <tk.h>\fR
.sp
Pixmap
-\fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR
+\fBTk_AllocBitmapFromObj\fR(\fIinterp, tkwin, objPtr\fR)
.sp
Pixmap
-\fBTk_GetBitmap(\fIinterp, tkwin, info\fB)\fR
+\fBTk_GetBitmap\fR(\fIinterp, tkwin, info\fR)
.sp
Pixmap
-\fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_GetBitmapFromObj\fR(\fItkwin, objPtr\fR)
.sp
int
-\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR
+\fBTk_DefineBitmap\fR(\fIinterp, name, source, width, height\fR)
.sp
const char *
-\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR
+\fBTk_NameOfBitmap\fR(\fIdisplay, bitmap\fR)
.sp
-\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR
+\fBTk_SizeOfBitmap\fR(\fIdisplay, bitmap, widthPtr, heightPtr\fR)
.sp
-\fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_FreeBitmapFromObj\fR(\fItkwin, objPtr\fR)
.sp
-\fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR
+\fBTk_FreeBitmap\fR(\fIdisplay, bitmap\fR)
+.fi
.SH ARGUMENTS
.AS "unsigned long" *pixelPtr
.AP Tcl_Interp *interp in
@@ -80,98 +81,74 @@ creates a new one otherwise. \fIObjPtr\fR's value must have one
of the following forms:
.TP 20
\fB@\fIfileName\fR
+.
\fIFileName\fR must be the name of a file containing a bitmap
description in the standard X11 format.
.TP 20
\fIname\fR
+.
\fIName\fR must be the name of a bitmap defined previously with
a call to \fBTk_DefineBitmap\fR. The following names are pre-defined
by Tk:
.RS
-.TP 12
-\fBerror\fR
+.IP \fBerror\fR 12
The international
.QW don't
symbol: a circle with a diagonal line across it.
-.TP 12
-\fBgray75\fR
+.IP \fBgray75\fR 12
75% gray: a checkerboard pattern where three out of four bits are on.
-.TP 12
-\fBgray50\fR
+.IP \fBgray50\fR 12
50% gray: a checkerboard pattern where every other bit is on.
-.TP 12
-\fBgray25\fR
+.IP \fBgray25\fR 12
25% gray: a checkerboard pattern where one out of every four bits is on.
-.TP 12
-\fBgray12\fR
+.IP \fBgray12\fR 12
12.5% gray: a pattern where one-eighth of the bits are on, consisting of
every fourth pixel in every other row.
-.TP 12
-\fBhourglass\fR
+.IP \fBhourglass\fR 12
An hourglass symbol.
-.TP 12
-\fBinfo\fR
+.IP \fBinfo\fR 12
A large letter
.QW i .
-.TP 12
-\fBquesthead\fR
+.IP \fBquesthead\fR 12
The silhouette of a human head, with a question mark in it.
-.TP 12
-\fBquestion\fR
+.IP \fBquestion\fR 12
A large question-mark.
-.TP 12
-\fBwarning\fR
+.IP \fBwarning\fR 12
A large exclamation point.
.PP
In addition, the following pre-defined names are available only on the
\fBMacintosh\fR platform:
-.TP 12
-\fBdocument\fR
+.IP \fBdocument\fR 12
A generic document.
-.TP 12
-\fBstationery\fR
+.IP \fBstationery\fR 12
Document stationery.
-.TP 12
-\fBedition\fR
+.IP \fBedition\fR 12
The \fIedition\fR symbol.
-.TP 12
-\fBapplication\fR
+.IP \fBapplication\fR 12
Generic application icon.
-.TP 12
-\fBaccessory\fR
+.IP \fBaccessory\fR 12
A desk accessory.
-.TP 12
-\fBfolder\fR
+.IP \fBfolder\fR 12
Generic folder icon.
-.TP 12
-\fBpfolder\fR
+.IP \fBpfolder\fR 12
A locked folder.
-.TP 12
-\fBtrash\fR
+.IP \fBtrash\fR 12
A trash can.
-.TP 12
-\fBfloppy\fR
+.IP \fBfloppy\fR 12
A floppy disk.
-.TP 12
-\fBramdisk\fR
+.IP \fBramdisk\fR 12
A floppy disk with chip.
-.TP 12
-\fBcdrom\fR
+.IP \fBcdrom\fR 12
A cd disk icon.
-.TP 12
-\fBpreferences\fR
+.IP \fBpreferences\fR 12
A folder with prefs symbol.
-.TP 12
-\fBquerydoc\fR
+.IP \fBquerydoc\fR 12
A database document icon.
-.TP 12
-\fBstop\fR
+.IP \fBstop\fR 12
A stop sign.
-.TP 12
-\fBnote\fR
+.IP \fBnote\fR 12
A face with balloon words.
-.TP 12
-\fBcaution\fR
+.IP \fBcaution\fR 12
A triangle with an exclamation point.
.RE
.LP
@@ -210,7 +187,7 @@ describe the bitmap.
(e.g. a bitmap named \fInameId\fR has already been defined) then
\fBTCL_ERROR\fR is returned and an error message is left in
interpreter \fIinterp\fR's result.
-Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
+Note that \fBTk_DefineBitmap\fR expects the memory pointed to by
\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
a private copy of this memory, but uses the bytes pointed to
by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or
diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3
index 4e5d1d5..bb087a1 100644
--- a/doc/GetCapStyl.3
+++ b/doc/GetCapStyl.3
@@ -15,10 +15,11 @@ Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR
+\fBTk_GetCapStyle\fR(\fIinterp, string, capPtr\fR)
.sp
const char *
-\fBTk_NameOfCapStyle(\fIcap\fB)\fR
+\fBTk_NameOfCapStyle\fR(\fIcap\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *capPtr
.AP Tcl_Interp *interp in
diff --git a/doc/GetClrmap.3 b/doc/GetClrmap.3
index 4b72b6c..2bfa4b9 100644
--- a/doc/GetClrmap.3
+++ b/doc/GetClrmap.3
@@ -15,11 +15,12 @@ Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colorm
\fB#include <tk.h>\fR
.sp
Colormap
-\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR
+\fBTk_GetColormap\fR(\fIinterp, tkwin, string\fR)
.sp
-\fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR
+\fBTk_PreserveColormap\fR(\fIdisplay, colormap\fR)
.sp
-\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR
+\fBTk_FreeColormap\fR(\fIdisplay, colormap\fR)
+.fi
.SH ARGUMENTS
.AS "Colormap" colormap
.AP Tcl_Interp *interp in
diff --git a/doc/GetColor.3 b/doc/GetColor.3
index 15254aa..bfb7ac0 100644
--- a/doc/GetColor.3
+++ b/doc/GetColor.3
@@ -15,26 +15,27 @@ Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_Na
\fB#include <tk.h>\fR
.sp
XColor *
-\fBTk_AllocColorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
+\fBTk_AllocColorFromObj\fR(\fIinterp, tkwin, objPtr\fR)
.sp
XColor *
-\fBTk_GetColor(\fIinterp, tkwin, name\fB)\fR
+\fBTk_GetColor\fR(\fIinterp, tkwin, name\fR)
.sp
XColor *
-\fBTk_GetColorFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_GetColorFromObj\fR(\fItkwin, objPtr\fR)
.sp
XColor *
-\fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR
+\fBTk_GetColorByValue\fR(\fItkwin, prefPtr\fR)
.sp
const char *
-\fBTk_NameOfColor(\fIcolorPtr\fB)\fR
+\fBTk_NameOfColor\fR(\fIcolorPtr\fR)
.sp
GC
-\fBTk_GCForColor(\fIcolorPtr, drawable\fB)\fR
+\fBTk_GCForColor\fR(\fIcolorPtr, drawable\fR)
.sp
-\fBTk_FreeColorFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_FreeColorFromObj\fR(\fItkwin, objPtr\fR)
.sp
-\fBTk_FreeColor(\fIcolorPtr\fB)\fR
+\fBTk_FreeColor\fR(\fIcolorPtr\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *colorPtr
.AP Tcl_Interp *interp in
@@ -71,6 +72,7 @@ in a particular window. The desired color is specified with a
value whose string value must have one of the following forms:
.TP 20
\fIcolorname\fR
+.
Any of the valid textual names for a color defined in the
server's color database file, such as \fBred\fR or \fBPeachPuff\fR.
.TP 20
@@ -81,6 +83,7 @@ server's color database file, such as \fBred\fR or \fBPeachPuff\fR.
\fB#\fIRRRGGGBBB\fR
.TP 20
\fB#\fIRRRRGGGGBBBB\fR
+.
A numeric specification of the red, green, and blue intensities
to use to display the color. Each \fIR\fR, \fIG\fR, or \fIB\fR
represents a single hexadecimal digit. The four forms permit
diff --git a/doc/GetCursor.3 b/doc/GetCursor.3
index 403c05e..6f8e34f 100644
--- a/doc/GetCursor.3
+++ b/doc/GetCursor.3
@@ -15,23 +15,24 @@ Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData,
\fB#include <tk.h>\fR
.sp
Tk_Cursor
-\fBTk_AllocCursorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
+\fBTk_AllocCursorFromObj\fR(\fIinterp, tkwin, objPtr\fR)
.sp
Tk_Cursor
-\fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR
+\fBTk_GetCursor\fR(\fIinterp, tkwin, name\fR)
.sp
Tk_Cursor
-\fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_GetCursorFromObj\fR(\fItkwin, objPtr\fR)
.sp
Tk_Cursor
-\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
+\fBTk_GetCursorFromData\fR(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fR)
.sp
const char *
-\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
+\fBTk_NameOfCursor\fR(\fIdisplay, cursor\fR)
.sp
-\fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_FreeCursorFromObj\fR(\fItkwin, objPtr\fR)
.sp
-\fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR
+\fBTk_FreeCursor\fR(\fIdisplay, cursor\fR)
+.fi
.SH ARGUMENTS
.AS "unsigned long" *pixelPtr
.AP Tcl_Interp *interp in
@@ -87,6 +88,7 @@ if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl
list with one of the following forms:
.TP
\fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]]
+.
\fIName\fR is the name of a cursor in the standard X cursor cursor,
i.e., any of the names defined in \fBcursorcursor.h\fR, without
the \fBXC_\fR. Some example values are \fBX_cursor\fR, \fBhand2\fR,
@@ -115,6 +117,7 @@ in preference to black and white cursors.
.RE
.TP
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
+.
In this form, \fIsourceName\fR and \fImaskName\fR are the names of
files describing cursors for the cursor's source bits and mask.
Each file must be in standard X11 cursor format.
@@ -124,12 +127,14 @@ cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This
form of the command will not work on Macintosh or Windows computers.
.TP
\fB@\fIsourceName\0fgColor\fR
+.
This form is similar to the one above, except that the source is
used as mask also. This means that the cursor's background is
transparent. This form of the command will not work on Macintosh
or Windows computers.
.TP
\fB@\fIsourceName\fR
+.
This form only works on Windows, and will load a Windows system
cursor (\fB.ani\fR or \fB.cur\fR) from the file specified in
\fIsourceName\fR.
@@ -196,7 +201,7 @@ argument that was passed to \fBTk_GetCursor\fR to create the
cursor. If \fIcursor\fR was created by a call to \fBTk_GetCursorFromData\fR,
or by any other mechanism, then the return value is a hexadecimal string
giving the X identifier for the cursor.
-Note: the string returned by \fBTk_NameOfCursor\fR is
+Note that the string returned by \fBTk_NameOfCursor\fR is
only guaranteed to persist until the next call to
\fBTk_NameOfCursor\fR. Also, this call is not portable except for
cursors returned by \fBTk_GetCursor\fR.
diff --git a/doc/GetFont.3 b/doc/GetFont.3
index 9497556..60e8232 100644
--- a/doc/GetFont.3
+++ b/doc/GetFont.3
@@ -15,25 +15,25 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FontGetDes
\fB#include <tk.h>\fR
.sp
Tk_Font
-\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR
+\fBTk_AllocFontFromObj\fR(\fIinterp, tkwin, objPtr\fR)
.sp
Tk_Font
-\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR
+\fBTk_GetFont\fR(\fIinterp, tkwin, string\fR)
.sp
Tk_Font
-\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_GetFontFromObj\fR(\fItkwin, objPtr\fR)
.sp
Tcl_Obj *
-\fBTk_FontGetDescription(\fItkfont\fB)\fR
+\fBTk_FontGetDescription\fR(\fItkfont\fR)
.sp
const char *
-\fBTk_NameOfFont(\fItkfont\fB)\fR
+\fBTk_NameOfFont\fR(\fItkfont\fR)
.sp
Tk_Font
-\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR
+\fBTk_FreeFontFromObj\fR(\fItkwin, objPtr\fR)
.sp
-void
-\fBTk_FreeFont(\fItkfont\fB)\fR
+\fBTk_FreeFont\fR(\fItkfont\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *tkfont
.AP "Tcl_Interp" *interp in
@@ -92,7 +92,8 @@ shared for all uses. The underlying resources will be freed automatically
when no-one is using the font anymore.
.PP
The procedure \fBTk_FontGetDescription\fR returns information about the font
-description as a Tcl list. One possible result is "{{DejaVu Sans} -16 bold underline}".
+description as a Tcl list. One possible result is
+.QW "{{DejaVu Sans} -16 bold underline}" .
.PP
The procedure \fBTk_NameOfFont\fR is roughly the inverse of
\fBTk_GetFont\fR. Given a \fItkfont\fR that was created by
diff --git a/doc/GetGC.3 b/doc/GetGC.3
index 6ee63a9..2b02c9d 100644
--- a/doc/GetGC.3
+++ b/doc/GetGC.3
@@ -17,7 +17,8 @@ Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts
GC
\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR)
.sp
-\fBTk_FreeGC(\fIdisplay, gc\fR)
+\fBTk_FreeGC\fR(\fIdisplay, gc\fR)
+.fi
.SH ARGUMENTS
.AS "unsigned long" valueMask
.AP Tk_Window tkwin in
diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3
index 8f82ee9..2069f3f 100644
--- a/doc/GetHINSTANCE.3
+++ b/doc/GetHINSTANCE.3
@@ -13,6 +13,7 @@ Tk_GetHINSTANCE \- retrieve the global application instance handle
.sp
HINSTANCE
\fBTk_GetHINSTANCE\fR()
+.fi
.BE
.SH DESCRIPTION
.PP
diff --git a/doc/GetHWND.3 b/doc/GetHWND.3
index 1e8cdc9..bf780b4 100644
--- a/doc/GetHWND.3
+++ b/doc/GetHWND.3
@@ -16,6 +16,7 @@ HWND
.sp
Window
\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR)
+.fi
.SH ARGUMENTS
.AP Window window in
X token for window.
diff --git a/doc/GetImage.3 b/doc/GetImage.3
index c437db7..7d899d8 100644
--- a/doc/GetImage.3
+++ b/doc/GetImage.3
@@ -22,6 +22,7 @@ Tk_Image
\fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR)
.sp
\fBTk_FreeImage\fR(\fIimage\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ImageChangedProc *changeProc
.AP Tcl_Interp *interp in
diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3
index 616719c..cef93c2 100644
--- a/doc/GetJoinStl.3
+++ b/doc/GetJoinStl.3
@@ -15,10 +15,11 @@ Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR
+\fBTk_GetJoinStyle\fR(\fIinterp, string, joinPtr\fR)
.sp
const char *
-\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR
+\fBTk_NameOfJoinStyle\fR(\fIjoin\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *joinPtr
.AP Tcl_Interp *interp in
diff --git a/doc/GetJustify.3 b/doc/GetJustify.3
index 2e871cb..0d8d7ae 100644
--- a/doc/GetJustify.3
+++ b/doc/GetJustify.3
@@ -15,13 +15,14 @@ Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strin
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetJustifyFromObj(\fIinterp, objPtr, justifyPtr\fB)\fR
+\fBTk_GetJustifyFromObj\fR(\fIinterp, objPtr, justifyPtr\fR)
.sp
int
-\fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR
+\fBTk_GetJustify\fR(\fIinterp, string, justifyPtr\fR)
.sp
const char *
-\fBTk_NameOfJustify(\fIjustify\fB)\fR
+\fBTk_NameOfJustify\fR(\fIjustify\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_Justify" *justifyPtr
.AP Tcl_Interp *interp in
@@ -48,16 +49,13 @@ Justification style (one of the values listed below).
\fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value
corresponding to \fIobjPtr\fR's value.
This value will be one of the following:
-.TP
-\fBTK_JUSTIFY_LEFT\fR
+.IP \fBTK_JUSTIFY_LEFT\fR
Means that the text on each line should start at the left edge of
the line; as a result, the right edges of lines may be ragged.
-.TP
-\fBTK_JUSTIFY_RIGHT\fR
+.IP \fBTK_JUSTIFY_RIGHT\fR
Means that the text on each line should end at the right edge of
the line; as a result, the left edges of lines may be ragged.
-.TP
-\fBTK_JUSTIFY_CENTER\fR
+.IP \fBTK_JUSTIFY_CENTER\fR
Means that the text on each line should be centered; as a result,
both the left and right edges of lines may be ragged.
.PP
diff --git a/doc/GetOption.3 b/doc/GetOption.3
index 799786d..b727965 100644
--- a/doc/GetOption.3
+++ b/doc/GetOption.3
@@ -16,6 +16,7 @@ Tk_GetOption \- retrieve an option from the option database
.sp
Tk_Uid
\fBTk_GetOption\fR(\fItkwin, name, class\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window *class
.AP Tk_Window tkwin in
diff --git a/doc/GetPixels.3 b/doc/GetPixels.3
index 568c601..8a05a81 100644
--- a/doc/GetPixels.3
+++ b/doc/GetPixels.3
@@ -15,19 +15,20 @@ Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM, Tk_GetDouble
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR
+\fBTk_GetPixelsFromObj\fR(\fIinterp, tkwin, objPtr, intPtr\fR)
.sp
int
-\fBTk_GetDoublePixelsFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR
+\fBTk_GetDoublePixelsFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR)
.sp
int
-\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR
+\fBTk_GetPixels\fR(\fIinterp, tkwin, string, intPtr\fR)
.sp
int
-\fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR
+\fBTk_GetMMFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR)
.sp
int
-\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR
+\fBTk_GetScreenMM\fR(\fIinterp, tkwin, string, doublePtr\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *joinPtr
.AP Tcl_Interp *interp in
@@ -56,20 +57,15 @@ In either case,
specifies a screen distance as a
floating-point number followed by one of the following characters
that indicates units:
-.TP
-<none>
+.IP <none>
The number specifies a distance in pixels.
-.TP
-\fBc\fR
+.IP \fBc\fR
The number specifies a distance in centimeters on the screen.
-.TP
-\fBi\fR
+.IP \fBi\fR
The number specifies a distance in inches on the screen.
-.TP
-\fBm\fR
+.IP \fBm\fR
The number specifies a distance in millimeters on the screen.
-.TP
-\fBp\fR
+.IP \fBp\fR
The number specifies a distance in printer's points (1/72 inch)
on the screen.
.PP
diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3
index 65fae2d..e9388df 100644
--- a/doc/GetPixmap.3
+++ b/doc/GetPixmap.3
@@ -15,9 +15,10 @@ Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps
\fB#include <tk.h>\fR
.sp
Pixmap
-\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR
+\fBTk_GetPixmap\fR(\fIdisplay, d, width, height, depth\fR)
.sp
-\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR
+\fBTk_FreePixmap\fR(\fIdisplay, pixmap\fR)
+.fi
.SH ARGUMENTS
.AS "Drawable" *pixelPtr
.AP Display *display in
diff --git a/doc/GetRelief.3 b/doc/GetRelief.3
index 5979662..528e1ba 100644
--- a/doc/GetRelief.3
+++ b/doc/GetRelief.3
@@ -15,13 +15,14 @@ Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetReliefFromObj(\fIinterp, objPtr, reliefPtr\fB)\fR
+\fBTk_GetReliefFromObj\fR(\fIinterp, objPtr, reliefPtr\fR)
.sp
int
-\fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR
+\fBTk_GetRelief\fR(\fIinterp, name, reliefPtr\fR)
.sp
const char *
-\fBTk_NameOfRelief(\fIrelief\fB)\fR
+\fBTk_NameOfRelief\fR(\fIrelief\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *reliefPtr
.AP Tcl_Interp *interp in
diff --git a/doc/GetRootCrd.3 b/doc/GetRootCrd.3
index 20520ea..46715c4 100644
--- a/doc/GetRootCrd.3
+++ b/doc/GetRootCrd.3
@@ -15,6 +15,7 @@ Tk_GetRootCoords \- Compute root-window coordinates of window
\fB#include <tk.h>\fR
.sp
\fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
diff --git a/doc/GetScroll.3 b/doc/GetScroll.3
index 91a2585..0322991 100644
--- a/doc/GetScroll.3
+++ b/doc/GetScroll.3
@@ -15,15 +15,16 @@ Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR
+\fBTk_GetScrollInfoObj\fR(\fIinterp, objc, objv, fractionPtr, stepsPtr\fR)
.sp
int
-\fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR
+\fBTk_GetScrollInfo\fR(\fIinterp, argc, argv, fractionPtr, stepsPtr\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *fractionPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP int objc in
+.AP Tcl_Size objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP "Tcl_Obj *const *" objv in
Argument objects. These represent the entire widget command, of
diff --git a/doc/GetSelect.3 b/doc/GetSelect.3
index 455b142..89760cc 100644
--- a/doc/GetSelect.3
+++ b/doc/GetSelect.3
@@ -16,6 +16,7 @@ Tk_GetSelection \- retrieve the contents of a selection
.sp
int
\fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tk_GetSelProc clientData
.AP Tcl_Interp *interp in
diff --git a/doc/GetUid.3 b/doc/GetUid.3
index 2cd95ad..407179e 100644
--- a/doc/GetUid.3
+++ b/doc/GetUid.3
@@ -16,6 +16,7 @@ Tk_GetUid, Tk_Uid \- convert from string to unique identifier
.sp
Tk_Uid
\fBTk_GetUid\fR(\fIstring\fR)
+.fi
.SH ARGUMENTS
.AP char *string in
String for which the corresponding unique identifier is
diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3
index 7e6003a..777d0a3 100644
--- a/doc/GetVRoot.3
+++ b/doc/GetVRoot.3
@@ -14,7 +14,8 @@ Tk_GetVRootGeometry \- Get location and size of virtual root for window
.nf
\fB#include <tk.h>\fR
.sp
-\fBTk_GetVRootGeometry(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fB)\fR
+\fBTk_GetVRootGeometry\fR(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window heightPtr
.AP Tk_Window tkwin in
diff --git a/doc/GetVisual.3 b/doc/GetVisual.3
index fc6b6f8..e88f69b 100644
--- a/doc/GetVisual.3
+++ b/doc/GetVisual.3
@@ -15,7 +15,8 @@ Tk_GetVisual \- translate from string to visual
\fB#include <tk.h>\fR
.sp
Visual *
-\fBTk_GetVisual(\fIinterp, tkwin, string, depthPtr, colormapPtr\fB)\fR
+\fBTk_GetVisual\fR(\fIinterp, tkwin, string, depthPtr, colormapPtr\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Interp" *colormapPtr
.AP Tcl_Interp *interp in
@@ -48,6 +49,7 @@ The \fIstring\fR argument specifies the desired visual in one
of the following ways:
.TP 15
\fIclass depth\fR
+.
The string consists of a class name followed by an integer depth,
with any amount of white space (including none) in between.
\fIclass\fR selects what sort of visual is desired and must be one of
@@ -62,17 +64,21 @@ looks first for a visual with greater depth, then one with less
depth.
.TP 15
\fBdefault\fR
+.
Use the default visual for \fItkwin\fR's screen.
.TP 15
\fIpathName\fR
+.
Use the visual for the window given by \fIpathName\fR.
\fIpathName\fR must be the name of a window on the same screen
as \fItkwin\fR.
.TP 15
\fInumber\fR
+.
Use the visual whose X identifier is \fInumber\fR.
.TP 15
\fBbest\fR ?\fIdepth\fR?
+.
Choose the
.QW "best possible"
visual, using the following rules, in decreasing order of priority:
diff --git a/doc/Grab.3 b/doc/Grab.3
index 4966edb..fc78dd2 100644
--- a/doc/Grab.3
+++ b/doc/Grab.3
@@ -14,8 +14,8 @@ Tk_Grab, Tk_Ungrab \- manipulate grab state in an application
int
\fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR)
.sp
-void
\fBTk_Ungrab\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AP Tcl_Interp *interp in
Interpreter to use for error reporting
diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3
index c5dafdd..64adebf 100644
--- a/doc/HWNDToWindow.3
+++ b/doc/HWNDToWindow.3
@@ -13,6 +13,7 @@ Tk_HWNDToWindow \- Find Tk's window information for a Windows window
.sp
Tk_Window
\fBTk_HWNDToWindow\fR(\fIhwnd\fR)
+.fi
.SH ARGUMENTS
.AP HWND hwnd in
Windows handle for the window.
diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3
index af3fde6..9b9ffc0 100644
--- a/doc/HandleEvent.3
+++ b/doc/HandleEvent.3
@@ -15,6 +15,7 @@ Tk_HandleEvent \- invoke event handlers for window system events
\fB#include <tk.h>\fR
.sp
\fBTk_HandleEvent\fR(\fIeventPtr\fR)
+.fi
.SH ARGUMENTS
.AS XEvent *eventPtr
.AP XEvent *eventPtr in
diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3
index f8ce1f9..5c7c896 100644
--- a/doc/IdToWindow.3
+++ b/doc/IdToWindow.3
@@ -15,6 +15,7 @@ Tk_IdToWindow \- Find Tk's window information for an X window
.sp
Tk_Window
\fBTk_IdToWindow\fR(\fIdisplay, window\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window display
.AP Display *display in
diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3
index ed47d26..9faa7aa 100644
--- a/doc/ImgChanged.3
+++ b/doc/ImgChanged.3
@@ -15,6 +15,7 @@ Tk_ImageChanged \- notify widgets that image needs to be redrawn
\fB#include <tk.h>\fR
.sp
\fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ImageModel imageHeight
.AP Tk_ImageModel model in
diff --git a/doc/Inactive.3 b/doc/Inactive.3
index ea8d735..46327d2 100644
--- a/doc/Inactive.3
+++ b/doc/Inactive.3
@@ -12,9 +12,10 @@ Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity tim
\fB#include <tk.h>\fR
.sp
long
-\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
+\fBTk_GetUserInactiveTime\fR(\fIdisplay\fR)
.sp
-\fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR
+\fBTk_ResetUserInactiveTime\fR(\fIdisplay\fR)
+.fi
.SH ARGUMENTS
.AS Display *display
.AP Display *display in
diff --git a/doc/InternAtom.3 b/doc/InternAtom.3
index e6756a5..7f1a68b 100644
--- a/doc/InternAtom.3
+++ b/doc/InternAtom.3
@@ -15,10 +15,11 @@ Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms
\fB#include <tk.h>\fR
.sp
Atom
-\fBTk_InternAtom(\fItkwin, name\fR)
+\fBTk_InternAtom\fR(\fItkwin, name\fR)
.sp
const char *
-\fBTk_GetAtomName(\fItkwin, atom\fR)
+\fBTk_GetAtomName\fR(\fItkwin, atom\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
diff --git a/doc/MainLoop.3 b/doc/MainLoop.3
index 770f254..7dbda0f 100644
--- a/doc/MainLoop.3
+++ b/doc/MainLoop.3
@@ -15,6 +15,7 @@ Tk_MainLoop \- loop for events until all windows are deleted
\fB#include <tk.h>\fR
.sp
\fBTk_MainLoop\fR()
+.fi
.BE
.SH DESCRIPTION
.PP
diff --git a/doc/MainWin.3 b/doc/MainWin.3
index b11b6cd..d6da326 100644
--- a/doc/MainWin.3
+++ b/doc/MainWin.3
@@ -17,14 +17,13 @@ Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window inform
Tk_Window
\fBTk_MainWindow\fR(\fIinterp\fR)
.sp
-void
\fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR)
.sp
-void
\fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR)
.sp
int
\fBTk_GetNumMainWindows\fR()
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *pathName
.AP Tcl_Interp *interp in/out
@@ -52,7 +51,7 @@ leaves an error message in interpreter \fIinterp\fR's result.
windows currently open in the current thread.
\fBTk_SetMainMenubar\fR
Called when a toplevel widget is brought to front. On the Macintosh,
-sets up the menubar that goes accross the top of the main monitor. On
+sets up the menubar that goes across the top of the main monitor. On
other platforms, nothing is necessary.
\fBTk_SetWindowMenubar\fR associates a menu with a window.
The old menu clones for the menubar are thrown away, and a handler is
diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3
index d6418b5..0196a0d 100644
--- a/doc/MaintGeom.3
+++ b/doc/MaintGeom.3
@@ -17,6 +17,7 @@ Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window re
\fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR)
.sp
\fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window container
.AP Tk_Window window in
diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3
index dd69273..dd2703c 100644
--- a/doc/ManageGeom.3
+++ b/doc/ManageGeom.3
@@ -15,6 +15,7 @@ Tk_ManageGeometry \- arrange to handle geometry requests for a window
\fB#include <tk.h>\fR
.sp
\fBTk_ManageGeometry\fR(\fItkwin, mgrPtr, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tk_GeometryProc clientData
.AP Tk_Window tkwin in
diff --git a/doc/MapWindow.3 b/doc/MapWindow.3
index a3c6296..7de87df 100644
--- a/doc/MapWindow.3
+++ b/doc/MapWindow.3
@@ -18,6 +18,7 @@ Tk_Window
\fBTk_MapWindow\fR(\fItkwin\fR)
.sp
\fBTk_UnmapWindow\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3
index 3959978..1f62a55 100644
--- a/doc/MeasureChar.3
+++ b/doc/MeasureChar.3
@@ -14,15 +14,15 @@ Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to me
\fB#include <tk.h>\fR
.sp
int
-\fBTk_MeasureChars(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fB)\fR
+\fBTk_MeasureChars\fR(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fR)
.sp
int
-\fBTk_TextWidth(\fItkfont, string, numBytes\fB)\fR
+\fBTk_TextWidth\fR(\fItkfont, string, numBytes\fR)
.sp
-\fBTk_DrawChars(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fB)\fR
-.sp
-\fBTk_UnderlineChars(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fB)\fR
+\fBTk_DrawChars\fR(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fR)
.sp
+\fBTk_UnderlineChars\fR(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fR)
+.fi
.SH ARGUMENTS
.AS "const char" firstChar
.AP Tk_Font tkfont in
@@ -33,7 +33,7 @@ Text to be measured or displayed. Need not be null terminated. Any
non-printing meta-characters in the string (such as tabs, newlines, and
other control characters) will be measured or displayed in a
platform-dependent manner.
-.AP int numBytes in
+.AP Tcl_Size numBytes in
The maximum number of bytes to consider when measuring or drawing
\fIstring\fR. Must be greater than or equal to 0.
.AP int maxPixels in
@@ -48,8 +48,8 @@ otherwise, a character must fit completely to be considered.
\fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If
\fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no
characters could fit in the length given by \fImaxPixels\fR. If
-\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if
-not even one word fits on the line, return the first few letters of the
+\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means
+that if not even one word fits on the line, return the first few letters of the
word that did fit; if not even one letter of the word fit, then the first
letter will still be returned.
.AP int *lengthPtr out
diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3
index f67627f..a8646f3 100644
--- a/doc/MoveToplev.3
+++ b/doc/MoveToplev.3
@@ -14,7 +14,8 @@ Tk_MoveToplevelWindow \- Adjust the position of a top-level window
.nf
\fB#include <tk.h>\fR
.sp
-\fBTk_MoveToplevelWindow(\fItkwin, x, y\fB)\fR
+\fBTk_MoveToplevelWindow\fR(\fItkwin, x, y\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
diff --git a/doc/Name.3 b/doc/Name.3
index 1653cf5..538c57c 100644
--- a/doc/Name.3
+++ b/doc/Name.3
@@ -22,6 +22,7 @@ char *
.sp
Tk_Window
\fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *pathName
.AP Tk_Window tkwin in
diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3
index 781650f..afca117 100644
--- a/doc/NameOfImg.3
+++ b/doc/NameOfImg.3
@@ -15,6 +15,7 @@ Tk_NameOfImage \- Return name of image.
.sp
const char *
\fBTk_NameOfImage\fR(\fIimageModel\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ImageModel imageModel
.AP Tk_ImageModel imageModel in
diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3
index 67bac55..eb8eabe 100644
--- a/doc/OwnSelect.3
+++ b/doc/OwnSelect.3
@@ -15,6 +15,7 @@ Tk_OwnSelection \- make a window the owner of the primary selection
\fB#include <tk.h>\fR
.sp
\fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tk_LostSelProc clientData
.AP Tk_Window tkwin in
diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3
index 727dcfa..08ad292 100644
--- a/doc/ParseArgv.3
+++ b/doc/ParseArgv.3
@@ -16,6 +16,7 @@ Tk_ParseArgv \- process command-line options
.sp
int
\fBTk_ParseArgv\fR(\fIinterp, tkwin, argcPtr, argv, argTable, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ArgvInfo *argTable
.AP Tcl_Interp *interp in
@@ -113,18 +114,15 @@ after the matching argument, which is called
.QW "the following argument" .
The legal values for \fItype\fR, and the processing
that they cause, are as follows:
-.TP
-\fBTK_ARGV_END\fR
+.IP \fBTK_ARGV_END\fR
Marks the end of the table. The last entry in \fIargTable\fR
must have this type; all of its other fields are ignored and it
will never match any arguments.
-.TP
-\fBTK_ARGV_CONSTANT\fR
+.IP \fBTK_ARGV_CONSTANT\fR
\fISrc\fR is treated as an integer and \fIdst\fR is treated
as a pointer to an integer. \fISrc\fR is stored at \fI*dst\fR.
The matching argument is discarded.
-.TP
-\fBTK_ARGV_INT\fR
+.IP \fBTK_ARGV_INT\fR
The following argument must contain an
integer string in the format accepted by \fBstrtol\fR (e.g.
.QW 0
@@ -135,22 +133,19 @@ numbers, respectively). \fIDst\fR is treated as a pointer to an
integer; the following argument is converted to an integer value
and stored at \fI*dst\fR. \fISrc\fR is ignored. The matching
and following arguments are discarded from \fIargv\fR.
-.TP
-\fBTK_ARGV_FLOAT\fR
+.IP \fBTK_ARGV_FLOAT\fR
The following argument must contain a floating-point number in
the format accepted by \fBstrtol\fR.
\fIDst\fR is treated as the address of a double-precision
floating point value; the following argument is converted to a
double-precision value and stored at \fI*dst\fR. The matching
and following arguments are discarded from \fIargv\fR.
-.TP
-\fBTK_ARGV_STRING\fR
+.IP \fBTK_ARGV_STRING\fR
In this form, \fIdst\fR is treated as a pointer to a (char *);
\fBTk_ParseArgv\fR stores at \fI*dst\fR a pointer to the following
argument, and discards the matching and following arguments from
\fIargv\fR. \fISrc\fR is ignored.
-.TP
-\fBTK_ARGV_UID\fR
+.IP \fBTK_ARGV_UID\fR
This form is similar to \fBTK_ARGV_STRING\fR, except that the argument
is turned into a Tk_Uid by calling \fBTk_GetUid\fR.
\fIDst\fR is treated as a pointer to a
@@ -158,32 +153,28 @@ Tk_Uid; \fBTk_ParseArgv\fR stores at \fI*dst\fR the Tk_Uid
corresponding to the following
argument, and discards the matching and following arguments from
\fIargv\fR. \fISrc\fR is ignored.
-.TP
-\fBTK_ARGV_CONST_OPTION\fR
+.IP \fBTK_ARGV_CONST_OPTION\fR
This form causes a Tk option to be set (as if the \fBoption\fR
command had been invoked). The \fIsrc\fR field is treated as a
pointer to a string giving the value of an option, and \fIdst\fR
is treated as a pointer to the name of the option. The matching
argument is discarded. If \fItkwin\fR is NULL, then argument
specifiers of this type are ignored (as if they did not exist).
-.TP
-\fBTK_ARGV_OPTION_VALUE\fR
+.IP \fBTK_ARGV_OPTION_VALUE\fR
This form is similar to \fBTK_ARGV_CONST_OPTION\fR, except that the
value of the option is taken from the following argument instead
of from \fIsrc\fR. \fIDst\fR is used as the name of the option.
\fISrc\fR is ignored. The matching and following arguments
are discarded. If \fItkwin\fR is NULL, then argument
specifiers of this type are ignored (as if they did not exist).
-.TP
-\fBTK_ARGV_OPTION_NAME_VALUE\fR
+.IP \fBTK_ARGV_OPTION_NAME_VALUE\fR
In this case the following argument is taken as the name of a Tk
option and the argument after that is taken as the value for that
option. Both \fIsrc\fR and \fIdst\fR are ignored. All three
arguments are discarded from \fIargv\fR. If \fItkwin\fR is NULL,
then argument
specifiers of this type are ignored (as if they did not exist).
-.TP
-\fBTK_ARGV_HELP\fR
+.IP \fBTK_ARGV_HELP\fR
When this kind of option is encountered, \fBTk_ParseArgv\fR uses the
\fIhelp\fR fields of \fIargTable\fR to format a message describing
all the valid arguments. The message is placed in interpreter
@@ -194,8 +185,7 @@ field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will
never match any arguments; in this case the specifier simply provides
extra documentation, which will be included when some other
\fBTK_ARGV_HELP\fR entry causes help information to be returned.
-.TP
-\fBTK_ARGV_REST\fR
+.IP \fBTK_ARGV_REST\fR
This option is used by programs or commands that allow the last
several of their options to be the name and/or options for some
other program. If a \fBTK_ARGV_REST\fR argument is found, then
@@ -207,8 +197,7 @@ integer value, and stores at \fI*dst\fR the index of the first of the
\fBTK_ARGV_REST\fR options in the returned \fIargv\fR. This allows the
program to distinguish the \fBTK_ARGV_REST\fR options from other
unprocessed options that preceded the \fBTK_ARGV_REST\fR.
-.TP
-\fBTK_ARGV_FUNC\fR
+.IP \fBTK_ARGV_FUNC\fR
For this kind of argument, \fIsrc\fR is treated as the address of
a procedure, which is invoked to process the following argument.
The procedure should have the following structure:
@@ -232,8 +221,7 @@ should return 0 and \fBTkParseArgv\fR will process the following
argument in the normal fashion. In either event the matching argument
is discarded.
.RE
-.TP
-\fBTK_ARGV_GENFUNC\fR
+.IP \fBTK_ARGV_GENFUNC\fR
This form provides a more general procedural escape. It treats
\fIsrc\fR as the address of a procedure, and passes that procedure
all of the remaining arguments. The procedure should have the following
@@ -266,27 +254,23 @@ in the usual Tcl fashion, and return \-1; when this happens
\fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR.
.RE
.SS "FLAGS"
-.TP
-\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
+.IP \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
\fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program
or command name, and returns it to the caller just as if it
had not matched \fIargTable\fR. If this flag is given, then
\fIargv[0]\fR is not given special treatment.
-.TP
-\fBTK_ARGV_NO_ABBREV\fR
+.IP \fBTK_ARGV_NO_ABBREV\fR
Normally, \fBTk_ParseArgv\fR accepts unique abbreviations for
\fIkey\fR values in \fIargTable\fR. If this flag is given then
only exact matches will be acceptable.
-.TP
-\fBTK_ARGV_NO_LEFTOVERS\fR
+.IP \fBTK_ARGV_NO_LEFTOVERS\fR
Normally, \fBTk_ParseArgv\fR returns unrecognized arguments to the
caller. If this bit is set in \fIflags\fR then \fBTk_ParseArgv\fR
will return an error if it encounters any argument that does not
match \fIargTable\fR. The only exception to this rule is \fIargv[0]\fR,
which will be returned to the caller with no errors as
long as \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR is not specified.
-.TP
-\fBTK_ARGV_NO_DEFAULTS\fR
+.IP \fBTK_ARGV_NO_DEFAULTS\fR
Normally, \fBTk_ParseArgv\fR searches an internal table of
standard argument specifiers in addition to \fIargTable\fR. If
this bit is set in \fIflags\fR, then \fBTk_ParseArgv\fR will
@@ -312,11 +296,11 @@ Boolean exec = FALSE;
* Define option descriptions.
*/
Tk_ArgvInfo argTable[] = {
- {"\-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag,
+ {"-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag,
"Turn on debugging printfs"},
- {"\-N", TK_ARGV_INT, NULL, &numReps,
+ {"-N", TK_ARGV_INT, NULL, &numReps,
"Number of repetitions"},
- {"\-of", TK_ARGV_STRING, NULL, &fileName,
+ {"-of", TK_ARGV_STRING, NULL, &fileName,
"Name of file for output"},
{"x", TK_ARGV_REST, NULL, &exec,
"File to exec, followed by any arguments (must be last argument)."},
@@ -324,9 +308,7 @@ Tk_ArgvInfo argTable[] = {
NULL}
};
-main(argc, argv)
- int argc;
- char *argv[];
+int main(int argc, char *argv[])
{
\&...
@@ -346,9 +328,9 @@ Note that default values can be assigned to variables named in
particular arguments are present in \fIargv\fR.
Here are some example command lines and their effects.
.CS
-prog \-N 200 infile # just sets the numReps variable to 200
-prog \-of out200 infile # sets fileName to reference "out200"
-prog \-XN 10 infile # sets the debug flag, also sets numReps
+prog -N 200 infile # just sets the numReps variable to 200
+prog -of out200 infile # sets fileName to reference "out200"
+prog -XN 10 infile # sets the debug flag, also sets numReps
.CE
In all of the above examples, \fIargc\fR will be set by \fBTk_ParseArgv\fR to 2,
\fIargv\fR[0] will be
diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3
index 9c43ce5..28db0c9 100644
--- a/doc/QWinEvent.3
+++ b/doc/QWinEvent.3
@@ -17,6 +17,7 @@ int
\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR)
.sp
\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_QueuePosition position
.AP Display *display in
diff --git a/doc/Restack.3 b/doc/Restack.3
index 5cd02eb..59ab9ec 100644
--- a/doc/Restack.3
+++ b/doc/Restack.3
@@ -16,6 +16,7 @@ Tk_RestackWindow \- Change a window's position in the stacking order
.sp
int
\fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window aboveBelow
.AP Tk_Window tkwin in
diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3
index f61e764..fdf2250 100644
--- a/doc/RestrictEv.3
+++ b/doc/RestrictEv.3
@@ -16,6 +16,7 @@ Tk_RestrictEvents \- filter and selectively delay X events
.sp
Tk_RestrictProc *
\fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_RestrictProc **prevArgPtr
.AP Tk_RestrictProc *proc in
diff --git a/doc/SetAppName.3 b/doc/SetAppName.3
index 91516a0..84984a7 100644
--- a/doc/SetAppName.3
+++ b/doc/SetAppName.3
@@ -16,6 +16,7 @@ Tk_SetAppName \- Set the name of an application for 'send' commands
.sp
const char *
\fBTk_SetAppName\fR(\fItkwin, name\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
diff --git a/doc/SetCaret.3 b/doc/SetCaret.3
index 24cc18c..401b57f 100644
--- a/doc/SetCaret.3
+++ b/doc/SetCaret.3
@@ -15,6 +15,7 @@ Tk_SetCaretPos \- set the display caret location
.sp
int
\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR)
+.fi
.SH ARGUMENTS
.AP Tk_Window tkwin in
Token for window.
diff --git a/doc/SetClass.3 b/doc/SetClass.3
index 0ea81bb..c5a02c8 100644
--- a/doc/SetClass.3
+++ b/doc/SetClass.3
@@ -18,6 +18,7 @@ Tk_SetClass, Tk_Class \- set or retrieve a window's class
.sp
Tk_Uid
\fBTk_Class\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3
index d8f89a4..c0a702f 100644
--- a/doc/SetClassProcs.3
+++ b/doc/SetClassProcs.3
@@ -14,6 +14,7 @@ Tk_SetClassProcs \- register widget specific procedures
\fB#include <tk.h>\fR
.sp
\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR)
+.fi
.SH ARGUMENTS
.AS Tk_ClassProc instanceData
.AP Tk_Window tkwin in
@@ -32,7 +33,7 @@ are used as callbacks in different places.
.PP
The structure pointed to by \fIprocs\fR contains the following:
.CS
-typedef struct Tk_ClassProcs {
+typedef struct {
size_t \fIsize\fR;
Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
Tk_ClassCreateProc *\fIcreateProc\fR;
diff --git a/doc/SetGrid.3 b/doc/SetGrid.3
index ea32afb..5440ebf 100644
--- a/doc/SetGrid.3
+++ b/doc/SetGrid.3
@@ -17,6 +17,7 @@ Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing
\fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR)
.sp
\fBTk_UnsetGrid\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window heightInc
.AP Tk_Window tkwin in
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3
index cbbe648..cc206d4 100644
--- a/doc/SetOptions.3
+++ b/doc/SetOptions.3
@@ -14,27 +14,28 @@ Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_Fr
\fB#include <tk.h>\fR
.sp
Tk_OptionTable
-\fBTk_CreateOptionTable(\fIinterp, templatePtr\fB)\fR
+\fBTk_CreateOptionTable\fR(\fIinterp, templatePtr\fR)
.sp
-\fBTk_DeleteOptionTable(\fIoptionTable\fB)\fR
+\fBTk_DeleteOptionTable\fR(\fIoptionTable\fR)
.sp
int
-\fBTk_InitOptions(\fIinterp, recordPtr, optionTable, tkwin\fB)\fR
+\fBTk_InitOptions\fR(\fIinterp, recordPtr, optionTable, tkwin\fR)
.sp
int
-\fBTk_SetOptions(\fIinterp, recordPtr, optionTable, objc, objv, tkwin, savePtr, maskPtr\fB)\fR
+\fBTk_SetOptions\fR(\fIinterp, recordPtr, optionTable, objc, objv, tkwin, savePtr, maskPtr\fR)
.sp
-\fBTk_FreeSavedOptions(\fIsavedPtr\fB)\fR
+\fBTk_FreeSavedOptions\fR(\fIsavedPtr\fR)
.sp
-\fBTk_RestoreSavedOptions(\fIsavedPtr\fB)\fR
+\fBTk_RestoreSavedOptions\fR(\fIsavedPtr\fR)
.sp
Tcl_Obj *
-\fBTk_GetOptionValue(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR
+\fBTk_GetOptionValue\fR(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fR)
.sp
Tcl_Obj *
-\fBTk_GetOptionInfo(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR
+\fBTk_GetOptionInfo\fR(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fR)
.sp
-\fBTk_FreeConfigOptions(\fIrecordPtr, optionTable, tkwin\fB)\fR
+\fBTk_FreeConfigOptions\fR(\fIrecordPtr, optionTable, tkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_SavedOptions "*const objv[]" in/out
.AP Tcl_Interp *interp in
@@ -58,7 +59,7 @@ For options such as \fBTK_OPTION_COLOR\fR, this argument indicates
the window in which the option will be used. If \fIoptionTable\fR uses
no window-dependent options, then a NULL value may be supplied for
this argument.
-.AP int objc in
+.AP Tcl_Size objc in
Number of values in \fIobjv\fR.
.AP Tcl_Obj "*const *objv" in
Command-line arguments for setting configuring options.
@@ -98,7 +99,7 @@ practice the object may not actually be a widget. The term
is used to refer to the C-level structure in
which information about a particular widget or object is stored.
.PP
-Note: the easiest way to learn how to use these procedures is to
+Note that the easiest way to learn how to use these procedures is to
look at a working example. In Tk, the simplest example is the code
that implements the button family of widgets, which is in \fBtkButton.c\fR.
Other examples are in \fBtkSquare.c\fR and \fBtkMenu.c\fR.
@@ -301,8 +302,7 @@ greater than or equal to zero.
.PP
The \fIflags\fR field consists of one or more bits ORed together. The
following flags are supported:
-.TP
-\fBTK_OPTION_NULL_OK\fR
+.IP \fBTK_OPTION_NULL_OK\fR
If this bit is set for an option then an empty string will be accepted as
the value for the option and the resulting internal form will be a NULL
pointer, a zero value, or \fBNone\fR, depending on the type of the option.
@@ -313,27 +313,25 @@ feature to be turned off entirely, e.g. set a cursor value to
Not all option types support the \fBTK_OPTION_NULL_OK\fR
flag; for those that do, there is an explicit indication of that fact
in the descriptions below.
-.TP
-\fBTK_OPTION_DONT_SET_DEFAULT\fR
+.IP \fBTK_OPTION_DONT_SET_DEFAULT\fR
If this bit is set for an option then no default value will be set in
\fBTk_InitOptions\fR for this option. Neither the option database, nor any
system default value, nor \fIoptionTable\fR are used to give a default
value to this option. Instead it is assumed that the caller has already
supplied a default value in the widget code.
-.TP
-\fBTK_OPTION_ENUM_VAR\fR
+.IP \fBTK_OPTION_ENUM_VAR\fR
If this value is set for an option, then it indicates the the
internalOffset points to an enum variable in stead of an int variable.
Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR,
\fBTK_OPTION_BOOLEAN\fR, \fBTK_OPTION_ANCHOR\fR, \fBTK_OPTION_JUSTIFY\fR,
or \fBTK_OPTION_ANCHOR\fR.
-.TP
-\fBTK_OPTION_VAR(type)\fR
+.IP \fBTK_OPTION_VAR(\fItype\fB)\fR
If this value is set for an option, then it indicates the the
internalOffset points to a \fItype\fR variable in stead of an int variable.
Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR or
\fBTK_OPTION_BOOLEAN\fR, or as \fBTK_OPTION_VAR(Tcl_Size)\fR
with \fBTK_OPTION_INT\fR
+.RS
.PP
The \fItype\fR field of each Tk_OptionSpec structure determines
how to parse the value of that configuration option. The
@@ -343,43 +341,38 @@ passed into procedures like \fBTk_SetOptions\fR, or if it uses
the \fIclientData\fR field of the Tk_OptionSpec, then it is indicated
explicitly; if not mentioned, the type requires neither \fItkwin\fR
nor \fIclientData\fR.
-.TP
-\fBTK_OPTION_ANCHOR\fR
+.RE
+.IP \fBTK_OPTION_ANCHOR\fR
The value must be a standard anchor position such as \fBne\fR or
\fBcenter\fR. The internal form is a Tk_Anchor value like the ones
-returned by \fBTk_GetAnchorFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR
-flag; if the empty string is specified as the value for the option,
-the integer relief value is set to \fBTK_ANCHOR_NULL\fR.
-.TP
-\fBTK_OPTION_BITMAP\fR
+returned by \fBTk_GetAnchorFromObj\fR. This option type supports the
+\fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the
+value for the option, the integer relief value is set to \fBTK_ANCHOR_NULL\fR.
+.IP \fBTK_OPTION_BITMAP\fR
The value must be a standard Tk bitmap name. The internal form is a
Pixmap token like the ones returned by \fBTk_AllocBitmapFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_BOOLEAN\fR
+.IP \fBTK_OPTION_BOOLEAN\fR
The value must be a standard boolean value such as \fBtrue\fR or
-\fBno\fR. The internal form is an integer with value 0 or 1. Note: if the
-\fIobjOffset\fR field is not used then information about the original value
-of this option will be lost. This option type supports the
+\fBno\fR. The internal form is an integer with value 0 or 1. Note that if
+the \fIobjOffset\fR field is not used, information about the original
+value of this option will be lost. This option type supports the
\fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal
representation is set to -1.
-.TP
-\fBTK_OPTION_BORDER\fR
+.IP \fBTK_OPTION_BORDER\fR
The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR.
The internal form is a Tk_3DBorder token like the ones returned
by \fBTk_Alloc3DBorderFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_COLOR\fR
+.IP \fBTK_OPTION_COLOR\fR
The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR.
The internal form is an (XColor *) token like the ones returned by
\fBTk_AllocColorFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_CURSOR\fR
+.IP \fBTK_OPTION_CURSOR\fR
The value must be a standard cursor name such as \fBcross\fR or \fB@foo\fR.
The internal form is a Tk_Cursor token like the ones returned by
\fBTk_AllocCursorFromObj\fR.
@@ -387,19 +380,16 @@ This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and when the option is set the cursor
for the window is changed by calling \fBXDefineCursor\fR. This
option type also supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_CUSTOM\fR
+.IP \fBTK_OPTION_CUSTOM\fR
This option allows applications to define new option types. The
clientData field of the entry points to a structure defining the new
option type. See the section \fBCUSTOM OPTION TYPES\fR below for details.
-.TP
-\fBTK_OPTION_DOUBLE\fR
+.IP \fBTK_OPTION_DOUBLE\fR
The string value must be a floating-point number in
the format accepted by \fBstrtol\fR. The internal form is a C
\fBdouble\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR
flag; if a NULL value is set, the internal representation is set to NaN.
-.TP
-\fBTK_OPTION_END\fR
+.IP \fBTK_OPTION_END\fR
Marks the end of the template. There must be a Tk_OptionSpec structure
with \fItype\fR \fBTK_OPTION_END\fR at the end of each template. If the
\fIclientData\fR field of this structure is not NULL, then it points to
@@ -407,60 +397,54 @@ an additional array of Tk_OptionSpec's, which is itself terminated by
another \fBTK_OPTION_END\fR entry. Templates may be chained arbitrarily
deeply. This feature allows common options to be shared by several
widget classes.
-.TP
-\fBTK_OPTION_FONT\fR
+.IP \fBTK_OPTION_FONT\fR
The value must be a standard font name such as \fBTimes 16\fR.
The internal form is a Tk_Font handle like the ones returned by
\fBTk_AllocFontFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_INT\fR
+.IP \fBTK_OPTION_INT\fR
The string value must be an integer in the format accepted by
\fBstrtol\fR (e.g. \fB0\fR and \fB0x\fR prefixes may be used to
-specify octal or hexadecimal numbers, respectively). The internal
-form is a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR
+specify octal or hexadecimal numbers, respectively). The internal form is
+a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR
flag; if a NULL value is set, the internal representation is set to INT_MIN.
-.TP
-\fBTK_OPTION_INDEX\fR
-The string value must be an index in the format accepted by \fBTcl_GetIntForIndex()\fR
+.IP \fBTK_OPTION_INDEX\fR
+The string value must be an index in the format accepted by
+\fBTcl_GetIntForIndex()\fR
or the empty string. The internal form is a C \fBint\fR value. If the string
-starts with \fB-\fR, the internal representation will be set to INT_MIN. If the
+starts with \fB\-\fR, the internal representation will be set to INT_MIN. If the
string has the form \fBend-???\fR, then the result will be a negative number:
\fB-1\fR stands for \fBend\fR, \fB-2\fR stands for \fBend-1\fR and so on.
This option type supports the \fBTK_OPTION_NULL_OK\fR flag;
if a NULL value is set, the internal representation is set to INT_MIN.
-.TP
-\fBTK_OPTION_JUSTIFY\fR
+.IP \fBTK_OPTION_JUSTIFY\fR
The value must be a standard justification value such as \fBleft\fR.
The internal form is a Tk_Justify like the values returned by
-\fBTk_GetJustifyFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR
+\fBTk_GetJustifyFromObj\fR. This option type supports the
+\fBTK_OPTION_NULL_OK\fR
flag; if the empty string is specified as the value for the option,
the integer relief value is set to \fBTK_JUSTIFY_NULL\fR.
-.TP
-\fBTK_OPTION_PIXELS\fR
+.IP \fBTK_OPTION_PIXELS\fR
The value must specify a screen distance such as \fB2i\fR or \fB6.4\fR.
The internal form is an integer value giving a
distance in pixels, like the values returned by
-\fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field is not
-used then information about the original value of this option will be lost.
+\fBTk_GetPixelsFromObj\fR. Note that if the \fIobjOffset\fR field is not
+used, information about the original value of this option will be lost.
See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option
type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the
internal representation is set to INT_MIN.
-.TP
-\fBTK_OPTION_RELIEF\fR
+.IP \fBTK_OPTION_RELIEF\fR
The value must be standard relief such as \fBraised\fR.
The internal form is an integer relief value such as
\fBTK_RELIEF_RAISED\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR
flag; if a NULL value is set, the internal representation is set to
\fBTK_RELIEF_NULL\fR.
-.TP
-\fBTK_OPTION_STRING\fR
+.IP \fBTK_OPTION_STRING\fR
The value may be any string. The internal form is a (char *) pointer
that points to a dynamically allocated copy of the value.
This option type supports the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fBTK_OPTION_STRING_TABLE\fR
+.IP \fBTK_OPTION_STRING_TABLE\fR
For this type, \fIclientData\fR is a pointer to an array of strings
suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must
be one of the strings in the table, or a unique abbreviation of
@@ -469,15 +453,13 @@ into the table of the matching string, like the return value
from \fBTcl_GetStringFromObj\fR. This option type supports the
\fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal
representation is set to -1.
-.TP
-\fBTK_OPTION_SYNONYM\fR
+.IP \fBTK_OPTION_SYNONYM\fR
This type is used to provide alternative names for an option (for
example, \fB\-bg\fR is often used as a synonym for \fB\-background\fR).
The \fBclientData\fR field is a string that gives the name of another
option in the same table. Whenever the synonym option is used, the
information from the other option will be used instead.
-.TP
-\fBTK_OPTION_WINDOW\fR
+.IP \fBTK_OPTION_WINDOW\fR
The value must be a window path name. The internal form is a
\fBTk_Window\fR token for the window.
This option type requires \fItkwin\fR to be supplied to procedures
@@ -527,8 +509,8 @@ the option is retrieved. In most cases it is convenient to use the
\fIinternalOffset\fR field as well, so that the integer value is
immediately available for use in the widget code (alternatively,
\fBTk_GetPixelsFromObj\fR can be used to extract the integer value from
-the object whenever it is needed). Note: the problem of losing information
-on retrievals exists only for \fBTK_OPTION_PIXELS\fR options.
+the object whenever it is needed). Note that the problem of losing
+information on retrievals exists only for \fBTK_OPTION_PIXELS\fR options.
.PP
The second reason to use the \fIobjOffset\fR field is in order to
implement new types of options not supported by these procedures.
@@ -547,7 +529,7 @@ additional configuration types by writing procedures to parse, print,
free, and restore saved copies of the type and creating a structure
pointing to those procedures:
.CS
-typedef struct Tk_ObjCustomOption {
+typedef struct {
char *name;
Tk_CustomOptionSetProc *\fIsetProc\fR;
Tk_CustomOptionGetProc *\fIgetProc\fR;
@@ -597,18 +579,14 @@ The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to
convert a Tcl_Obj into an internal representation and store the
resulting value in the widget record. The arguments are:
.RS
-.TP
-\fIclientData\fR
+.IP \fIclientData\fR
A copy of the \fIclientData\fR field in the Tk_ObjCustomOption
structure.
-.TP
-\fIinterp\fR
+.IP \fIinterp\fR
A pointer to a Tcl interpreter, used for error reporting.
-.TP
-\fITkwin\fR
+.IP \fITkwin\fR
A copy of the \fItkwin\fR argument to \fBTk_SetOptions\fR
-.TP
-\fIvaluePtr\fR
+.IP \fIvaluePtr\fR
A pointer to a reference to a Tcl_Obj describing the new value for the
option; it could have been specified explicitly in the call to
\fBTk_SetOptions\fR or it could come from the option database or a
@@ -618,22 +596,18 @@ pointer referenced by \fIvaluePtr\fR is the pointer that will be
stored at the objOffset for the option. \fISetProc\fR may modify the
value if necessary; for example, \fIsetProc\fR may change the value to
NULL to support the \fBTK_OPTION_NULL_OK\fR flag.
-.TP
-\fIrecordPtr\fR
+.IP \fIrecordPtr\fR
A pointer to the start of the widget record to modify.
-.TP
-\fIinternalOffset\fR
+.IP \fIinternalOffset\fR
Offset in bytes from the start of the widget record to the location
where the internal representation of the option value is to be placed.
-.TP
-\fIsaveInternalPtr\fR
+.IP \fIsaveInternalPtr\fR
A pointer to storage allocated in a Tk_SavedOptions structure for the
internal representation of the original option value. Before setting
the option to its new value, \fIsetProc\fR should set the value
referenced by \fIsaveInternalPtr\fR to the original value of the
option in order to support \fBTk_RestoreSavedOptions\fR.
-.TP
-\fIflags\fR
+.IP \fIflags\fR
A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the
option
.RE
diff --git a/doc/SetVisual.3 b/doc/SetVisual.3
index a5b9efd..a3b50d1 100644
--- a/doc/SetVisual.3
+++ b/doc/SetVisual.3
@@ -16,6 +16,7 @@ Tk_SetWindowVisual \- change visual characteristics of window
.sp
int
\fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR)
+.fi
.SH ARGUMENTS
.AS "Tk_Window int" colormap
.AP Tk_Window tkwin in
@@ -43,7 +44,7 @@ is called then it returns 0 and does not make any changes; otherwise
it returns 1 to signify that the operation
completed successfully.
.PP
-Note: \fBTk_SetWindowVisual\fR should not be called if you just want
+Note that \fBTk_SetWindowVisual\fR should not be called if you just want
to change a window's colormap without changing its visual or depth;
call \fBTk_SetWindowColormap\fR instead.
.SH KEYWORDS
diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3
index ec9319f..c8a6e08 100644
--- a/doc/StrictMotif.3
+++ b/doc/StrictMotif.3
@@ -15,6 +15,7 @@ Tk_StrictMotif \- Return value of tk_strictMotif variable
.sp
int
\fBTk_StrictMotif\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
diff --git a/doc/TextLayout.3 b/doc/TextLayout.3
index ab73d12..a5885b4 100644
--- a/doc/TextLayout.3
+++ b/doc/TextLayout.3
@@ -14,31 +14,28 @@ Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayo
\fB#include <tk.h>\fR
.sp
Tk_TextLayout
-\fBTk_ComputeTextLayout(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fB)\fR
+\fBTk_ComputeTextLayout\fR(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fR)
.sp
-void
-\fBTk_FreeTextLayout(\fIlayout\fB)\fR
+\fBTk_FreeTextLayout\fR(\fIlayout\fR)
.sp
-void
-\fBTk_DrawTextLayout(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fB)\fR
+\fBTk_DrawTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fR)
.sp
-void
-\fBTk_UnderlineTextLayout(\fIdisplay, drawable, gc, layout, x, y, underline\fB)\fR
+\fBTk_UnderlineTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, underline\fR)
.sp
int
-\fBTk_PointToChar(\fIlayout, x, y\fB)\fR
+\fBTk_PointToChar\fR(\fIlayout, x, y\fR)
.sp
int
-\fBTk_CharBbox(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fB)\fR
+\fBTk_CharBbox\fR(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fR)
.sp
int
-\fBTk_DistanceToTextLayout(\fIlayout, x, y\fB)\fR
+\fBTk_DistanceToTextLayout\fR(\fIlayout, x, y\fR)
.sp
int
-\fBTk_IntersectTextLayout(\fIlayout, x, y, width, height\fB)\fR
+\fBTk_IntersectTextLayout\fR(\fIlayout, x, y, width, height\fR)
.sp
-void
-\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR
+\fBTk_TextLayoutToPostscript\fR(\fIinterp, layout\fR)
+.fi
.SH ARGUMENTS
.AS Tk_TextLayout "*xPtr, *yPtr"
.AP Tk_Font tkfont in
@@ -100,10 +97,10 @@ Point, in pixels, at which to place the upper-left hand corner of the
text layout when it is being drawn, or the coordinates of a point (with
respect to the upper-left hand corner of the text layout) to check
against the text layout.
-.AP int firstChar in
+.AP Tcl_Size firstChar in
The index of the first character to draw from the given text layout.
The number 0 means to draw from the beginning.
-.AP int lastChar in
+.AP Tcl_Size lastChar in
The index of the last character up to which to draw. The character
specified by \fIlastChar\fR itself will not be drawn. A number less
than 0 means to draw all characters in the text layout.
@@ -111,7 +108,7 @@ than 0 means to draw all characters in the text layout.
Index of the single character to underline in the text layout, or a
negative number counting backwards from the end of the string. Any
out-of-range number (e.g. INT_MIN) means no underline.
-.AP int index in
+.AP Tcl_Size index in
The index of the character whose bounding box is desired. The bounding
box is computed with respect to the upper-left hand corner of the text layout.
.AP int "*xPtr, *yPtr" out
diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3
index 57ec9e6..4429bc9 100644
--- a/doc/TkInitStubs.3
+++ b/doc/TkInitStubs.3
@@ -15,6 +15,7 @@ Tk_InitStubs \- initialize the Tk stubs mechanism
.sp
const char *
\fBTk_InitStubs\fR(\fIinterp, version, exact\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp in
.AP Tcl_Interp *interp in
diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3
index fc29318..1f769c6 100644
--- a/doc/Tk_Init.3
+++ b/doc/Tk_Init.3
@@ -47,38 +47,48 @@ all Tk commands that are considered unsafe. Those commands and the
reasons for their exclusion are:
.TP
\fBbell\fR
+.
Continuous ringing of the bell is a nuisance.
.TP
\fBclipboard\fR
+.
A malicious script could replace the contents of the clipboard with
the string
.QW "\fBrm \-r *\fR"
and lead to surprises when the contents of the clipboard are pasted.
.TP
\fBgrab\fR
+.
Grab can be used to block the user from using any other applications.
.TP
\fBmenu\fR
+.
Menus can be used to cover the entire screen and to steal input from
the user.
.TP
\fBselection\fR
+.
See clipboard.
.TP
\fBsend\fR
+.
Send can be used to cause unsafe interpreters to execute commands.
.TP
\fBtk\fR
+.
The tk command recreates the send command, which is unsafe.
.TP
\fBtkwait\fR
+.
Tkwait can block the containing process forever
.TP
\fBtoplevel\fR
+.
Toplevels can be used to cover the entire screen and to steal input
from the user.
.TP
\fBwm\fR
+.
If toplevels are ever allowed, wm can be used to remove decorations,
move windows around, etc.
.SH KEYWORDS
diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3
index ea5f771..a1e12ce 100644
--- a/doc/Tk_Main.3
+++ b/doc/Tk_Main.3
@@ -17,7 +17,7 @@ Tk_Main \- main program for Tk-based applications
\fBTk_Main\fR(\fIargc, argv, appInitProc\fR)
.SH ARGUMENTS
.AS Tcl_AppInitProc *appInitProc
-.AP int argc in
+.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
Array of strings containing command-line arguments. On Windows, when
diff --git a/doc/WinUtil.3 b/doc/WinUtil.3
index 253ed19..7208200 100644
--- a/doc/WinUtil.3
+++ b/doc/WinUtil.3
@@ -15,14 +15,15 @@ Tk_GetOtherWindow, Tk_MakeContainer, Tk_MakeWindow, Tk_UseWindow \- window utili
\fB#include <tk.h>\fR
.sp
Tk_Window
-\fBTk_GetOtherWindow(\fItkwin\fB)\fR
+\fBTk_GetOtherWindow\fR(\fItkwin\fR)
.sp
-\fBTk_MakeContainer(\fItkwin\fB)\fR
+\fBTk_MakeContainer\fR(\fItkwin\fR)
.sp
-\fBTk_MakeWindow(\fItkwin, parent\fB)\fR
+\fBTk_MakeWindow\fR(\fItkwin, parent\fR)
.sp
int
-\fBTk_UseWindow(\fIinterp, tkwin, string\fB)\fR
+\fBTk_UseWindow\fR(\fIinterp, tkwin, string\fR)
+.fi
.SH ARGUMENTS
.AS XSetWindowAttributes borderWidth
.AP Tcl_Interp * interp in
diff --git a/doc/WindowId.3 b/doc/WindowId.3
index 477efe1..68597d8 100644
--- a/doc/WindowId.3
+++ b/doc/WindowId.3
@@ -103,6 +103,7 @@ Tcl_Interp *
.sp
Tcl_Obj *
\fBTk_NewWindowObj\fR(\fItkwin\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
@@ -147,7 +148,7 @@ information plus a few other fields. \fBTk_Attributes\fR
returns a pointer to an XSetWindowAttributes structure describing
all of the attributes of the \fItkwin\fR's window, such as background
pixmap, event mask, and so on (Tk keeps track of all this information
-as it is changed by the application). Note: it is essential that
+as it is changed by the application). Note that it is essential that
applications use Tk procedures like \fBTk_ResizeWindow\fR instead
of X procedures like \fBXResizeWindow\fR, so that Tk can keep its
data structures up-to-date.
diff --git a/doc/bind.n b/doc/bind.n
index 9fb5c07..a388152 100644
--- a/doc/bind.n
+++ b/doc/bind.n
@@ -149,8 +149,9 @@ substantial mouse motion in between. For example, \fB<Double\-Button\-1>\fR
is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space
requirement.
.PP
-The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are equivalents
-of \fBMod1\fR up to \fBMod4\fR, they correspond to Macintosh-specific modifier keys.
+The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are
+equivalents of \fBMod1\fR up to \fBMod4\fR; they correspond to
+Macintosh-specific modifier keys.
.PP
The \fBExtended\fR modifier is, at present, specific to Windows. It
appears on events that are associated with the keys on the
@@ -649,9 +650,9 @@ then that script terminates and no other scripts will be invoked
for the event.
.PP
Within a script called from the binding script, \fBreturn\fR
-\fB-code ok\fR may be used to continue processing (including
+\fB\-code ok\fR may be used to continue processing (including
.QW +
-appended scripts), or \fBreturn\fR \fB-code break\fR may be used to
+appended scripts), or \fBreturn\fR \fB\-code break\fR may be used to
stop processing all other binding scripts.
.PP
If more than one binding matches a particular event and they
@@ -739,7 +740,7 @@ The \fBbgerror\fR command will be executed at global level
Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked:
.CS
-\fBbind\fR . <Double\-1> {
+\fBbind\fR . <Double-1> {
puts "hi from (%x,%y)"
}
.CE
@@ -748,7 +749,7 @@ A little GUI that displays what the keysym name of the last key
pressed is:
.CS
set keysym "Press any key"
-pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
+pack [label .l -textvariable keysym -padx 2m -pady 1m]
\fBbind\fR . <Key> {
set keysym "You pressed %K"
}
diff --git a/doc/bitmap.n b/doc/bitmap.n
index 19716e1..3ef2254 100644
--- a/doc/bitmap.n
+++ b/doc/bitmap.n
@@ -15,7 +15,7 @@ bitmap \- Images that display two colors
.nf
\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR?
-\fIimageName \fBcget\fR \fIoption\fR
+\fIimageName \fBcget\fI option\fR
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.fi
.BE
@@ -39,6 +39,7 @@ data is zero.
Like all images, bitmaps are created using the \fBimage create\fR
command.
Bitmaps support the following \fIoptions\fR:
+.\" OPTION: -background
.TP
\fB\-background \fIcolor\fR
.
@@ -47,6 +48,7 @@ ways accepted by Tk. If this option is set to an empty string
then the background pixels will be transparent. This effect
is achieved by using the source bitmap as the mask bitmap, ignoring
any \fB\-maskdata\fR or \fB\-maskfile\fR options.
+.\" OPTION: -data
.TP
\fB\-data \fIstring\fR
.
@@ -55,6 +57,7 @@ The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
If both the \fB\-data\fR and \fB\-file\fR options are specified,
the \fB\-data\fR option takes precedence.
+.\" OPTION: -file
.TP
\fB\-file \fIname\fR
.
@@ -62,11 +65,13 @@ the \fB\-data\fR option takes precedence.
source bitmap.
The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
+.\" OPTION: -foreground
.TP
\fB\-foreground \fIcolor\fR
.
Specifies a foreground color for the image in any of the standard
ways accepted by Tk.
+.\" OPTION: -maskdata
.TP
\fB\-maskdata \fIstring\fR
.
@@ -75,6 +80,7 @@ The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified,
the \fB\-maskdata\fR option takes precedence.
+.\" OPTION: -maskfile
.TP
\fB\-maskfile \fIname\fR
.
@@ -95,13 +101,15 @@ It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for bitmap images:
+.\" METHOD: cget
.TP
-\fIimageName \fBcget\fR \fIoption\fR
+\fIimageName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the
\fBimage create\fR \fBbitmap\fR command.
+.\" METHOD: configure
.TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
diff --git a/doc/busy.n b/doc/busy.n
index 3274524..b1453bb 100644
--- a/doc/busy.n
+++ b/doc/busy.n
@@ -30,19 +30,15 @@
.SH NAME
busy \- Make Tk widgets busy, temporarily blocking user interactions
.SH SYNOPSIS
-\fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
-.sp
+.nf
+\fBtk busy\fI window \fR?\fIoptions\fR?
\fBtk busy busywindow \fIwindow\fR
-.sp
-\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR?
-.sp
+\fBtk busy hold\fI window \fR?\fIoptions\fR?
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
-.sp
-\fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?...
-.sp
+\fBtk busy forget\fI window \fR?\fIwindow \fR?...
\fBtk busy current\fR ?\fIpattern\fR?
-.sp
\fBtk busy status \fIwindow\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -116,7 +112,7 @@ The busy window has a configurable cursor. You can change the busy cursor
using the \fBconfigure\fR operation.
.PP
.CS
-\fBtk busy\fR configure .top \-cursor "watch"
+\fBtk busy\fR configure .top -cursor "watch"
.CE
.PP
Destroying the widget will also clean up any resources allocated by the \fBtk
@@ -129,20 +125,23 @@ The following operations are available for the \fBtk busy\fR command:
\fBtk busy \fIwindow\fR ?\fIoption value\fR?...
.
Shortcut for \fBtk busy hold\fR command.
+.\" METHOD: busywindow
.TP
\fBtk busy busywindow \fIwindow\fR
.
Returns the pathname of the busy window (i.e. the transparent window
shielding the window appearing busy) created by the \fBtk busy hold\fR
command for \fIwindow\fR, or the empty string if \fIwindow\fR is not busy.
+.\" METHOD: cget
.TP
-\fBtk busy cget \fIwindow\fR \fIoption\fR
+\fBtk busy cget \fIwindow option\fR
.
Queries the \fBtk busy\fR command configuration options for \fIwindow\fR.
\fIWindow\fR must be the path name of a widget previously made busy by the
\fBhold\fR operation. The command returns the present value of the specified
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
\fBhold\fR operation.
+.\" METHOD: configure
.TP
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
.
@@ -169,12 +168,14 @@ option add *frame.busyCursor gumby
option add *Frame.BusyCursor gumby
.CE
.RE
+.\" METHOD: current
.TP
\fBtk busy current \fR?\fIpattern\fR?
.
Returns the pathnames of all widgets that are currently busy. If a
\fIpattern\fR is given, only the path names of busy widgets matching
\fIpattern\fR are returned.
+.\" METHOD: forget
.TP
\fBtk busy forget \fIwindow\fR ?\fIwindow\fR?...
.
@@ -183,6 +184,7 @@ including the transparent window. User events will again be received by
\fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed.
\fIWindow\fR must be the name of a widget specified in the \fBhold\fR
operation, otherwise an error is reported.
+.\" METHOD: hold
.TP
\fBtk busy hold \fIwindow\fR ?\fIoption value\fR?...
.
@@ -197,6 +199,7 @@ command returns the pathname of the busy window that was created (i.e. the
transparent window shielding the window appearing busy). The following
configuration options are valid:
.RS
+.\" OPTION: -cursor
.TP
\fB\-cursor \fIcursorName\fR
.
@@ -204,6 +207,7 @@ Specifies the cursor to be displayed when the widget is made busy.
\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The
default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms.
.RE
+.\" METHOD: status
.TP
\fBtk busy status \fIwindow\fR
.
diff --git a/doc/button.n b/doc/button.n
index 70e0e65..9850670 100644
--- a/doc/button.n
+++ b/doc/button.n
@@ -12,7 +12,7 @@
.SH NAME
button \- Create and manipulate 'button' action widgets
.SH SYNOPSIS
-\fBbutton\fR \fIpathName \fR?\fIoptions\fR?
+\fBbutton\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-font \-relief
\-activeforeground \-foreground \-repeatdelay
@@ -114,14 +114,18 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for button widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBbutton\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -134,15 +138,19 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBbutton\fR
command.
+.\" METHOD: flash
.TP
\fIpathName \fBflash\fR
+.
Flash the button. This is accomplished by redisplaying the button
several times, alternating between the configured activebackground
and background colors. At the end of the flash the button is left
in the same normal/active state as when the command was invoked.
This command is ignored if the button's state is \fBdisabled\fR.
+.\" METHOD: invoke
.TP
\fIpathName \fBinvoke\fR
+.
Invoke the Tcl command associated with the button, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the button.
@@ -188,17 +196,17 @@ This is the classic Tk
demonstration:
.PP
.CS
-\fBbutton\fR .b \-text "Hello, World!" \-command exit
+\fBbutton\fR .b -text "Hello, World!" -command exit
pack .b
.CE
.PP
This example demonstrates how to handle button accelerators:
.PP
.CS
-\fBbutton\fR .b1 \-text Hello \-underline 0
-\fBbutton\fR .b2 \-text World \-underline 0
-bind . <Key\-h> {.b1 flash; .b1 invoke}
-bind . <Key\-w> {.b2 flash; .b2 invoke}
+\fBbutton\fR .b1 -text Hello -underline 0
+\fBbutton\fR .b2 -text World -underline 0
+bind . <Key-h> {.b1 flash; .b1 invoke}
+bind . <Key-w> {.b2 flash; .b2 invoke}
pack .b1 .b2
.CE
.SH "SEE ALSO"
diff --git a/doc/canvas.n b/doc/canvas.n
index bffa48e..2942358 100644
--- a/doc/canvas.n
+++ b/doc/canvas.n
@@ -13,7 +13,7 @@
.SH NAME
canvas \- Create and manipulate 'canvas' hypergraphics drawing surface widgets
.SH SYNOPSIS
-\fBcanvas\fR \fIpathName \fR?\fIoptions\fR?
+\fBcanvas\fI pathName \fR?\fIoptions\fR?
.SO
\-background \-borderwidth \-cursor
\-highlightbackground \-highlightcolor \-highlightthickness
@@ -256,9 +256,7 @@ tasks as inserting new text at the end of the item.
Lines and Polygons do not support the insertion cursor
and the selection. Their indices are supposed to be even
always, because coordinates always appear in pairs.
-.TP 10
-\fInumber\fR
-.
+.IP \fInumber\fR 10
A decimal number giving the position of the desired character
within the text item.
0 refers to the first character, 1 to the next character, and
@@ -271,30 +269,20 @@ polygons, negative numbers or numbers greater than the length
of the coordinate list will be adjusted by adding or subtracting
the length until the result is between zero and the length,
inclusive.
-.TP 10
-\fBend\fR
-.
+.IP \fBend\fR 10
Refers to the character or coordinate just after the last one
in the item (same as the number of characters or coordinates
in the item).
-.TP 10
-\fBinsert\fR
-.
+.IP \fBinsert\fR 10
Refers to the character just before which the insertion cursor
is drawn in this item. Not valid for lines and polygons.
-.TP 10
-\fBsel.first\fR
-.
+.IP \fBsel.first\fR 10
Refers to the first selected character in the item.
If the selection is not in this item then this form is illegal.
-.TP 10
-\fBsel.last\fR
-.
+.IP \fBsel.last\fR 10
Refers to the last selected character in the item.
If the selection is not in this item then this form is illegal.
-.TP 10
-\fB@\fIx,y\fR
-.
+.IP \fB@\fIx,y\fR 10
Refers to the character or coordinate at the point given by \fIx\fR and
\fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate
system of the canvas.
@@ -353,6 +341,7 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command.
The following widget commands are possible for canvas widgets:
+.\" METHOD: addtag
.TP
\fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg ...\fR?
.
@@ -367,27 +356,19 @@ This command returns an empty string as result.
\fISearchSpec\fR and \fIarg\fR's may take any of the following
forms:
.RS
-.TP
-\fBabove \fItagOrId\fR
-.
+.IP "\fBabove \fItagOrId\fR"
Selects the item just after (above) the one given by \fItagOrId\fR
in the display list.
If \fItagOrId\fR denotes more than one item, then the last (topmost)
of these items in the display list is used.
-.TP
-\fBall\fR
-.
+.IP \fBall\fR
Selects all the items in the canvas.
-.TP
-\fBbelow \fItagOrId\fR
-.
+.IP "\fBbelow \fItagOrId\fR"
Selects the item just before (below) the one given by \fItagOrId\fR
in the display list.
If \fItagOrId\fR denotes more than one item, then the first (lowest)
of these items in the display list is used.
-.TP
-\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?
-.
+.IP "\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?"
Selects the item closest to the point given by \fIx\fR and \fIy\fR.
If more than one item is at the same closest distance (e.g. two
items overlap the point), then the top-most of these items (the
@@ -405,26 +386,21 @@ Instead of selecting the topmost closest item, this form will
select the topmost closest item that is below \fIstart\fR in
the display list; if no such item exists, then the selection
behaves as if the \fIstart\fR argument had not been specified.
-.TP
-\fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
-.
+.IP "\fBenclosed\fI x1 y1 x2 y2\fR"
Selects all the items completely enclosed within the rectangular
region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
\fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be
no greater than \fIy2\fR.
-.TP
-\fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
-.
+.IP "\fBoverlapping\fI x1 y1 x2 y2\fR"
Selects all the items that overlap or are enclosed within the
rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR,
and \fIy2\fR.
\fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be
no greater than \fIy2\fR.
-.TP
-\fBwithtag \fItagOrId\fR
-.
+.IP "\fBwithtag \fItagOrId\fR"
Selects all the items given by \fItagOrId\fR.
.RE
+.\" METHOD: bbox
.TP
\fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR?
.
@@ -442,6 +418,7 @@ If no items match any of the \fItagOrId\fR arguments or if the
matching items have empty bounding boxes (i.e. they have nothing
to display)
then an empty string is returned.
+.\" METHOD: bind
.TP
\fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR?
.
@@ -503,6 +480,7 @@ the canvas's items using the \fBbind\fR widget command.
The bindings for items will be invoked before any of the bindings
for the window as a whole.
.RE
+.\" METHOD: canvasx
.TP
\fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR?
.
@@ -510,6 +488,7 @@ Given a window x-coordinate in the canvas \fIscreenx\fR, this command returns
the canvas x-coordinate that is displayed at that location.
If \fIgridspacing\fR is specified, then the canvas coordinate is
rounded to the nearest multiple of \fIgridspacing\fR units.
+.\" METHOD: canvasy
.TP
\fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR?
.
@@ -517,13 +496,15 @@ Given a window y-coordinate in the canvas \fIscreeny\fR this command returns
the canvas y-coordinate that is displayed at that location.
If \fIgridspacing\fR is specified, then the canvas coordinate is
rounded to the nearest multiple of \fIgridspacing\fR units.
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBcanvas\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
.
@@ -539,10 +520,11 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBcanvas\fR
command.
+.\" METHOD: coords
.TP
-\fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR?
+\fIpathName \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR?
.TP
-\fIpathName\fR \fBcoords \fItagOrId \fR?\fIcoordList\fR?
+\fIpathName \fBcoords \fItagOrId \fR?\fIcoordList\fR?
.
Query or modify the coordinates that define an item.
If no coordinates are specified, this command returns a list
@@ -561,6 +543,7 @@ returned in screen units with no units (that is, in pixels). So if the
original coordinates were specified for instance in centimeters or inches,
the returned values will nevertheless be in pixels.
.RE
+.\" METHOD: create
.TP
\fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR?
.TP
@@ -574,6 +557,7 @@ more item options.
See the subsections on individual item types below for more
on the syntax of this command.
This command returns the id for the new item.
+.\" METHOD: dchars
.TP
\fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR?
.
@@ -586,11 +570,13 @@ line and polygon items interpret them as indices to a coordinate (an x,y pair).
Indices are described in \fBINDICES\fR above.
If \fIlast\fR is omitted, it defaults to \fIfirst\fR.
This command returns an empty string.
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR?
.
Delete each of the items given by each \fItagOrId\fR, and return
an empty string.
+.\" METHOD: dtag
.TP
\fIpathName \fBdtag \fItagOrId \fR?\fItagToDelete\fR?
.
@@ -601,6 +587,7 @@ If an item does not have the tag \fItagToDelete\fR then
the item is unaffected by the command.
If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR.
This command returns an empty string.
+.\" METHOD: find
.TP
\fIpathName \fBfind \fIsearchCommand \fR?\fIarg ...\fR?
.
@@ -610,6 +597,7 @@ meet the constraints specified by \fIsearchCommand\fR and
\fISearchCommand\fR and \fIargs\fR have any of the forms
accepted by the \fBaddtag\fR command.
The items are returned in stacking order, with the lowest item first.
+.\" METHOD: focus
.TP
\fIpathName \fBfocus \fR?\fItagOrId\fR?
.
@@ -639,8 +627,9 @@ In most cases it is advisable to follow the \fBfocus\fR widget
command with the \fBfocus\fR command to set the focus window to
the canvas (if it was not there already).
.RE
+.\" METHOD: gettags
.TP
-\fIpathName \fBgettags\fR \fItagOrId\fR
+\fIpathName \fBgettags\fI tagOrId\fR
.
Return a list whose elements are the tags associated with the
item given by \fItagOrId\fR.
@@ -648,6 +637,7 @@ If \fItagOrId\fR refers to more than one item, then the tags
are returned from the first such item in the display list.
If \fItagOrId\fR does not refer to any items, or if the item
contains no tags, then an empty string is returned.
+.\" METHOD: icursor
.TP
\fIpathName \fBicursor \fItagOrId index\fR
.
@@ -657,25 +647,37 @@ If some or all of the items given by \fItagOrId\fR do not support
an insertion cursor then this command has no effect on them.
See \fBINDICES\fR above for a description of the
legal forms for \fIindex\fR.
-Note: the insertion cursor is only displayed in an item if
+.RS
+.PP
+Note that the insertion cursor is only displayed in an item if
that item currently has the keyboard focus (see the \fBfocus\fR widget
command, above), but the cursor position may
be set even when the item does not have the focus.
+.PP
This command returns an empty string.
+.RE
+.\" METHOD: image
.TP
\fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR?
.
-Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB-scrollregion\fR
-has been defined then this will be the boundaries of the canvas region drawn and the
-final size of the photo image. Otherwise the widget width and height with an origin
-of 0,0 will be the size of the canvas region drawn and the final size of the photo
-image. Optionally an integer \fIsubsample\fR factor may be given and the photo image
-will be reduced in size. In addition to the \fIsubsample\fR an integer \fIzoom\fR
-factor can also be given and the photo image will be enlarged. The image background
-will be filled with the canvas background colour. The canvas widget does not need to
-be mapped for this widget command to work, but at least one of it's ancestors must be
-mapped.
+Draw the canvas into the Tk photo image named \fIimagename\fR.
+If a \fB\-scrollregion\fR has been defined then this will be the boundaries
+of the canvas region drawn and the final size of the photo image. Otherwise
+the widget width and height with an origin of 0,0 will be the size of the
+canvas region drawn and the final size of the photo image. Optionally an
+integer \fIsubsample\fR factor may be given and the photo image
+will be reduced in size.
+.RS
+.PP
+In addition to the \fIsubsample\fR an integer \fIzoom\fR factor can also
+be given and the photo image will be enlarged. The image background will
+be filled with the canvas background colour. The canvas widget does not
+need to be mapped for this widget command to work, but at least one of
+it's ancestors must be mapped.
+.PP
This command returns an empty string.
+.RE
+.\" METHOD: imove
.TP
\fIpathName \fBimove \fItagOrId index x y\fR
.
@@ -684,6 +686,7 @@ indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR).
Each item interprets \fIindex\fR independently according to the rules
described in \fBINDICES\fR above. Out of the standard set of items, only line
and polygon items may have their coordinates relocated this way.
+.\" METHOD: index
.TP
\fIpathName \fBindex \fItagOrId index\fR
.
@@ -698,6 +701,7 @@ of characters, or coordinates, within the item, inclusive.
If \fItagOrId\fR refers to multiple items, then the index
is processed in the first of these items that supports indexing
operations (in display list order).
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fItagOrId beforeThis string\fR
.
@@ -708,11 +712,16 @@ Text items interpret \fIbeforeThis\fR as an index to a character,
line and polygon items interpret it as an index to a coordinate (an x,y pair).
For lines and polygons the \fIstring\fR must be a valid coordinate
sequence.
+.RS
+.PP
See \fBINDICES\fR above for information about the forms allowed
for \fIbeforeThis\fR.
+.PP
This command returns an empty string.
+.RE
+.\" METHOD: itemcget
.TP
-\fIpathName \fBitemcget\fR \fItagOrId\fR \fIoption\fR
+\fIpathName \fBitemcget\fI tagOrId option\fR
.
Returns the current value of the configuration option for the
item given by \fItagOrId\fR whose name is \fIoption\fR.
@@ -722,6 +731,7 @@ it applies to a particular item rather than the widget as a whole.
widget command when the item was created.
If \fItagOrId\fR is a tag that refers to more than one item,
the first (lowest) such item is used.
+.\" METHOD: itemconfigure
.TP
\fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
.
@@ -744,6 +754,7 @@ The \fIoption\fRs and \fIvalue\fRs are the same as those permissible
in the \fBcreate\fR widget command when the item(s) were created;
see the sections describing individual item types below for details
on the legal options.
+.\" METHOD: lower
.TP
\fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR?
.
@@ -754,11 +765,12 @@ but the relative order of the moved items will not be changed.
\fIBelowThis\fR is a tag or id; if it refers to more than one
item then the first (lowest) of these items in the display list is used
as the destination location for the moved items.
-Note: this command has no effect on window items. Window items always
+Note that this command has no effect on window items. Window items always
obscure other item types, and the stacking order of window items is
determined by the \fBraise\fR command and \fBlower\fR command, not the
\fBraise\fR widget command and \fBlower\fR widget command for canvases.
This command returns an empty string.
+.\" METHOD: move
.TP
\fIpathName \fBmove \fItagOrId xAmount yAmount\fR
.
@@ -767,6 +779,7 @@ space by adding \fIxAmount\fR to the x-coordinate of each point
associated with the item and \fIyAmount\fR to the y-coordinate of
each point associated with the item.
This command returns an empty string.
+.\" METHOD: moveto
.TP
\fIpathName \fBmoveto \fItagOrId xPos yPos\fR
.
@@ -779,6 +792,7 @@ the empty string, in which case the corresponding coordinate
will be unchanged. All items matching
\fItagOrId\fR remain in the same positions relative to each other.
This command returns an empty string.
+.\" METHOD: postscript
.TP
\fIpathName \fBpostscript \fR?\fIoption value option value ...\fR?
.
@@ -805,6 +819,7 @@ The \fIoption\fR\-\fIvalue\fR argument pairs provide additional
information to control the generation of Postscript. The following
options are supported:
.RS
+.\" OPTION: -channel
.TP
\fB\-channel \fIchannelName\fR
.
@@ -812,6 +827,7 @@ Specifies the name of the channel to which to write the Postscript.
If this option and the \fB\-file\fR option are
not specified then the Postscript is returned as the
result of the command.
+.\" OPTION: -colormap
.TP
\fB\-colormap \fIvarName\fR
.
@@ -825,9 +841,13 @@ to see if there is an element of \fIvarName\fR with the same
name as the color.
If so, Tk uses the value of the element as the Postscript command
to set the color.
+.RS
+.PP
If this option has not been specified, or if there is no entry
in \fIvarName\fR for a given color, then Tk uses the red, green,
and blue intensities from the X color.
+.RE
+.\" OPTION: -colormode
.TP
\fB\-colormode \fImode\fR
.
@@ -835,6 +855,7 @@ Specifies how to output color information. \fIMode\fR must be either
\fBcolor\fR (for full color output), \fBgray\fR (convert all colors
to their gray-scale equivalents) or \fBmono\fR (convert all colors
to black or white).
+.\" OPTION: -file
.TP
\fB\-file \fIfileName\fR
.
@@ -842,6 +863,7 @@ Specifies the name of the file in which to write the Postscript.
If this option and the \fB\-channel\fR option are
not specified then the Postscript is returned as the
result of the command.
+.\" OPTION: -fontmap
.TP
\fB\-fontmap \fIvarName\fR
.
@@ -858,23 +880,32 @@ Otherwise Tk attempts to guess what Postscript font to use.
Tk's guesses generally only work for well-known fonts such as
Times and Helvetica and Courier, and only if the X font name does not
omit any dashes up through the point size.
+.RS
+.PP
For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but
\fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to
parse the font name).
+.RE
+.\" OPTION: -height
.TP
\fB\-height \fIsize\fR
.
Specifies the height of the area of the canvas to print.
Defaults to the height of the canvas window.
+.\" OPTION: -pageanchor
.TP
\fB\-pageanchor \fIanchor\fR
.
Specifies which point of the printed area of the canvas should appear over
the positioning point on the page (which is given by the \fB\-pagex\fR
and \fB\-pagey\fR options).
+.RS
+.PP
For example, \fB\-pageanchor n\fR means that the top center of the
area of the canvas being printed (as it appears in the canvas window)
should be over the positioning point. Defaults to \fBcenter\fR.
+.RE
+.\" OPTION: -pageheight
.TP
\fB\-pageheight \fIsize\fR
.
@@ -887,6 +918,7 @@ Defaults to the height of the printed area on the screen.
If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
is not implemented).
+.\" OPTION: -pagewidth
.TP
\fB\-pagewidth \fIsize\fR
.
@@ -897,6 +929,7 @@ Defaults to the width of the printed area on the screen.
If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
is not implemented).
+.\" OPTION: -pagex
.TP
\fB\-pagex \fIposition\fR
.
@@ -905,6 +938,7 @@ the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options
to determine where the printed area appears on the Postscript page.
Defaults to the center of the page.
+.\" OPTION: -pagey
.TP
\fB\-pagey \fIposition\fR
.
@@ -913,6 +947,7 @@ the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options
to determine where the printed area appears on the Postscript page.
Defaults to the center of the page.
+.\" OPTION: -rotate
.TP
\fB\-rotate \fIboolean\fR
.
@@ -924,11 +959,13 @@ the short dimension of the page
in rotated output the x-axis runs along the long dimension of the page
.PQ landscape " orientation" .
Defaults to non-rotated.
+.\" OPTION: -width
.TP
\fB\-width \fIsize\fR
.
Specifies the width of the area of the canvas to print.
Defaults to the width of the canvas window.
+.\" OPTION: -x
.TP
\fB\-x \fIposition\fR
.
@@ -936,6 +973,7 @@ Specifies the x-coordinate of the left edge of the area of the
canvas that is to be printed, in canvas coordinates, not window
coordinates.
Defaults to the coordinate of the left edge of the window.
+.\" OPTION: -y
.TP
\fB\-y \fIposition\fR
.
@@ -944,6 +982,7 @@ canvas that is to be printed, in canvas coordinates, not window
coordinates.
Defaults to the coordinate of the top edge of the window.
.RE
+.\" METHOD: raise
.TP
\fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR?
.
@@ -957,11 +996,12 @@ as the destination location for the moved items.
This command returns an empty string.
.RS
.PP
-Note: this command has no effect on window items. Window items always
+Note this this command has no effect on window items. Window items always
obscure other item types, and the stacking order of window items is
determined by the \fBraise\fR command and \fBlower\fR command, not the
\fBraise\fR widget command and \fBlower\fR widget command for canvases.
.RE
+.\" METHOD: rchars
.TP
\fIpathName \fBrchars \fItagOrId first last string\fR
.
@@ -973,6 +1013,7 @@ set of items, text items support this operation by altering their text as
directed, and line and polygon items support this operation by altering their
coordinate list (in which case \fIstring\fR should be a list of coordinates to
use as a replacement). The other items ignore this operation.
+.\" METHOD: rotate
.TP
\fIpathName \fBrotate \fItagOrId xOrigin yOrigin angle\fR
.VS "8.7, TIP164"
@@ -994,6 +1035,7 @@ Some items (currently \fBarc\fR and\fB text\fR) have angles in their options;
this command \fIdoes not\fR affect those options.
.RE
.VE "8.7, TIP164"
+.\" METHOD: scale
.TP
\fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR
.
@@ -1015,8 +1057,9 @@ Note that some items have only a single pair of coordinates (e.g., text,
images and windows) and so scaling of them by this command can only move them
around.
.RE
+.\" METHOD: scan
.TP
-\fIpathName \fBscan\fR \fIoption args\fR
+\fIpathName \fBscan\fI option args\fR
.
This command is used to implement scanning on canvases. It has
two forms, depending on \fIoption\fR:
@@ -1042,6 +1085,7 @@ with mouse motion events in the widget, to produce the effect of
dragging the canvas at high speed through its window. The return
value is an empty string.
.RE
+.\" METHOD: select
.TP
\fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR?
.
@@ -1108,6 +1152,7 @@ If the selection anchor point for the widget is not currently in
by \fIindex\fR.
Returns an empty string.
.RE
+.\" METHOD: type
.TP
\fIpathName \fBtype\fI tagOrId\fR
.
@@ -1117,6 +1162,7 @@ If \fItagOrId\fR refers to more than one item, then the type
of the first item in the display list is returned.
If \fItagOrId\fR does not refer to any items at all then
an empty string is returned.
+.\" METHOD: xview
.TP
\fIpathName \fBxview \fR?\fIargs\fR?
.
@@ -1160,6 +1206,7 @@ If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units
of the \fBxScrollIncrement\fR option, if it is greater than zero,
or in units of one-tenth the window's width otherwise.
.RE
+.\" METHOD: yview
.TP
\fIpathName \fByview ?\fIargs\fR?
.
@@ -1220,6 +1267,7 @@ the coordinates of the item.
.PP
Many items share a common set of options. These options are
explained here, and then referred to be each widget type for brevity.
+.\" OPTION: -anchor
.TP
\fB\-anchor \fIanchorPos\fR
.
@@ -1230,18 +1278,22 @@ is \fBcenter\fR then the item is centered on the point; if
\fIanchorPos\fR is \fBn\fR then the item will be drawn so that
its top center point is at the positioning point.
This option defaults to \fBcenter\fR.
+.\" OPTION: -dash
.TP
\fB\-dash \fIpattern\fR
+.\" OPTION: -activedash
.TP
\fB\-activedash \fIpattern\fR
+.\" OPTION: -disableddash
.TP
\fB\-disableddash \fIpattern\fR
.
-This option specifies dash patterns for the normal, active
+These options specify dash patterns for the normal, active
state, and disabled state of an item.
\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
If the dash options are omitted then the default is a solid outline.
See \fBDASH PATTERNS\fR for more information.
+.\" OPTION: -dashoffset
.TP
\fB\-dashoffset \fIoffset\fR
.
@@ -1249,14 +1301,17 @@ The starting \fIoffset\fR in pixels into the pattern provided by the
\fB\-dash\fR option. \fB\-dashoffset\fR is ignored if there is no
\fB\-dash\fR pattern. The \fIoffset\fR may have any of the forms described
in the \fBCOORDINATES\fR section above.
+.\" OPTION: -fill
.TP
\fB\-fill \fIcolor\fR
+.\" OPTION: -activefill
.TP
\fB\-activefill \fIcolor\fR
+.\" OPTION: -disabledfill
.TP
\fB\-disabledfill \fIcolor\fR
.
-Specifies the color to be used to fill item's area.
+These options specify the color to be used to fill item's area.
in its normal, active, and disabled states.
The even-odd fill rule is used.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
@@ -1264,18 +1319,22 @@ For the line item, it specifies the color of the line drawn.
For the text item, it specifies the foreground color of the text.
If \fIcolor\fR is an empty string (the default for all canvas items
except line and text), then the item will not be filled.
+.\" OPTION: -outline
.TP
\fB\-outline \fIcolor\fR
+.\" OPTION: -activeoutline
.TP
\fB\-activeoutline \fIcolor\fR
+.\" OPTION: -disabledoutline
.TP
\fB\-disabledoutline \fIcolor\fR
.
-This option specifies the color that should be used to draw the
+These options specify the color that should be used to draw the
outline of the item in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
If \fIcolor\fR is specified as an empty string then no outline is drawn
for the item.
+.\" OPTION: -offset
.TP
\fB\-offset \fIoffset\fR
.
@@ -1290,14 +1349,17 @@ used for stippling as well. For the line and polygon canvas items you can
also specify an index as argument, which connects the stipple origin to one
of the coordinate points of the line/polygon. Note that stipple offsets are
\fIonly supported on X11\fR; they are silently ignored on other platforms.
+.\" OPTION: -outlinestipple
.TP
\fB\-outlinestipple \fIbitmap\fR
+.\" OPTION: -activeoutlinestipple
.TP
\fB\-activeoutlinestipple \fIbitmap\fR
+.\" OPTION: -disabledoutlinestipple
.TP
\fB\-disabledoutlinestipple \fIbitmap\fR
.
-This option specifies stipple patterns that should be used to draw the
+These options specify stipple patterns that should be used to draw the
outline of the item in its normal, active and disabled states.
Indicates that the outline for the item should be drawn with a stipple pattern;
\fIbitmap\fR specifies the stipple pattern to use, in any of the
@@ -1308,20 +1370,24 @@ If \fIbitmap\fR is an empty string (the default), then the outline is drawn
in a solid fashion.
\fINote that stipples are not well supported on platforms that do not
use X11 as their drawing API.\fR
+.\" OPTION: -outlineoffset
.TP
\fB\-outlineoffset \fIoffset\fR
.
Specifies the offset of the stipple pattern used for outlines, in the same way
that the \fB\-outline\fR option controls fill stipples. (See the
\fB\-outline\fR option for a description of the syntax of \fIoffset\fR.)
+.\" OPTION: -stipple
.TP
\fB\-stipple \fIbitmap\fR
+.\" OPTION: -activestipple
.TP
\fB\-activestipple \fIbitmap\fR
+.\" OPTION: -disabledstipple
.TP
\fB\-disabledstipple \fIbitmap\fR
.
-This option specifies stipple patterns that should be used to fill
+These options specify stipple patterns that should be used to fill
the item in its normal, active and disabled states.
\fIbitmap\fR specifies the stipple pattern to use, in any of the
forms accepted by \fBTk_GetBitmap\fR.
@@ -1332,26 +1398,31 @@ in a solid fashion.
For the text item, it affects the actual text.
\fINote that stipples are not well supported on platforms that do not
use X11 as their drawing API.\fR
+.\" OPTION: -state
.TP
\fB\-state \fIstate\fR
.
This allows an item to override the canvas widget's global \fIstate\fR
option. It takes the same values:
\fInormal\fR, \fIdisabled\fR or \fIhidden\fR.
+.\" OPTION: -tags
.TP
\fB\-tags \fItagList\fR
.
Specifies a set of tags to apply to the item.
\fITagList\fR consists of a list of tag names, which replace any
existing tags for the item. \fITagList\fR may be an empty list.
+.\" OPTION: -width
.TP
\fB\-width \fIoutlineWidth\fR
+.\" OPTION: -activewidth
.TP
\fB\-activewidth \fIoutlineWidth\fR
+.\" OPTION: -disabledwidth
.TP
\fB\-disabledwidth \fIoutlineWidth\fR
.
-Specifies the width of the outline to be drawn around
+These options specify the width of the outline to be drawn around
the item's region, in its normal, active and disabled states.
\fIoutlineWidth\fR may be in any of the forms described in the
\fBCOORDINATES\fR section above.
@@ -1364,8 +1435,9 @@ arc's region.
.PP
Items of type \fBarc\fR appear on the display as arc-shaped regions.
An arc is a section of an oval delimited by two angles (specified
-by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR option)
-and displayed in one of several ways (specified by the \fB\-style\fR option).
+by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR
+option) and displayed in one of several ways (specified by the \fB\-style\fR
+option).
Arcs are created with widget commands of the following form:
.CS
\fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR?
@@ -1401,26 +1473,32 @@ The following standard options are supported by arcs:
\fB\-disabledwidth\fR
.DE
The following extra options are supported for arcs:
+.\" OPTION: -extent
.TP
\fB\-extent \fIdegrees\fR
+.
Specifies the size of the angular range occupied by the arc.
The arc's range extends for \fIdegrees\fR degrees counter-clockwise
from the starting angle given by the \fB\-start\fR option.
\fIDegrees\fR may be negative.
If it is greater than 360 or less than \-360, then \fIdegrees\fR
modulo 360 is used as the extent.
+.\" OPTION: -start
.TP
\fB\-start \fIdegrees\fR
+.
Specifies the beginning of the angular range occupied by the
arc.
\fIDegrees\fR is given in units of degrees measured counter-clockwise
from the 3-o'clock position; it may be either positive or negative.
+.\" OPTION: -height
.TP
\fB\-height \fIdistance\fR
+.
Provides a shortcut for creating a circular arc segment by defining the
distance of the mid-point of the arc from its chord. When this option
is used the coordinates are interpreted as the start and end coordinates
-of the chord, and the options \fB\-start\fR and \fB-extent\fR are ignored.
+of the chord, and the options \fB\-start\fR and \fB\-extent\fR are ignored.
The value of \fIdistance\fR has the following meaning:
.RS
.PP
@@ -1443,8 +1521,10 @@ choosing the minus sign for the minor arc and the plus sign for the major arc.
Note that \fBitemcget \-height\fR always returns 0 so that introspection code
can be kept simple.
.RE
+.\" OPTION: -style
.TP
\fB\-style \fItype\fR
+.
Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR
(the default) then the arc's region is defined by a section
of the oval's perimeter plus two line segments, one between the center
@@ -1482,12 +1562,16 @@ The following standard options are supported by bitmaps:
\fB\-tags\fR
.DE
The following extra options are supported for bitmaps:
+.\" OPTION: -background
.TP
\fB\-background \fIcolor\fR
+.\" OPTION: -activebackground
.TP
\fB\-activebackground \fIcolor\fR
+.\" OPTION: -disabledbackground
.TP
\fB\-disabledbackground \fIcolor\fR
+.
Specifies the color to use for each of the bitmap's
.QW 0
valued pixels in its normal, active and disabled states.
@@ -1495,22 +1579,30 @@ valued pixels in its normal, active and disabled states.
If this option is not specified, or if it is specified as an empty
string, then nothing is displayed where the bitmap pixels are 0; this
produces a transparent effect.
+.\" OPTION: -bitmap
.TP
\fB\-bitmap \fIbitmap\fR
+.\" OPTION: -activebitmap
.TP
\fB\-activebitmap \fIbitmap\fR
+.\" OPTION: -disabledbitmap
.TP
\fB\-disabledbitmap \fIbitmap\fR
-Specifies the bitmaps to display in the item in its normal, active and
-disabled states.
+.
+These options specify the bitmaps to display in the item in its normal,
+active and disabled states.
\fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR.
+.\" OPTION: -foreground
.TP
\fB\-foreground \fIcolor\fR
+.\" OPTION: -activeforeground
.TP
\fB\-activeforeground \fIcolor\fR
+.\" OPTION: -disabledforeground
.TP
\fB\-disabledforeground \fIcolor\fR
-Specifies the color to use for each of the bitmap's
+.
+These options specify the color to use for each of the bitmap's
.QW 1
valued pixels in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
@@ -1540,12 +1632,16 @@ The following standard options are supported by images:
\fB\-tags\fR
.DE
The following extra options are supported for images:
+.\" OPTION: -image
.TP
\fB\-image \fIname\fR
+.\" OPTION: -activeimage
.TP
\fB\-activeimage \fIname\fR
+.\" OPTION: -disabledimage
.TP
\fB\-disabledimage \fIname\fR
+.
Specifies the name of the images to display in the item in is normal,
active and disabled states.
This image must have been created previously with the
@@ -1585,8 +1681,10 @@ The following standard options are supported by lines:
\fB\-disabledwidth\fR
.DE
The following extra options are supported for lines:
+.\" OPTION: -arrow
.TP
\fB\-arrow \fIwhere\fR
+.
Indicates whether or not arrowheads are to be drawn at one or both
ends of the line.
\fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads),
@@ -1600,8 +1698,10 @@ rather than at its tip so that the line doesn't extend past the edge of the
arrowhead. This may trigger a \fBLeave\fR event if the mouse is hovering this
line end. Conversely, when removing an arrowhead Tk adjusts the corresponding
line point the other way round, which may trigger an \fBEnter\fR event.
+.\" OPTION: -arrowshape
.TP
\fB\-arrowshape \fIshape\fR
+.
This option indicates how to draw arrowheads.
The \fIshape\fR argument must be a list with three elements, each
specifying a distance in any of the forms described in
@@ -1615,16 +1715,20 @@ trailing points.
If this option is not specified then Tk picks a
.QW reasonable
shape.
+.\" OPTION: -capstyle
.TP
\fB\-capstyle \fIstyle\fR
+.
Specifies the ways in which caps are to be drawn at the endpoints
of the line.
\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
(\fBbutt\fR, \fBprojecting\fR, or \fBround\fR).
If this option is not specified then it defaults to \fBbutt\fR.
Where arrowheads are drawn the cap style is ignored.
+.\" OPTION: -joinstyle
.TP
\fB\-joinstyle \fIstyle\fR
+.
Specifies the ways in which joints are to be drawn at the vertices
of the line.
\fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR
@@ -1632,12 +1736,15 @@ of the line.
If this option is not specified then it defaults to \fBround\fR.
If the line only contains two points then this option is
irrelevant.
+.\" OPTION: -smooth
.TP
\fB\-smooth \fIsmoothMethod\fR
+.
\fIsmoothMethod\fR must have one of the forms accepted by
\fBTcl_GetBoolean\fR or a line smoothing method.
Only \fBtrue\fR and \fBraw\fR are
-supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean
+supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR),
+but more can be added at runtime. If a boolean
false value or empty string is given, no smoothing is applied. A boolean
truth value assumes \fBtrue\fR smoothing.
If the smoothing method is \fBtrue\fR, this indicates that the line
@@ -1654,8 +1761,10 @@ line segments can be generated within a curve by making control points
equal to their neighbouring knot points. If the last point is a
control point and not a knot point, the point is repeated (one or two
times) so that it also becomes a knot point.
+.\" OPTION: -splinesteps
.TP
\fB\-splinesteps \fInumber\fR
+.
Specifies the degree of smoothness desired for curves: each spline
will be approximated with \fInumber\fR line segments. This
option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR.
@@ -1712,8 +1821,8 @@ Polygons are created with widget commands of the following form:
\fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR?
\fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR?
.CE
-The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for
-three or more points that define a polygon.
+The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the
+coordinates for three or more points that define a polygon.
The first point should not be repeated as the last to
close the shape; Tk will automatically close the periphery between
the first and last points.
@@ -1742,18 +1851,23 @@ The following standard options are supported by polygons:
\fB\-disabledwidth\fR
.DE
The following extra options are supported for polygons:
+.\" OPTION: -joinstyle
.TP
\fB\-joinstyle \fIstyle\fR
+.
Specifies the ways in which joints are to be drawn at the vertices
of the outline.
\fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR
(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
If this option is not specified then it defaults to \fBround\fR.
+.\" OPTION: -smooth
.TP
\fB\-smooth \fIboolean\fR
+.
\fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR
or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are
-supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean
+supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR),
+but more can be added at runtime. If a boolean
false value or empty string is given, no smoothing is applied. A boolean
truth value assumes \fBtrue\fR smoothing.
If the smoothing method is \fBtrue\fR, this indicates that the polygon
@@ -1771,8 +1885,10 @@ equal to their neighbouring knot points. If the last point is not the
second point of a pair of control points, the point is repeated (one or two
times) so that it also becomes the second point of a pair of control
points (the associated knot point will be the first control point).
+.\" OPTION: -splinesteps
.TP
\fB\-splinesteps \fInumber\fR
+.
Specifies the degree of smoothness desired for curves: each spline
will be approximated with \fInumber\fR line segments. This
option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR.
@@ -1863,6 +1979,7 @@ The following standard options are supported by text items:
\fB\-tags\fR
.DE
The following extra options are supported for text items:
+.\" OPTION: -angle
.TP
\fB\-angle \fIrotationDegrees\fR
.
@@ -1871,36 +1988,46 @@ about the positioning point for the text; it may have any floating-point value
from 0.0 to 360.0. For example, if \fIrotationDegrees\fR is \fB90\fR, then the
text will be drawn vertically from bottom to top.
This option defaults to \fB0.0\fR.
+.\" OPTION: -font
.TP
\fB\-font \fIfontName\fR
+.
Specifies the font to use for the text item.
\fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR.
If this option is not specified, it defaults to a system-dependent
font.
+.\" OPTION: -justify
.TP
\fB\-justify \fIhow\fR
+.
Specifies how to justify the text within its bounding region.
\fIHow\fR must be one of the values \fBleft\fR, \fBright\fR,
or \fBcenter\fR.
This option will only matter if the text is displayed as multiple
lines.
If the option is omitted, it defaults to \fBleft\fR.
+.\" OPTION: -text
.TP
\fB\-text \fIstring\fR
+.
\fIString\fR specifies the characters to be displayed in the text item.
Newline characters cause line breaks.
The characters in the item may also be changed with the
\fBinsert\fR and \fBdelete\fR widget commands.
This option defaults to an empty string.
+.\" OPTION: -underline
.TP
-\fB\-underline \fI\fR
+\fB\-underline \fInumber\fR
+.
Specifies the integer index of a character within the text to be
underlined. 0 corresponds to the first character of the text
displayed, 1 to the next character, and so on. \-1 means that no
underline should be drawn (if the whole text item is to be underlined,
the appropriate font should be used instead).
+.\" OPTION: -width
.TP
\fB\-width \fIlineLength\fR
+.
Specifies a maximum line length for the text, in any of the forms
described in the \fBCOORDINATES\fR section above.
If this option is zero (the default) the text is broken into
@@ -1939,6 +2066,7 @@ The following standard options are supported by window items:
\fB\-tags\fR
.DE
The following extra options are supported for window items:
+.\" OPTION: -height
.TP
\fB\-height \fIpixels\fR
.
@@ -1947,6 +2075,7 @@ Specifies the height to assign to the item's window.
forms described in the \fBCOORDINATES\fR section above.
If this option is not specified, or if it is specified as zero,
then the window is given whatever height it requests internally.
+.\" OPTION: -width
.TP
\fB\-width \fIpixels\fR
.
@@ -1955,6 +2084,7 @@ Specifies the width to assign to the item's window.
forms described in the \fBCOORDINATES\fR section above.
If this option is not specified, or if it is specified as zero,
then the window is given whatever width it requests internally.
+.\" OPTION: -window
.TP
\fB\-window \fIpathName\fR
.
@@ -1963,7 +2093,7 @@ The window specified by \fIpathName\fR must either be a child of
the canvas widget or a child of some ancestor of the canvas widget.
\fIPathName\fR may not refer to a top-level window.
.PP
-Note: due to restrictions in the ways that windows are managed, it is not
+Note that, due to restrictions in the ways that windows are managed, it is not
possible to draw other graphical items (such as lines and images) on top
of window items. A window item always obscures any graphics that
overlap it, regardless of their order in the display list. Also note that
diff --git a/doc/checkbutton.n b/doc/checkbutton.n
index 411045f..ccfe691 100644
--- a/doc/checkbutton.n
+++ b/doc/checkbutton.n
@@ -197,14 +197,18 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for checkbutton widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -217,33 +221,43 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR
command.
+.\" METHOD: deselect
.TP
\fIpathName \fBdeselect\fR
+.
Deselects the checkbutton and sets the associated variable to its
.QW off
value.
+.\" METHOD: flash
.TP
\fIpathName \fBflash\fR
+.
Flashes the checkbutton. This is accomplished by redisplaying the checkbutton
several times, alternating between active and normal colors. At
the end of the flash the checkbutton is left in the same normal/active
state as when the command was invoked.
This command is ignored if the checkbutton's state is \fBdisabled\fR.
+.\" METHOD: invoke
.TP
\fIpathName \fBinvoke\fR
+.
Does just what would have happened if the user invoked the checkbutton
with the mouse: toggle the selection state of the button and invoke
the Tcl command associated with the checkbutton, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the checkbutton.
This command is ignored if the checkbutton's state is \fBdisabled\fR.
+.\" METHOD: select
.TP
\fIpathName \fBselect\fR
+.
Selects the checkbutton and sets the associated variable to its
.QW on
value.
+.\" METHOD: toggle
.TP
\fIpathName \fBtoggle\fR
+.
Toggles the selection state of the button, redisplaying it and
modifying its associated variable to reflect the new state.
.SH BINDINGS
@@ -277,11 +291,11 @@ individual widgets or by redefining the class bindings.
This example shows a group of uncoupled checkbuttons.
.PP
.CS
-labelframe .lbl \-text "Steps:"
-\fBcheckbutton\fR .c1 \-text Lights \-variable lights
-\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras
-\fBcheckbutton\fR .c3 \-text Action! \-variable action
-pack .c1 .c2 .c3 \-in .lbl
+labelframe .lbl -text "Steps:"
+\fBcheckbutton\fR .c1 -text Lights -variable lights
+\fBcheckbutton\fR .c2 -text Cameras -variable cameras
+\fBcheckbutton\fR .c3 -text Action! -variable action
+pack .c1 .c2 .c3 -in .lbl
pack .lbl
.CE
.SH "SEE ALSO"
diff --git a/doc/chooseColor.n b/doc/chooseColor.n
index 3fa6de3..b485b77 100644
--- a/doc/chooseColor.n
+++ b/doc/chooseColor.n
@@ -18,17 +18,23 @@ tk_chooseColor \- pops up a dialog box for the user to select a color.
The procedure \fBtk_chooseColor\fR pops up a dialog box for the
user to select a color. The following \fIoption\-value\fR pairs are
possible as command line arguments:
+.\" OPTION: -initialcolor
.TP
-\fB\-initialcolor\fR \fIcolor\fR
+\fB\-initialcolor\fI color\fR
+.
Specifies the color to display in the color dialog when it pops
up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR
function.
+.\" OPTION: -parent
.TP
-\fB\-parent\fR \fIwindow\fR
+\fB\-parent\fI window\fR
+.
Makes \fIwindow\fR the logical parent of the color dialog. The color
dialog is displayed on top of its parent window.
+.\" OPTION: -title
.TP
-\fB\-title\fR \fItitleString\fR
+\fB\-title\fI titleString\fR
+.
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed.
.LP
@@ -39,7 +45,7 @@ string.
.SH EXAMPLE
.PP
.CS
-button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"]
+button .b -bg [tk_chooseColor -initialcolor gray -title "Choose color"]
.CE
.SH KEYWORDS
color, color selection, dialog
diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n
index a5b30f5..44e9530 100644
--- a/doc/chooseDirectory.n
+++ b/doc/chooseDirectory.n
@@ -16,15 +16,19 @@ tk_chooseDirectory \- pops up a dialog box for the user to select a directory.
The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the
user to select a directory. The following \fIoption\-value\fR pairs are
possible as command line arguments:
+.\" OPTION: -command
.TP
-\fB\-command\fR \fIstring\fR
+\fB\-command\fI string\fR
+.
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
+.\" OPTION: -initialdir
.TP
-\fB\-initialdir\fR \fIdirname\fR
+\fB\-initialdir\fI dirname\fR
+.
Specifies that the directories in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified,
the initial directory defaults to the current working directory
@@ -33,33 +37,41 @@ On Vista and later systems, the initial directory defaults to the last
user-selected directory for the application. If the
parameter specifies a relative path, the return value will convert the
relative path to an absolute path.
+.\" OPTION: -message
.TP
-\fB\-message\fR \fIstring\fR
+\fB\-message\fI string\fR
+.
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
+.\" OPTION: -mustexist
.TP
-\fB\-mustexist\fR \fIboolean\fR
+\fB\-mustexist\fI boolean\fR
+.
Specifies whether the user may specify non-existent directories. If
this parameter is true, then the user may only select directories that
already exist. The default value is \fIfalse\fR.
+.\" OPTION: -parent
.TP
-\fB\-parent\fR \fIwindow\fR
+\fB\-parent\fI window\fR
+.
Makes \fIwindow\fR the logical parent of the dialog. The dialog
is displayed on top of its parent window. On Mac OS X, this
turns the file dialog into a sheet attached to the parent window.
+.\" OPTION: -title
.TP
-\fB\-title\fR \fItitleString\fR
+\fB\-title\fI titleString\fR
+.
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed.
.SH EXAMPLE
.PP
.CS
set dir [\fBtk_chooseDirectory\fR \e
- \-initialdir ~ \-title "Choose a directory"]
+ -initialdir ~ -title "Choose a directory"]
if {$dir eq ""} {
- label .l \-text "No directory selected"
+ label .l -text "No directory selected"
} else {
- label .l \-text "Selected $dir"
+ label .l -text "Selected $dir"
}
.CE
.SH "SEE ALSO"
diff --git a/doc/clipboard.n b/doc/clipboard.n
index ee964df..587ab34 100644
--- a/doc/clipboard.n
+++ b/doc/clipboard.n
@@ -27,8 +27,9 @@ appends should be completed before returning to the event loop.
The first argument to \fBclipboard\fR determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
+.\" METHOD: append
.TP
-\fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR
+\fBclipboard append\fR ?\fB\-displayof\fI window\fR? ?\fB\-format\fI format\fR? ?\fB\-type\fI type\fR? ?\fB\-\|\-\fR? \fIdata\fR
.
Appends \fIdata\fR to the clipboard on \fIwindow\fR's
display in the form given by \fItype\fR with the representation given
@@ -71,15 +72,17 @@ next argument will always be used as \fIdata\fR.
This feature may be convenient if, for example, \fIdata\fR starts
with a \fB\-\fR.
.RE
+.\" METHOD: clear
.TP
-\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR?
+\fBclipboard clear\fR ?\fB\-displayof\fI window\fR?
.
Claims ownership of the clipboard on \fIwindow\fR's display and removes
any previous contents. \fIWindow\fR defaults to
.QW . .
Returns an empty string.
+.\" METHOD: get
.TP
-\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR?
+\fBclipboard get\fR ?\fB\-displayof\fI window\fR? ?\fB\-type\fI type\fR?
.
Retrieve data from the clipboard on \fIwindow\fR's display.
\fIWindow\fR defaults to
@@ -122,7 +125,7 @@ proc getItemConfig {canvas tag} {
append script {$canvas create } [$canvas type $item]
append script { } [$canvas coords $item] { }
foreach config [$canvas itemconf $item] {
- lassign $config name \- \- \- value
+ lassign $config name - - - value
append script [list $name $value] { }
}
append script \en
@@ -133,10 +136,10 @@ proc getItemConfig {canvas tag} {
# Set up a binding on a canvas to cut and paste an item
set c [canvas .c]
pack $c
-$c create text 150 30 \-text "cut and paste me"
+$c create text 150 30 -text "cut and paste me"
bind $c <<Cut>> {
\fBclipboard clear\fR
- \fBclipboard append \-type\fR TkCanvasItem \e
+ \fBclipboard append -type\fR TkCanvasItem \e
[getItemConfig %W current]
# Delete because this is cut, not copy.
%W delete current
@@ -144,7 +147,7 @@ bind $c <<Cut>> {
bind $c <<Paste>> {
catch {
set canvas %W
- eval [\fBclipboard get \-type\fR TkCanvasItem]
+ eval [\fBclipboard get -type\fR TkCanvasItem]
}
}
.CE
diff --git a/doc/colors.n b/doc/colors.n
index 9c64b1d..09c2289 100644
--- a/doc/colors.n
+++ b/doc/colors.n
@@ -896,7 +896,7 @@ systemTextColor
.
The numbered systemWindowBackgroundColors below
are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets
-to provide a contrasting background. Each numbered color constrasts
+to provide a contrasting background. Each numbered color contrasts
with its predecessor.
.RS
.DS
@@ -911,7 +911,6 @@ systemWindowBackgroundColor7
.DE
.RE
.TP
-
\fBWindows\fR
.
On Windows, the following additional system colors are available
diff --git a/doc/console.n b/doc/console.n
index 0a9a794..9ca7475 100644
--- a/doc/console.n
+++ b/doc/console.n
@@ -11,7 +11,7 @@
.SH NAME
console \- Control the console on systems without a real console
.SH SYNOPSIS
-\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR?
+\fBconsole\fI subcommand\fR ?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -23,30 +23,39 @@ the \fBconsole\fR command. The behaviour of the console window is
defined mainly through the contents of the \fIconsole.tcl\fR file in
the Tk library. Except for TkAqua, this command is not available when
Tk is loaded into a tclsh interpreter with
-.QW "\fBpackage require tk\fR" ,
+.QW "\fBpackage require Tk\fR" ,
as a conventional terminal is expected to be present in that case.
In TkAqua, this command is disabled when there is a startup script
and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application
embedding Tk is started by the macOS Launcher). To enable the command
in that case, define the environment variable \fBTK_CONSOLE\fR. This can be
done by modifying the Info.plist file by adding the LSEnvironment key
-to the main dict and setting its value to be a dict with the key \fBTK_CONSOLE\fR.
+to the main dict and setting its value to be a dict with the key
+\fBTK_CONSOLE\fR.
.PP
+.\" METHOD: eval
.TP
\fBconsole eval \fIscript\fR
+.
Evaluate the \fIscript\fR argument as a Tcl script in the console
interpreter. The normal interpreter is accessed through the
\fBconsoleinterp\fR command in the console interpreter.
+.\" METHOD: hide
.TP
\fBconsole hide\fR
+.
Hide the console window from view. Precisely equivalent to
withdrawing the \fB.\fR window in the console interpreter.
+.\" METHOD: show
.TP
\fBconsole show\fR
+.
Display the console window. Precisely equivalent to deiconifying the
\fB.\fR window in the console interpreter.
+.\" METHOD: title
.TP
\fBconsole title \fR?\fIstring\fR?
+.
Query or modify the title of the console window. If \fIstring\fR is
not specified, queries the title of the console window, and sets the
title of the console window to \fIstring\fR otherwise. Precisely
@@ -58,12 +67,16 @@ The \fBconsoleinterp\fR command in the console interpreter allows
scripts to be evaluated in the main interpreter. It supports two
subcommands: \fBeval\fR and \fBrecord\fR.
.PP
+.\" METHOD: eval
.TP
\fBconsoleinterp eval \fIscript\fR
+.
Evaluates \fIscript\fR as a Tcl script at the global level in the main
interpreter.
+.\" METHOD: record
.TP
\fBconsoleinterp record \fIscript\fR
+.
Records and evaluates \fIscript\fR as a Tcl script at the global level
in the main interpreter as if \fIscript\fR had been typed in at the
console.
diff --git a/doc/cursors.n b/doc/cursors.n
index bf8a05e..7a757f5 100644
--- a/doc/cursors.n
+++ b/doc/cursors.n
@@ -101,6 +101,7 @@ The \fBnone\fR cursor can be specified to eliminate the cursor.
.SH "PORTABILITY ISSUES"
.TP
\fBWindows\fR
+.
On Windows systems, the following cursors are mapped to native cursors:
.RS
.CS
@@ -131,6 +132,7 @@ wait
.RE
.TP
\fBMac OS X\fR
+.
On Mac OS X systems, the following cursors are mapped to native cursors:
.RS
.CS
diff --git a/doc/dialog.n b/doc/dialog.n
index 4245810..ac0a73b 100644
--- a/doc/dialog.n
+++ b/doc/dialog.n
@@ -19,31 +19,25 @@ tk_dialog \- Create modal dialog and wait for response
This procedure is part of the Tk script library.
It is largely \fIdeprecated\fR by the \fBtk_messageBox\fR.
Its arguments describe a dialog box:
-.TP
-\fIwindow\fR
+.IP \fIwindow\fR
Name of top-level window to use for dialog. Any existing window
by this name is destroyed.
-.TP
-\fItitle\fR
+.IP \fItitle\fR
Text to appear in the window manager's title bar for the dialog.
-.TP
-\fItext\fR
+.IP \fItext\fR
Message to appear in the top portion of the dialog box.
-.TP
-\fIbitmap\fR
+.IP \fIbitmap\fR
If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap)
to display in the top portion of
the dialog, to the left of the text.
If this is an empty string then no bitmap is displayed in the dialog.
-.TP
-\fIdefault\fR
+.IP \fIdefault\fR
If this is an integer greater than or equal to zero, then it gives
the index of the button that is to be the default button for the dialog
(0 for the leftmost button, and so on).
If negative or an empty string then there will not be any default
button.
-.TP
-\fIstring\fR
+.IP \fIstring\fR
There will be one button for each of these arguments.
Each \fIstring\fR specifies text to display in a button,
in order from left to right.
diff --git a/doc/entry.n b/doc/entry.n
index 850932c..368ca42 100644
--- a/doc/entry.n
+++ b/doc/entry.n
@@ -13,7 +13,7 @@
.SH NAME
entry \- Create and manipulate 'entry' one-line text entry widgets
.SH SYNOPSIS
-\fBentry\fR \fIpathName \fR?\fIoptions\fR?
+\fBentry\fI pathName \fR?\fIoptions\fR?
.SO
\-background \-highlightthickness \-selectbackground
\-borderwidth \-insertbackground \-selectborderwidth
@@ -176,9 +176,9 @@ entry widget from within either the \fB\-validatecommand\fR or the
\fB\-invalidcommand\fR. Such editions will override the one that was being
validated. If you wish to edit the entry widget (for example set it to {})
during validation and still have the \fB\-validate\fR option set, you should
-include the command
+include the command:
.CS
-after idle {%W config \-validate %v}
+after idle {%W config -validate %v}
.CE
in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you
were editing the entry widget from). It is also recommended to not set an
@@ -201,32 +201,39 @@ arguments. An index specifies a particular character in the entry's
string, in any of the following ways:
.TP 12
\fInumber\fR
+.
Specifies the character as a numerical index, where 0 corresponds
to the first character in the string.
.TP 12
\fBanchor\fR
+.
Indicates the anchor point for the selection, which is set with the
\fBselect from\fR and \fBselect adjust\fR widget commands.
.TP 12
\fBend\fR
+.
Indicates the character just after the last one in the entry's string.
This is equivalent to specifying a numerical index equal to the length
of the entry's string.
.TP 12
\fBinsert\fR
+.
Indicates the character adjacent to and immediately following the
insertion cursor.
.TP 12
\fBsel.first\fR
+.
Indicates the first character in the selection. It is an error to
use this form if the selection is not in the entry window.
.TP 12
\fBsel.last\fR
+.
Indicates the character just after the last one in the selection.
It is an error to use this form if the selection is not in the
entry window.
.TP 12
\fB@\fInumber\fR
+.
In this form, \fInumber\fR is treated as an x-coordinate in the
entry's window; the character spanning that x-coordinate is used.
For example,
@@ -245,8 +252,10 @@ arithmetic and indexing relative to \fBend\fR.
.SS SUBCOMMANDS
.PP
The following commands are possible for entry widgets:
+.\" METHOD: bbox
.TP
\fIpathName \fBbbox \fIindex\fR
+.
Returns a list of four numbers describing the bounding box of the
character given by \fIindex\fR.
The first two elements of the list give the x and y coordinates of
@@ -255,14 +264,18 @@ the upper-left corner of the screen area covered by the character
the width and height of the character, in pixels.
The bounding box may refer to a region outside the visible area
of the window.
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBentry\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -275,8 +288,10 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBentry\fR
command.
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
+.
Delete one or more elements of the entry.
\fIFirst\fR is the index of the first character to delete, and
\fIlast\fR is the index of the character just after the last
@@ -284,33 +299,45 @@ one to delete.
If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This command returns an empty string.
+.\" METHOD: get
.TP
\fIpathName \fBget\fR
+.
Returns the entry's string.
+.\" METHOD: icursor
.TP
\fIpathName \fBicursor \fIindex\fR
+.
Arrange for the insertion cursor to be displayed just before the character
given by \fIindex\fR. Returns an empty string.
+.\" METHOD: index
.TP
\fIpathName \fBindex\fI index\fR
+.
Returns the numerical index corresponding to \fIindex\fR.
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fIindex string\fR
+.
Insert the characters of \fIstring\fR just before the character
indicated by \fIindex\fR. Returns an empty string.
+.\" METHOD: scan
.TP
-\fIpathName \fBscan\fR \fIoption args\fR
+\fIpathName \fBscan\fI option args\fR
+.
This command is used to implement scanning on entries. It has
two forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx\fR
+.
Records \fIx\fR and the current view in the entry window; used in
conjunction with later \fBscan dragto\fR commands. Typically this
command is associated with a mouse button press in the widget. It
returns an empty string.
.TP
\fIpathName \fBscan dragto \fIx\fR
+.
This command computes the difference between its \fIx\fR argument
and the \fIx\fR argument to the last \fBscan mark\fR command for
the widget. It then adjusts the view left or right by 10 times the
@@ -319,13 +346,16 @@ with mouse motion events in the widget, to produce the effect of
dragging the entry at high speed through the window. The return
value is an empty string.
.RE
+.\" METHOD: selection
.TP
\fIpathName \fBselection \fIoption arg\fR
+.
This command is used to adjust the selection within an entry. It
has several forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBselection adjust \fIindex\fR
+.
Locate the end of the selection nearest to the character given by
\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
(i.e. including but not going beyond \fIindex\fR). The other
@@ -337,20 +367,24 @@ selection anchor point, inclusive.
Returns an empty string.
.TP
\fIpathName \fBselection clear\fR
+.
Clear the selection if it is currently in this widget. If the
selection is not in this widget then the command has no effect.
Returns an empty string.
.TP
\fIpathName \fBselection from \fIindex\fR
+.
Set the selection anchor point to just before the character
given by \fIindex\fR. Does not change the selection.
Returns an empty string.
.TP
\fIpathName \fBselection present\fR
+.
Returns 1 if there is are characters selected in the entry,
0 if nothing is selected.
.TP
-\fIpathName \fBselection range \fIstart\fR \fIend\fR
+\fIpathName \fBselection range \fIstart end\fR
+.
Sets the selection to include the characters starting with
the one indexed by \fIstart\fR and ending with the one just
before \fIend\fR.
@@ -358,6 +392,7 @@ If \fIend\fR refers to the same character as \fIstart\fR or an
earlier one, then the entry's selection is cleared.
.TP
\fIpathName \fBselection to \fIindex\fR
+.
If \fIindex\fR is before the anchor point, set the selection
to the characters from \fIindex\fR up to but not including
the anchor point.
@@ -371,20 +406,25 @@ If the selection is not in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
+.\" METHOD: validate
.TP
\fIpathName \fBvalidate\fR
+.
This command is used to force an evaluation of the \fB\-validatecommand\fR
independent of the conditions specified by the \fB\-validate\fR option.
This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR.
It returns 0 or 1.
+.\" METHOD: xview
.TP
\fIpathName \fBxview \fIargs\fR
+.
This command is used to query and change the horizontal position of the
text in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fBxview\fR
+.
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
@@ -394,16 +434,19 @@ in the window, and 40% of the text is off-screen to the right.
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
-\fIpathName \fBxview\fR \fIindex\fR
+\fIpathName \fBxview\fI index\fR
+.
Adjusts the view in the window so that the character given by \fIindex\fR
is displayed at the left edge of the window.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
+.
Adjusts the view in the window so that the character \fIfraction\fR of the
way through the text appears at the left edge of the window.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
+.
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer or a float, but if it is a float then
diff --git a/doc/event.n b/doc/event.n
index 9f5a4c6..760efcc 100644
--- a/doc/event.n
+++ b/doc/event.n
@@ -20,8 +20,10 @@ The \fBevent\fR command provides several facilities for dealing with
window system events, such as defining virtual events and synthesizing
events. The command has several different forms, determined by the
first argument. The following forms are currently supported:
+.\" METHOD: add
.TP
\fBevent add <<\fIvirtual\fB>>\fI sequence \fR?\fIsequence ...\fR?
+.
Associates the virtual event \fIvirtual\fR with the physical
event sequence(s) given by the \fIsequence\fR arguments, so that
the virtual event will trigger whenever any one of the \fIsequence\fRs
@@ -31,8 +33,10 @@ any of the values allowed for the \fIsequence\fR argument to the
\fBbind\fR command.
If \fIvirtual\fR is already defined, the new physical event sequences
add to the existing sequences for the event.
+.\" METHOD: delete
.TP
-\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence\fR \fIsequence ...\fR?
+\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence sequence ...\fR?
+.
Deletes each of the \fIsequence\fRs from those associated with
the virtual event given by \fIvirtual\fR.
\fIVirtual\fR may be any string value and \fIsequence\fR may have
@@ -43,8 +47,10 @@ are ignored.
If no \fIsequence\fR argument is provided, all physical event sequences
are removed for \fIvirtual\fR, so that the virtual event will not
trigger anymore.
+.\" METHOD: generate
.TP
\fBevent generate \fIwindow event \fR?\fIoption value option value ...\fR?
+.
Generates a window event and arranges for it to be processed just as if
it had come from the window system.
\fIWindow\fR gives the path name of the window for which the event
@@ -65,8 +71,10 @@ will complete before the \fBevent generate\fR command returns.
If the \fB\-when\fR option is specified then it determines when the
event is processed. Certain events, such as key events, require
that the window has focus to receive the event properly.
+.\" METHOD: info
.TP
\fBevent info \fR?\fB<<\fIvirtual\fB>>\fR?
+.
Returns information about virtual events.
If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value
is a list of all the virtual events that are currently defined.
@@ -85,36 +93,48 @@ The following options are supported for the \fBevent generate\fR
command. These correspond to the
.QW %
expansions allowed in binding scripts for the \fBbind\fR command.
+.\" OPTION: -above
.TP
\fB\-above\fI window\fR
+.
\fIWindow\fR specifies the \fIabove\fR field for the event,
either as a window path name or as an integer window id.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%a\fR substitution for binding scripts.
+.\" OPTION: -borderwidth
.TP
\fB\-borderwidth\fI size\fR
+.
\fISize\fR must be a screen distance; it specifies the
\fIborder_width\fR field for the event.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%B\fR substitution for binding scripts.
+.\" OPTION: -button
.TP
\fB\-button\fI number\fR
+.
\fINumber\fR must be an integer; it specifies the \fIdetail\fR field
for a \fBButton\fR or \fBButtonRelease\fR event, overriding
any button number provided in the base \fIevent\fR argument.
Corresponds to the \fB%b\fR substitution for binding scripts.
+.\" OPTION: -count
.TP
\fB\-count\fI number\fR
+.
\fINumber\fR must be an integer; it specifies the \fIcount\fR field
for the event. Valid for \fBExpose\fR events.
Corresponds to the \fB%c\fR substitution for binding scripts.
+.\" OPTION: -data
.TP
\fB\-data\fI string\fR
+.
\fIString\fR may be any value; it specifies the \fIuser_data\fR field
for the event. Only valid for virtual events. Corresponds to the
\fB%d\fR substitution for virtual events in binding scripts.
+.\" OPTION: -delta
.TP
\fB\-delta\fI number\fR
+.
\fINumber\fR must be an integer; it specifies the \fIdelta\fR field
for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the
direction and magnitude the mouse wheel was rotated. Note the value
@@ -124,8 +144,10 @@ scroll the text widget up 4 lines and \-240 would scroll the text
widget down 8 lines. Of course, other widgets may define different
behaviors for mouse wheel motion. This field corresponds to the
\fB%D\fR substitution for binding scripts.
+.\" OPTION: -detail
.TP
\fB\-detail\fI detail\fR
+.
\fIDetail\fR specifies the \fIdetail\fR field for the event
and must be one of the following:
.RS
@@ -140,86 +162,112 @@ Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and
\fBFocusOut\fR events.
Corresponds to the \fB%d\fR substitution for binding scripts.
.RE
+.\" OPTION: -focus
.TP
\fB\-focus\fI boolean\fR
+.
\fIBoolean\fR must be a boolean value; it specifies the \fIfocus\fR
field for the event.
Valid for \fBEnter\fR and \fBLeave\fR events.
Corresponds to the \fB%f\fR substitution for binding scripts.
+.\" OPTION: -height
.TP
\fB\-height\fI size\fR
+.
\fISize\fR must be a screen distance; it specifies the \fIheight\fR
field for the event. Valid for \fBConfigure\fR events.
Corresponds to the \fB%h\fR substitution for binding scripts.
+.\" OPTION: -keycode
.TP
\fB\-keycode\fI number\fR
+.
\fINumber\fR must be an integer; it specifies the \fIkeycode\fR
field for the event.
Valid for \fBKey\fR and \fBKeyRelease\fR events.
Corresponds to the \fB%k\fR substitution for binding scripts.
+.\" OPTION: -keysym
.TP
\fB\-keysym\fI name\fR
+.
\fIName\fR must be the name of a valid keysym, such as \fBg\fR,
\fBspace\fR, or \fBReturn\fR; its corresponding
keycode value is used as the \fIkeycode\fR field for event, overriding
any detail specified in the base \fIevent\fR argument.
Valid for \fBKey\fR and \fBKeyRelease\fR events.
Corresponds to the \fB%K\fR substitution for binding scripts.
+.\" OPTION: -mode
.TP
\fB\-mode\fI notify\fR
+.
\fINotify\fR specifies the \fImode\fR field for the event and must be
one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or
\fBNotifyWhileGrabbed\fR.
Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and
\fBFocusOut\fR events.
Corresponds to the \fB%m\fR substitution for binding scripts.
+.\" OPTION: -override
.TP
\fB\-override\fI boolean\fR
+.
\fIBoolean\fR must be a boolean value; it specifies the
\fIoverride_redirect\fR field for the event.
Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events.
Corresponds to the \fB%o\fR substitution for binding scripts.
+.\" OPTION: -place
.TP
\fB\-place\fI where\fR
+.
\fIWhere\fR specifies the \fIplace\fR field for the event; it must be
either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR.
Valid for \fBCirculate\fR events.
Corresponds to the \fB%p\fR substitution for binding scripts.
+.\" OPTION: -root
.TP
\fB\-root\fI window\fR
+.
\fIWindow\fR must be either a window path name or an integer window
identifier; it specifies the \fIroot\fR field for the event.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events.
Corresponds to the \fB%R\fR substitution for binding scripts.
+.\" OPTION: -rootx
.TP
\fB\-rootx\fI coord\fR
+.
\fICoord\fR must be a screen distance; it specifies the \fIx_root\fR
field for the event.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events. Corresponds to the \fB%X\fR substitution for binding scripts.
+.\" OPTION: -rooty
.TP
\fB\-rooty\fI coord\fR
+.
\fICoord\fR must be a screen distance; it specifies the \fIy_root\fR
field for the event.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events.
Corresponds to the \fB%Y\fR substitution for binding scripts.
+.\" OPTION: -sendevent
.TP
\fB\-sendevent\fI boolean\fR
+.
\fIBoolean\fR must be a boolean value; it specifies the \fIsend_event\fR
field for the event. Valid for all events. Corresponds to the
\fB%E\fR substitution for binding scripts.
+.\" OPTION: -serial
.TP
\fB\-serial\fI number\fR
+.
\fINumber\fR must be an integer; it specifies the \fIserial\fR field
for the event. Valid for all events.
Corresponds to the \fB%#\fR substitution for binding scripts.
+.\" OPTION: -state
.TP
\fB\-state\fI state\fR
+.
\fIState\fR specifies the \fIstate\fR field for the event.
For \fBKey\fR, \fBKeyRelease\fR, \fBButtons\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events
@@ -229,37 +277,47 @@ For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR,
This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR
specified in the base \fIevent\fR.
Corresponds to the \fB%s\fR substitution for binding scripts.
+.\" OPTION: -subwindow
.TP
\fB\-subwindow\fI window\fR
+.
\fIWindow\fR specifies the \fIsubwindow\fR field for the event, either
as a path name for a Tk widget or as an integer window identifier.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events.
Similar to \fB%S\fR substitution for binding scripts.
+.\" OPTION: -time
.TP
\fB\-time\fI integer\fR
+.
\fIInteger\fR must be an integer value; it specifies the \fItime\fR field
-for the event. Additonally the special value \fBcurrent\fR is allowed,
+for the event. Additionally, the special value \fBcurrent\fR is allowed;
this value will be substituted by the current event time.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR,
and \fBProperty\fR events.
Corresponds to the \fB%t\fR substitution for binding scripts.
+.\" OPTION: -warp
.TP
\fB\-warp\fI boolean\fR
+.
\fIboolean\fR must be a boolean value; it specifies whether
the screen pointer should be warped as well.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
\fBButtonRelease\fR, and \fBMotion\fR events. The pointer will
only warp to a window if it is mapped.
+.\" OPTION: -width
.TP
\fB\-width\fI size\fR
+.
\fISize\fR must be a screen distance; it specifies the \fIwidth\fR field
for the event.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%w\fR substitution for binding scripts.
+.\" OPTION: -when
.TP
\fB\-when\fI when\fR
+.
\fIWhen\fR determines when the event will be processed; it must have one
of the following values:
.RS
@@ -278,8 +336,10 @@ other events already queued with \fB\-when mark\fR.
This option is useful when generating a series of events that should
be processed in order but at the front of the queue.
.RE
+.\" OPTION: -x
.TP
\fB\-x\fI coord\fR
+.
\fICoord\fR must be a screen distance; it specifies the \fIx\fR field
for the event.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
@@ -290,8 +350,10 @@ Corresponds to the \fB%x\fR substitution for binding scripts.
If \fIWindow\fR is empty the coordinate is relative to the
screen, and this option corresponds to the \fB%X\fR substitution
for binding scripts.
+.\" OPTION: -y
.TP
\fB\-y\fI coord\fR
+.
\fICoord\fR must be a screen distance; it specifies the \fIy\fR
field for the event.
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
@@ -312,6 +374,7 @@ Tk defines the following virtual events for the purposes of
notification:
.TP
\fB<<AltUnderlined>>\fR
+.
This is sent to widget to notify it that the letter it has underlined
(as an accelerator indicator) with the \fB\-underline\fR option has
been pressed in combination with the Alt key. The usual response to
@@ -319,26 +382,32 @@ this is to either focus into the widget (or some related widget) or to
invoke the widget.
.TP
\fB<<Invoke>>\fR
+.
This can be sent to some widgets (e.g. button, listbox, menu) as an
alternative to <space>.
.TP
\fB<<ListboxSelect>>\fR
+.
This is sent to a listbox when the set of selected item(s) in the
listbox is updated.
.TP
\fB<<MenuSelect>>\fR
+.
This is sent to a menu when the currently selected item in the menu
changes. It is intended for use with context-sensitive help systems.
.TP
\fB<<Modified>>\fR
+.
This is sent to a text widget when the contents of the widget are
changed.
.TP
\fB<<Selection>>\fR
+.
This is sent to a text widget when the selection in the widget is
changed.
.TP
\fB<<ThemeChanged>>\fR
+.
This is sent to all widgets when the ttk theme changed. The ttk
widgets listen to this event and redisplay themselves when it fires.
The legacy widgets ignore this event.
@@ -353,22 +422,26 @@ cause of the change. NOTE: all tk and ttk widgets already handle this
event internally.
.TP
\fB<<TraverseIn>>\fR
+.
This is sent to a widget when the focus enters the widget because of a
user-driven
.QW "tab to widget"
action.
.TP
\fB<<TraverseOut>>\fR
+.
This is sent to a widget when the focus leaves the widget because of a
user-driven
.QW "tab to widget"
action.
.TP
\fB<<UndoStack>>\fR
+.
This is sent to a text widget when its undo stack or redo stack becomes
empty or unempty.
.TP
\fB<<WidgetViewSync>>\fR
+.
This is sent to a text widget when its internal data become obsolete,
and again when these internal data are back in sync with the widget
view. The detail field (%d substitution) is either true (when the
@@ -379,12 +452,15 @@ bindings across multiple platforms. Users expect them to behave in the
following way:
.TP
\fB<<Clear>>\fR
+.
Delete the currently selected widget contents.
.TP
\fB<<Copy>>\fR
+.
Copy the currently selected widget contents to the clipboard.
.TP
\fB<<Cut>>\fR
+.
Move the currently selected widget contents to the clipboard.
.TP
\fB<<LineEnd>>\fR
@@ -418,10 +494,12 @@ Move to the next group of items (i.e., visible word) in the current widget
while deselecting any selected contents.
.TP
\fB<<Paste>>\fR
+.
Replace the currently selected widget contents with the contents of
the clipboard.
.TP
\fB<<PasteSelection>>\fR
+.
Insert the contents of the selection at the mouse location. (This
event has meaningful \fB%x\fR and \fB%y\fR substitutions).
.TP
@@ -441,6 +519,7 @@ Move to the previous paragraph in the current widget while deselecting any
selected contents.
.TP
\fB<<PrevWindow>>\fR
+.
Traverse to the previous window.
.TP
\fB<<PrevWord>>\fR
@@ -449,6 +528,7 @@ Move to the previous group of items (i.e., visible word) in the current widget
while deselecting any selected contents.
.TP
\fB<<Redo>>\fR
+.
Redo one undone action.
.TP
\fB<<SelectAll>>\fR
diff --git a/doc/focus.n b/doc/focus.n
index a6b0575..8b50765 100644
--- a/doc/focus.n
+++ b/doc/focus.n
@@ -55,6 +55,7 @@ things.
The \fBfocus\fR command can take any of the following forms:
.TP
\fBfocus\fR
+.
Returns the path name of the focus window on the display containing
the application's main window, or an empty string if no window in
this application has the focus on that display. Note: it is
@@ -63,6 +64,7 @@ better to specify the display explicitly using \fB\-displayof\fR
displays.
.TP
\fBfocus \fIwindow\fR
+.
If the application currently has the input focus on \fIwindow\fR's
display, this command resets the input focus for \fIwindow\fR's display
to \fIwindow\fR and returns an empty string.
@@ -72,12 +74,14 @@ for its top-level; the next time the focus arrives at the top-level,
Tk will redirect it to \fIwindow\fR.
If \fIwindow\fR is an empty string then the command does nothing.
.TP
-\fBfocus \-displayof\fR \fIwindow\fR
+\fBfocus \-displayof \fIwindow\fR
+.
Returns the name of the focus window on the display containing \fIwindow\fR.
If the focus window for \fIwindow\fR's display is not in this
application, the return value is an empty string.
.TP
\fBfocus \-force \fIwindow\fR
+.
Sets the focus of \fIwindow\fR's display to \fIwindow\fR, even if
the application does not currently have the input focus for the display.
This command should be used sparingly, if at all.
@@ -86,7 +90,8 @@ itself; instead, it should wait for the window manager to give it
the focus.
If \fIwindow\fR is an empty string then the command does nothing.
.TP
-\fBfocus \-lastfor\fR \fIwindow\fR
+\fBfocus \-lastfor \fIwindow\fR
+.
Returns the name of the most recent window to have the input focus
among all the windows in the same top-level as \fIwindow\fR.
If no window in that top-level has ever had the input focus, or
@@ -109,12 +114,13 @@ you use C code to query the X server directly.
To make a window that only participates in the focus traversal ring
when a variable is set, add the following bindings to the widgets
\fIbefore\fR and \fIafter\fR it in that focus ring:
+.PP
.CS
-button .before \-text "Before"
-button .middle \-text "Middle"
-button .after \-text "After"
-checkbutton .flag \-variable traverseToMiddle \-takefocus 0
-pack .flag \-side left
+button .before -text "Before"
+button .middle -text "Middle"
+button .after -text "After"
+checkbutton .flag -variable traverseToMiddle -takefocus 0
+pack .flag -side left
pack .before .middle .after
bind .before <Tab> {
if {!$traverseToMiddle} {
@@ -122,7 +128,7 @@ bind .before <Tab> {
break
}
}
-bind .after <Shift\-Tab> {
+bind .after <Shift-Tab> {
if {!$traverseToMiddle} {
\fBfocus\fR .before
break
diff --git a/doc/focusNext.n b/doc/focusNext.n
index 3283d4b..4740346 100644
--- a/doc/focusNext.n
+++ b/doc/focusNext.n
@@ -12,11 +12,11 @@
.SH NAME
tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for managing the input focus.
.SH SYNOPSIS
+.nf
\fBtk_focusNext \fIwindow\fR
-.sp
\fBtk_focusPrev \fIwindow\fR
-.sp
\fBtk_focusFollowsMouse\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -49,7 +49,8 @@ Tk will automatically give it the input focus.
The \fBfocus\fR command may be used to move the focus to a window
other than the one under the mouse, but as soon as the mouse moves
into a new window the focus will jump to that window.
-Note: at present there is no built-in support for returning the
+.PP
+Note that at present there is no built-in support for returning the
application to an explicit focus model; to do this you will have
to write a script that deletes the bindings created by
\fBtk_focusFollowsMouse\fR.
diff --git a/doc/font.n b/doc/font.n
index 4d2f5f4..c479e48 100644
--- a/doc/font.n
+++ b/doc/font.n
@@ -20,6 +20,7 @@ The \fBfont\fR command provides several facilities for dealing with
fonts, such as defining named fonts and inspecting the actual attributes of
a font. The command has several different forms, determined by the
first argument. The following forms are currently supported:
+.\" METHOD: actual
.TP
\fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? ?\fB\-\|\-\fR? ?\fIchar\fR?
.
@@ -38,6 +39,7 @@ that character, which will be different from the base font if the base
font does not contain the given character. If \fIchar\fR may be a hyphen, it
should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled
\fIoption\fR.
+.\" METHOD: configure
.TP
\fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -58,6 +60,7 @@ are implemented by the system theme. To achieve the effect of modification,
use \fBfont actual\fR to get their configuration and \fBfont create\fR to
synthesize a copy of the font which can be modified.
.RE
+.\" METHOD: create
.TP
\fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR?
.
@@ -67,8 +70,9 @@ form \fBfont\fIx\fR, where \fIx\fR is an integer. There may be any number
of \fIoption\fR\-\fIvalue\fR pairs, which provide the desired attributes for
the new named font. See \fBFONT OPTIONS\fR below for a list of the possible
attributes.
+.\" METHOD: delete
.TP
-\fBfont delete\fR \fIfontname\fR ?\fIfontname ...\fR?
+\fBfont delete\fI fontname\fR ?\fIfontname ...\fR?
.
Delete the specified named fonts. If there are widgets using the named font,
the named font will not actually be deleted until all the instances are
@@ -76,12 +80,14 @@ released. Those widgets will continue to display using the last known values
for the named font. If a deleted named font is subsequently recreated with
another call to \fBfont create\fR, the widgets will use the new named font
and redisplay themselves using the new attributes of that font.
+.\" METHOD: families
.TP
\fBfont families\fR ?\fB\-displayof \fIwindow\fR?
.
The return value is a list of the case-insensitive names of all font families
that exist on \fIwindow\fR's display. If the \fIwindow\fR argument is
omitted, it defaults to the main window.
+.\" METHOD: measure
.TP
\fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR
.
@@ -96,6 +102,7 @@ characters such as cursive
If the string contains newlines or tabs,
those characters are not expanded or treated specially when measuring the
string.
+.\" METHOD: metrics
.TP
\fBfont metrics \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR?
.
@@ -107,8 +114,10 @@ omitted, it defaults to the main window. If \fIoption\fR is specified,
returns the value of that metric; if it is omitted, the return value is a
list of all the metrics and their values. See \fBFONT METRICS\fR
below for a list of the possible metrics.
+.\" METHOD: names
.TP
\fBfont names\fR
+.
The return value is a list of all the named fonts that are currently defined.
.SH "FONT DESCRIPTIONS"
.PP
@@ -200,16 +209,19 @@ horizontal line where the bottom of most letters line up; certain letters,
such as lower-case
.QW g
stick below the baseline.
+.\" OPTION: -ascent
.TP
-\fB\-ascent \0\fR
+\fB\-ascent\fR
.
The amount in pixels that the tallest letter sticks up above the baseline of
the font, plus any extra blank space added by the designer of the font.
+.\" OPTION: -descent
.TP
-\fB\-descent \0\fR
+\fB\-descent\fR
.
The largest amount in pixels that any letter sticks down below the baseline
of the font, plus any extra blank space added by the designer of the font.
+.\" OPTION: -linespace
.TP
\fB\-linespace\fR
.
@@ -217,8 +229,9 @@ Returns how far apart vertically in pixels two lines of text using the same
font should be placed so that none of the characters in one line overlap any
of the characters in the other line. This is generally the sum of the ascent
above the baseline line plus the descent below the baseline.
+.\" OPTION: -fixed
.TP
-\fB\-fixed \0\fR
+\fB\-fixed\fR
.
Returns a boolean flag that is
.QW \fB1\fR
@@ -235,6 +248,7 @@ included when calculating this value.
The following options are supported on all platforms, and are used when
constructing a named font or when specifying a font using style [5] as
above:
+.\" OPTION: -family
.TP
\fB\-family \fIname\fR
.
@@ -251,6 +265,7 @@ The \fIname\fR may also be the name of a native, platform-specific font
family; in that case it will work as desired on one platform but may not
display correctly on other platforms. If the family is unspecified or
unrecognized, a platform-specific default font will be chosen.
+.\" OPTION: -size
.TP
\fB\-size \fIsize\fR
.
@@ -270,6 +285,7 @@ to a fixed-size bitmap. The mapping between points and pixels is set when
the application starts, based on properties of the installed monitor, but it
can be overridden by calling the \fBtk scaling\fR command.
.RE
+.\" OPTION: -weight
.TP
\fB\-weight \fIweight\fR
.
@@ -277,20 +293,26 @@ The nominal thickness of the characters in the font. The value
\fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a
bold font. The closest available weight to the one specified will
be chosen. The default weight is \fBnormal\fR.
+.\" OPTION: -slant
.TP
\fB\-slant \fIslant\fR
+.
The amount the characters in the font are slanted away from the
vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR.
A roman font is the normal, upright appearance of a font, while
an italic font is one that is tilted some number of degrees from upright.
The closest available slant to the one specified will be chosen.
The default slant is \fBroman\fR.
+.\" OPTION: -underline
.TP
\fB\-underline \fIboolean\fR
+.
The value is a boolean flag that specifies whether characters in this
font should be underlined. The default value for underline is \fBfalse\fR.
+.\" OPTION: -overstrike
.TP
\fB\-overstrike \fIboolean\fR
+.
The value is a boolean flag that specifies whether a horizontal line should
be drawn through the middle of characters in this font. The default value
for overstrike is \fBfalse\fR.
@@ -298,41 +320,23 @@ for overstrike is \fBfalse\fR.
.PP
The following named fonts are supported on all systems, and default to values
that match appropriate system defaults.
-.TP
-\fBTkDefaultFont\fR
-.
+.IP \fBTkDefaultFont\fR
This font is the default for all GUI items not otherwise specified.
-.TP
-\fBTkTextFont\fR
-.
+.IP \fBTkTextFont\fR
This font should be used for user text in entry widgets, listboxes etc.
-.TP
-\fBTkFixedFont\fR
-.
+.IP \fBTkFixedFont\fR
This font is the standard fixed-width font.
-.TP
-\fBTkMenuFont\fR
-.
+.IP \fBTkMenuFont\fR
This font is used for menu items.
-.TP
-\fBTkHeadingFont\fR
-.
+.IP \fBTkHeadingFont\fR
This font should be used for column headings in lists and tables.
-.TP
-\fBTkCaptionFont\fR
-.
+.IP \fBTkCaptionFont\fR
This font should be used for window and dialog caption bars.
-.TP
-\fBTkSmallCaptionFont\fR
-.
+.IP \fBTkSmallCaptionFont\fR
This font should be used for captions on contained windows or tool dialogs.
-.TP
-\fBTkIconFont\fR
-.
+.IP \fBTkIconFont\fR
This font should be used for icon captions.
-.TP
-\fBTkTooltipFont\fR
-.
+.IP \fBTkTooltipFont\fR
This font should be used for tooltip windows (transient information windows).
.LP
It is \fInot\fR advised to change these fonts, as they may be modified by Tk
@@ -343,9 +347,11 @@ modify that.
The following system fonts are supported:
.TP
\fBX Windows\fR
+.
All valid X font names, including those listed by xlsfonts(1), are available.
.TP
\fBMS Windows\fR
+.
The following fonts are supported, and are mapped to the user's
style defaults.
.RS
@@ -357,6 +363,7 @@ style defaults.
.RE
.TP
\fBMac OS X\fR
+.
The following fonts are supported, and are mapped to the user's
style defaults.
.RS
@@ -386,17 +393,17 @@ theme fonts:
Fill a text widget with lots of font demonstrators, one for every font
family installed on your system:
.CS
-pack [text .t \-wrap none] \-fill both \-expand 1
+pack [text .t -wrap none] -fill both -expand 1
set count 0
set tabwidth 0
-foreach family [lsort \-dictionary [\fBfont families\fR]] {
- .t tag configure f[incr count] \-font [list $family 10]
- .t insert end ${family}:\\t {} \e
+foreach family [lsort -dictionary [\fBfont families\fR]] {
+ .t tag configure f[incr count] -font [list $family 10]
+ .t insert end ${family}:\et {} \e
"This is a simple sampler\en" f$count
- set w [\fBfont measure\fR [.t cget \-font] ${family}:]
- if {$w+5 > $tabwidth} {
- set tabwidth [expr {$w+5}]
- .t configure \-tabs $tabwidth
+ set w [\fBfont measure\fR [.t cget -font] ${family}:]
+ if {$w + 5 > $tabwidth} {
+ set tabwidth [expr {$w + 5}]
+ .t configure -tabs $tabwidth
}
}
.CE
diff --git a/doc/fontchooser.n b/doc/fontchooser.n
index 465af2e..4e667e5 100644
--- a/doc/fontchooser.n
+++ b/doc/fontchooser.n
@@ -11,11 +11,11 @@
.SH NAME
fontchooser \- control font selection dialog
.SH SYNOPSIS
+.nf
\fBtk fontchooser\fR \fBconfigure\fR ?\fI\-option value ...\fR?
-.sp
\fBtk fontchooser\fR \fBshow\fR
-.sp
\fBtk fontchooser\fR \fBhide\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -30,16 +30,19 @@ difference, all user interaction with the dialog will be communicated to the
caller via callbacks or virtual events.
.PP
The \fBtk fontchooser\fR command can have one of the following forms:
+.\" METHOD: configure
.TP
\fBtk fontchooser\fR \fBconfigure \fR?\fI\-option value ...\fR?
.
Set or query one or more of the configurations options below (analogous to Tk
widget configuration).
+.\" METHOD: show
.TP
\fBtk fontchooser\fR \fBshow\fR
.
Show the font selection dialog. Depending on the platform, may return
immediately or only once the dialog has been withdrawn.
+.\" METHOD: hide
.TP
\fBtk fontchooser\fR \fBhide\fR
.
@@ -47,24 +50,32 @@ Hide the font selection dialog if it is visible and cause any pending
\fBtk fontchooser\fR \fBshow\fR command to return.
.PP
.SH "CONFIGURATION OPTIONS"
+.\" OPTION: -parent
.TP
\fB\-parent\fR
+.
Specifies/returns the logical parent window of the font selection dialog
(similar to the \fB\-parent\fR option to other dialogs). The font selection
dialog is hidden if it is visible when the parent window is destroyed.
+.\" OPTION: -title
.TP
\fB\-title\fR
+.
Specifies/returns the title of the dialog. Has no effect on platforms where the
font selection dialog does not support titles.
+.\" OPTION: -font
.TP
\fB\-font\fR
+.
Specifies/returns the font that is currently selected in the dialog if it is
visible, or that will be initially selected when the dialog is shown (if
supported by the platform). Can be set to the empty string to indicate that no
font should be selected. Fonts can be specified in any form given by the "FONT
DESCRIPTION" section in the \fBfont\fR manual page.
+.\" OPTION: -command
.TP
\fB\-command\fR
+.
Specifies/returns the command prefix to be called when a font selection has
been made by the user. The command prefix is evaluated at the global level
after having the specification of the selected font appended. On platforms
@@ -74,8 +85,10 @@ evaluation. Can be set to the empty string to indicate that no callback should
be invoked. Fonts are specified by a list of form [3] of the "FONT DESCRIPTION"
section in the \fBfont\fR manual page (i.e. a list of the form
\fI{family size style ?style ...?}\fR).
+.\" OPTION: -visible
.TP
\fB\-visible\fR
+.
Read-only option that returns a boolean indicating whether the font selection
dialog is currently visible. Attempting to set this option results in an error.
@@ -83,6 +96,7 @@ dialog is currently visible. Attempting to set this option results in an error.
.SH "VIRTUAL EVENTS"
.TP
\fB<<TkFontchooserVisibility>>\fR
+.
Sent to the dialog parent whenever the visibility of the font selection dialog
changes, both as a result of user action (e.g. disposing of the dialog via
OK/Cancel button or close box) and of the \fBtk fontchooser\fR
@@ -91,6 +105,7 @@ current visibility of the dialog by querying the \fB\-visible\fR configuration
option.
.TP
\fB<<TkFontchooserFontChanged>>\fR
+.
Sent to the dialog parent whenever the font selection dialog is visible and the
selected font changes, both as a result of user action and of the \fB\-font\fR
configuration option being set. Binding scripts can determine the currently
@@ -139,36 +154,36 @@ to ensure its selected font matches the new value of the named font.
.CS
proc fontchooserDemo {} {
wm title . "Font Chooser Demo"
- \fBtk fontchooser\fR \fBconfigure\fR \-parent .
- button .b \-command fontchooserToggle \-takefocus 0
+ \fBtk fontchooser\fR \fBconfigure\fR -parent .
+ button .b -command fontchooserToggle -takefocus 0
fontchooserVisibility .b
- bind . \fB<<TkFontchooserVisibility>>\fR \\
+ bind . \fB<<TkFontchooserVisibility>>\fR \e
[list fontchooserVisibility .b]
foreach w {.t1 .t2} {
- text $w \-width 20 \-height 4 \-borderwidth 1 \-relief solid
+ text $w -width 20 -height 4 -borderwidth 1 -relief solid
bind $w <FocusIn> [list fontchooserFocus $w]
$w insert end "Text Widget $w"
}
- .t1 configure \-font {Courier 14}
- .t2 configure \-font {Times 16}
+ .t1 configure -font {Courier 14}
+ .t2 configure -font {Times 16}
pack .b .t1 .t2; focus .t1
}
proc fontchooserToggle {} {
\fBtk fontchooser\fR [expr {
- [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ [\fBtk fontchooser\fR \fBconfigure\fR -visible] ?
"\fBhide\fR" : "\fBshow\fR"}]
}
proc fontchooserVisibility {w} {
- $w configure \-text [expr {
- [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ $w configure -text [expr {
+ [\fBtk fontchooser\fR \fBconfigure\fR -visible] ?
"Hide Font Dialog" : "Show Font Dialog"}]
}
proc fontchooserFocus {w} {
- \fBtk fontchooser\fR \fBconfigure\fR \-font [$w cget \-font] \\
- \-command [list fontchooserFontSelection $w]
+ \fBtk fontchooser\fR \fBconfigure\fR -font [$w cget -font] \e
+ -command [list fontchooserFontSelection $w]
}
proc fontchooserFontSelection {w font args} {
- $w configure \-font [font actual $font]
+ $w configure -font [font actual $font]
}
fontchooserDemo
.CE
diff --git a/doc/frame.n b/doc/frame.n
index 97ff3b1..27d3b5a 100644
--- a/doc/frame.n
+++ b/doc/frame.n
@@ -12,7 +12,7 @@
.SH NAME
frame \- Create and manipulate 'frame' simple container widgets
.SH SYNOPSIS
-\fBframe\fR \fIpathName\fR ?\fIoptions\fR?
+\fBframe\fI pathName\fR ?\fIoptions\fR?
.SO
\-borderwidth \-highlightcolor \-pady
\-cursor \-highlightthickness \-relief
@@ -127,13 +127,15 @@ operations on the widget. It has the following general form:
the frame widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for frame widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBframe\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n
index d2323de..757d91f 100644
--- a/doc/getOpenFile.n
+++ b/doc/getOpenFile.n
@@ -34,21 +34,26 @@ whether the existing file should be overwritten or not.
.PP
The following \fIoption\-value\fR pairs are possible as command line
arguments to these two commands:
+.\" OPTION: -command
.TP
-\fB\-command\fR \fIstring\fR
+\fB\-command\fI string\fR
+.
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
+.\" OPTION: -confirmoverwrite
.TP
-\fB\-confirmoverwrite\fR \fIboolean\fR
+\fB\-confirmoverwrite\fI boolean\fR
+.
Configures how the Save dialog reacts when the selected file already
exists, and saving would overwrite it. A true value requests a
confirmation dialog be presented to the user. A false value requests
that the overwrite take place without confirmation. Default value is true.
+.\" OPTION: -defaultextension
.TP
-\fB\-defaultextension\fR \fIextension\fR
+\fB\-defaultextension\fI extension\fR
.
Specifies a string that will be appended to the filename if the user
enters a filename without an extension. The default value is the empty
@@ -57,8 +62,9 @@ any case. This option is ignored on Mac OS X, which
does not require extensions to filenames,
and the UNIX implementation guesses reasonable values for this from
the \fB\-filetypes\fR option when this is not supplied.
+.\" OPTION: -filetypes
.TP
-\fB\-filetypes\fR \fIfilePatternList\fR
+\fB\-filetypes\fI filePatternList\fR
.
If a \fBFile types\fR listbox exists in the file dialog on the particular
platform, this option gives the \fIfiletype\fRs in this listbox. When
@@ -68,8 +74,9 @@ empty list, or if the \fBFile types\fR listbox is not supported by the
particular platform then all files are listed regardless of their
types. See the section \fBSPECIFYING FILE PATTERNS\fR below for a
discussion on the contents of \fIfilePatternList\fR.
+.\" OPTION: -initialdir
.TP
-\fB\-initialdir\fR \fIdirectory\fR
+\fB\-initialdir\fI directory\fR
.
Specifies that the files in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified,
@@ -79,32 +86,38 @@ On Vista and later systems, the initial directory defaults to the last
user-selected directory for the application. If the
parameter specifies a relative path, the return value will convert the
relative path to an absolute path.
+.\" OPTION: -initialfile
.TP
-\fB\-initialfile\fR \fIfilename\fR
+\fB\-initialfile\fI filename\fR
.
Specifies a filename to be displayed in the dialog when it pops up.
+.\" OPTION: -message
.TP
-\fB\-message\fR \fIstring\fR
+\fB\-message\fI string\fR
.
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
+.\" OPTION: -multiple
.TP
-\fB\-multiple\fR \fIboolean\fR
+\fB\-multiple\fI boolean\fR
.
Allows the user to choose multiple files from the Open dialog.
+.\" OPTION: -parent
.TP
-\fB\-parent\fR \fIwindow\fR
+\fB\-parent\fI window\fR
.
Makes \fIwindow\fR the logical parent of the file dialog. The file
dialog is displayed on top of its parent window. On Mac OS X, this
turns the file dialog into a sheet attached to the parent window.
+.\" OPTION: -title
.TP
-\fB\-title\fR \fItitleString\fR
+\fB\-title\fI titleString\fR
.
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title is displayed.
+.\" OPTION: -typevariable
.TP
-\fB\-typevariable\fR \fIvariableName\fR
+\fB\-typevariable\fI variableName\fR
.
The global variable \fIvariableName\fR is used to preselect which filter is
used from \fIfilterList\fR when the dialog box is opened and is
@@ -192,7 +205,7 @@ set types {
{{GIF Files} {} GIFF}
{{All Files} * }
}
-set filename [\fBtk_getOpenFile\fR \-filetypes $types]
+set filename [\fBtk_getOpenFile\fR -filetypes $types]
if {$filename ne ""} {
# Open the file ...
diff --git a/doc/grab.n b/doc/grab.n
index 259d68e..fc4ce02 100644
--- a/doc/grab.n
+++ b/doc/grab.n
@@ -12,9 +12,10 @@
.SH NAME
grab \- Confine pointer and keyboard events to a window sub-tree
.SH SYNOPSIS
+.nf
\fBgrab \fR?\fB\-global\fR? \fIwindow\fR
-.sp
\fBgrab \fIoption \fR?\fIarg \fR...?
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -83,21 +84,28 @@ grab on a given display at once.
The \fBgrab\fR command can take any of the following forms:
.TP
\fBgrab \fR?\fB\-global\fR? \fIwindow\fR
+.
Same as \fBgrab set\fR, described below.
+.\" METHOD: current
.TP
\fBgrab current \fR?\fIwindow\fR?
+.
If \fIwindow\fR is specified, returns the name of the current grab
window in this application for \fIwindow\fR's display, or an empty
string if there is no such window.
If \fIwindow\fR is omitted, the command returns a list whose elements
are all of the windows grabbed by this application for all displays,
or an empty string if the application has no grabs.
+.\" METHOD: release
.TP
\fBgrab release \fIwindow\fR
+.
Releases the grab on \fIwindow\fR if there is one, otherwise does
nothing. Returns an empty string.
+.\" METHOD: set
.TP
\fBgrab set \fR?\fB\-global\fR? \fIwindow\fR
+.
Sets a grab on \fIwindow\fR. If \fB\-global\fR is specified then the
grab is global, otherwise it is local.
If a grab was already in effect for this application on
@@ -105,8 +113,10 @@ If a grab was already in effect for this application on
If there is already a grab on \fIwindow\fR and it has the same
global/local form as the requested grab, then the command
does nothing. Returns an empty string.
+.\" METHOD: status
.TP
\fBgrab status \fIwindow\fR
+.
Returns \fBnone\fR if no grab is currently set on \fIwindow\fR,
\fBlocal\fR if a local grab is set on \fIwindow\fR, and
\fBglobal\fR if a global grab is set.
@@ -136,9 +146,9 @@ Set a grab so that only one button may be clicked out of a group. The
other buttons are unresponsive to the mouse until the middle button is
clicked.
.CS
-pack [button .b1 \-text "Click me! #1" \-command {destroy .b1}]
-pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}]
-pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}]
+pack [button .b1 -text "Click me! #1" -command {destroy .b1}]
+pack [button .b2 -text "Click me! #2" -command {destroy .b2}]
+pack [button .b3 -text "Click me! #3" -command {destroy .b3}]
\fBgrab\fR .b2
.CE
.SH "SEE ALSO"
diff --git a/doc/grid.n b/doc/grid.n
index 90f80cd..eaeaf41 100644
--- a/doc/grid.n
+++ b/doc/grid.n
@@ -28,12 +28,14 @@ argument to \fBgrid configure\fR, either a window name (any value
starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR
(see the \fBRELATIVE PLACEMENT\fR section below), then the command is
processed in the same way as \fBgrid configure\fR.
+.\" METHOD: anchor
.TP
\fBgrid anchor \fIwindow\fR ?\fIanchor\fR?
.
The anchor value controls how to place the grid within the container window
when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below
for further details. The default \fIanchor\fR is \fInw\fR.
+.\" METHOD: bbox
.TP
\fBgrid bbox \fIwindow\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
.
@@ -47,6 +49,7 @@ the command line, then the bounding box for that cell is returned, where the
top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR
arguments are specified, then the bounding box spanning the rows and columns
indicated is returned.
+.\" METHOD: columnconfigure
.TP
\fBgrid columnconfigure \fIwindow index \fR?\fI\-option value...\fR?
.
@@ -82,8 +85,9 @@ If only an option is specified, with no value,
the current value of that option is returned.
If only the container window and index is specified, all the current settings
are returned in a list of
-.QW "\-option value"
+.QW "\fI\-option value\fR"
pairs.
+.\" METHOD: configure
.TP
\fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
.
@@ -96,6 +100,7 @@ location of a \fIwindow\fR, as described in the \fBRELATIVE PLACEMENT\fR
section, below.
The following options are supported:
.RS
+.\" OPTION: -column
.TP
\fB\-column \fIn\fR
.
@@ -108,6 +113,7 @@ if it is the first window. For each
\fBx\fR that immediately precedes the \fIwindow\fR, the column position
is incremented by one. Thus the \fBx\fR represents a blank column
for this row in the grid.
+.\" OPTION: -columnspan
.TP
\fB\-columnspan \fIn\fR
.
@@ -115,12 +121,14 @@ Insert the window so that it occupies \fIn\fR columns in the grid.
The default is one column, unless the window name is followed by a
\fB\-\fR, in which case the columnspan is incremented once for each immediately
following \fB\-\fR.
+.\" OPTION: -in
.TP
\fB\-in \fIcontainer\fR
.
Insert the window(s) in the container
window given by \fIcontainer\fR. The default is the first window's
parent window.
+.\" OPTION: -ipadx
.TP
\fB\-ipadx \fIamount\fR
.
@@ -129,6 +137,7 @@ leave on each side of the content. This is space is added
inside the content border.
The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
It defaults to 0.
+.\" OPTION: -ipady
.TP
\fB\-ipady \fIamount\fR
.
@@ -136,6 +145,7 @@ The \fIamount\fR specifies how much vertical internal padding to
leave on the top and bottom of the content.
This space is added inside the content border.
The \fIamount\fR defaults to 0.
+.\" OPTION: -padx
.TP
\fB\-padx \fIamount\fR
.
@@ -145,6 +155,7 @@ leave on each side of the content, in screen units.
of two values to specify padding for left and right separately.
The \fIamount\fR defaults to 0.
This space is added outside the content border.
+.\" OPTION: -pady
.TP
\fB\-pady \fIamount\fR
.
@@ -154,6 +165,7 @@ leave on the top and bottom of the content, in screen units.
of two values to specify padding for top and bottom separately.
The \fIamount\fR defaults to 0.
This space is added outside the content border.
+.\" OPTION: -row
.TP
\fB\-row \fIn\fR
.
@@ -162,6 +174,7 @@ Row numbers start with 0. If this option is not supplied, then the
content is arranged on the same row as the previous content specified on this
call to \fBgrid\fR, or the next row after the highest occupied row
if this is the first content.
+.\" OPTION: -rowspan
.TP
\fB\-rowspan \fIn\fR
.
@@ -170,6 +183,7 @@ The default is one row. If the next \fBgrid\fR command contains
\fB^\fR characters instead of \fIcontent\fR that line up with the columns
of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\fR is
extended by one.
+.\" OPTION: -sticky
.TP
\fB\-sticky \fIstyle\fR
.
@@ -193,6 +207,16 @@ If any of the content is already managed by the geometry manager
then any unspecified options for them retain their previous values rather
than receiving default values.
.RE
+.\" METHOD: content
+.TP
+\fBgrid content \fIwindow\fR ?\fI\-option value\fR?
+.
+If no options are supplied, a list of all of the content in \fIwindow\fR
+is returned, most recently managed first.
+\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which
+causes only the content in the row (or column) specified by \fIvalue\fR
+to be returned.
+.\" METHOD: forget
.TP
\fBgrid forget \fIwindow \fR?\fIwindow ...\fR?
.
@@ -205,11 +229,12 @@ default settings are used.
.RS
.PP
.VS "TIP 518"
-If the last content window of the container becomes unmanaged, this will also send
-the virtual event \fB<<NoManagedChild>>\fR to the container; the container
+If the last content window of the container becomes unmanaged, this will also
+send the virtual event \fB<<NoManagedChild>>\fR to the container; the container
may choose to resize itself (or otherwise respond) to such a change.
.VE "TIP 518"
.RE
+.\" METHOD: info
.TP
\fBgrid info \fIwindow\fR
.
@@ -219,13 +244,15 @@ might be specified to \fBgrid configure\fR.
The first two elements of the list are
.QW "\fB\-in \fIcontainer\fR"
where \fIcontainer\fR is the windows's container window.
+.\" METHOD: location
.TP
\fBgrid location \fIwindow x y\fR
.
-Given \fIx\fR and \fIy\fR values in screen units relative to the container window,
-the column and row number at that \fIx\fR and \fIy\fR location is returned.
-For locations that are above or to the left of the grid, \fB\-1\fR is
-returned.
+Given \fIx\fR and \fIy\fR values in screen units relative to the container
+window, the column and row number at that \fIx\fR and \fIy\fR location is
+returned. For locations that are above or to the left of the grid, \fB\-1\fR
+is returned.
+.\" METHOD: propagate
.TP
\fBgrid propagate \fIwindow\fR ?\fIboolean\fR?
.
@@ -238,7 +265,11 @@ In either of these cases an empty string is returned.
If \fIboolean\fR is omitted then the command returns \fB0\fR or
\fB1\fR to indicate whether propagation is currently enabled
for \fIwindow\fR.
+.RS
+.PP
Propagation is enabled by default.
+.RE
+.\" METHOD: rowconfigure
.TP
\fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR?
.
@@ -249,9 +280,9 @@ and \fB\-pad\fR.
If one or more options are provided, then \fIindex\fR may be given as
a list of row indices to which the configuration options will operate on.
Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR
-the options apply to all rows currently occupied by content windows. For
-a window name, that window must be a content window of this container and the options
-apply to all rows currently occupied by the container window.
+the options apply to all rows currently occupied by content windows. For a
+window name, that window must be a content window of this container and the
+options apply to all rows currently occupied by the container window.
The \fB\-minsize\fR option sets the minimum size, in screen units,
that will be permitted for this row.
The \fB\-weight\fR option (an integer value)
@@ -276,6 +307,7 @@ If only the container window and index is specified, all the current settings
are returned in a list of
.QW "-option value"
pairs.
+.\" METHOD: remove
.TP
\fBgrid remove \fIwindow \fR?\fIwindow ...\fR?
.
@@ -288,11 +320,12 @@ geometry manager, the previous values are retained.
.RS
.PP
.VS "TIP 518"
-If the last content window of the container becomes unmanaged, this will also send
-the virtual event \fB<<NoManagedChild>>\fR to the container; the container
-may choose to resize itself (or otherwise respond) to such a change.
+If the last content window of the container becomes unmanaged, this will also
+send the virtual event \fB<<NoManagedChild>>\fR to the container; the
+container may choose to resize itself (or otherwise respond) to such a change.
.VE "TIP 518"
.RE
+.\" METHOD: size
.TP
\fBgrid size \fIcontainer\fR
.
@@ -300,14 +333,7 @@ Returns the size of the grid (in columns then rows) for \fIcontainer\fR.
The size is determined either by the \fIcontent\fR occupying the largest
row or column, or the largest column or row with a \fB\-minsize\fR,
\fB\-weight\fR, or \fB\-pad\fR that is non-zero.
-.TP
-\fBgrid content \fIwindow\fR ?\fI\-option value\fR?
-.
-If no options are supplied, a list of all of the content in \fIwindow\fR
-is returned, most recently managed first.
-\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which
-causes only the content in the row (or column) specified by \fIvalue\fR
-to be returned.
+.\" METHOD: slaves
.TP
\fBgrid slaves \fIwindow\fR ?\fI\-option value\fR?
.
@@ -328,21 +354,15 @@ relative to other \fIcontent\fRs in the same grid command, and the presence
of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR
command where \fIcontent\fR names are normally expected.
.RS
-.TP
-\fB\-\fR
-.
+.IP \fB\-\fR
This increases the \fB\-columnspan\fR of the \fIcontent\fR to the left. Several
-\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR
-may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\fR
-argument to \fBgrid configure\fR.
-.TP
-\fBx\fR
-.
+\fB\-\fR's in a row will successively increase the number of columns spanned.
+A \fB\-\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first
+\fIcontent\fR argument to \fBgrid configure\fR.
+.IP \fBx\fR
This leaves an empty column between the \fIcontent\fR on the left and
the \fIcontent\fR on the right.
-.TP
-\fB^\fR
-.
+.IP \fB^\fR
This extends the \fB\-rowspan\fR of the \fIcontent\fR above the \fB^\fR's
in the grid. The number of \fB^\fR's in a row must match the number of
columns spanned by the \fIcontent\fR above it.
@@ -359,8 +379,8 @@ away from the layout as needed.
For the final step, each content is positioned in its row(s) and column(s)
based on the setting of its \fIsticky\fR flag.
.PP
-To compute the minimum size of a layout, the grid geometry manager
-first looks at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one,
+To compute the minimum size of a layout, the grid geometry manager first looks
+at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one,
and computes the nominal size of each row or column to be either the
\fIminsize\fR for that row or column, or the sum of the \fIpad\fRding
plus the size of the largest content, whichever is greater. After that
@@ -441,17 +461,17 @@ A toplevel window containing a text widget and two scrollbars:
.CS
# Make the widgets
toplevel .t
-text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set}
-scrollbar .t.v \-orient vertical \-command {.t.txt yview}
-scrollbar .t.h \-orient horizontal \-command {.t.txt xview}
+text .t.txt -wrap none -xscroll {.t.h set} -yscroll {.t.v set}
+scrollbar .t.v -orient vertical -command {.t.txt yview}
+scrollbar .t.h -orient horizontal -command {.t.txt xview}
# Lay them out
-\fBgrid\fR .t.txt .t.v \-sticky nsew
-\fBgrid\fR .t.h \-sticky nsew
+\fBgrid\fR .t.txt .t.v -sticky nsew
+\fBgrid\fR .t.h -sticky nsew
# Tell the text widget to take all the extra room
-\fBgrid rowconfigure\fR .t .t.txt \-weight 1
-\fBgrid columnconfigure\fR .t .t.txt \-weight 1
+\fBgrid rowconfigure\fR .t .t.txt -weight 1
+\fBgrid columnconfigure\fR .t .t.txt -weight 1
.CE
.PP
Three widgets of equal width, despite their different
@@ -459,12 +479,12 @@ Three widgets of equal width, despite their different
widths:
.PP
.CS
-button .b \-text "Foo"
-entry .e \-textvariable foo ; set foo "Hello World!"
-label .l \-text "This is a fairly long piece of text"
+button .b -text "Foo"
+entry .e -textvariable foo ; set foo "Hello World!"
+label .l -text "This is a fairly long piece of text"
-\fBgrid\fR .b .e .l \-sticky ew
-\fBgrid columnconfigure\fR . "all" \-uniform allTheSame
+\fBgrid\fR .b .e .l -sticky ew
+\fBgrid columnconfigure\fR . "all" -uniform allTheSame
.CE
.SH "SEE ALSO"
pack(n), place(n)
diff --git a/doc/image.n b/doc/image.n
index 24b768a..0d14e02 100644
--- a/doc/image.n
+++ b/doc/image.n
@@ -12,15 +12,17 @@
.SH NAME
image \- Create and manipulate images
.SH SYNOPSIS
-\fBimage\fR \fIoption \fR?\fIarg ...\fR?
+\fBimage\fI option \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
The \fBimage\fR command is used to create, delete, and query images.
It can take several different forms, depending on the
\fIoption\fR argument. The legal forms are:
+.\" METHOD: create
.TP
\fBimage create \fItype \fR?\fIname\fR? ?\fIoption value ...\fR?
+.
Creates a new image and a command with the same name and returns its name.
\fItype\fR specifies the type of the image, which must be one of
the types currently defined (e.g., \fBbitmap\fR).
@@ -38,8 +40,10 @@ It is important to note that the image command will silently overwrite any
procedure that may currently be defined by the given name, so choose the
name wisely. It is recommended to use a separate namespace for image names
(e.g., \fB::img::logo\fR, \fB::img::large\fR).
+.\" METHOD: delete
.TP
\fBimage delete \fR?\fIname name\fR ...?
+.
Deletes each of the named images and returns an empty string.
If there are instances of the images displayed in widgets,
the images will not actually be deleted until all of the instances
@@ -50,28 +54,40 @@ Existing instances will retain their sizes but redisplay as
empty areas.
If a deleted image is recreated with another call to \fBimage create\fR,
the existing instances will use the new image.
+.\" METHOD: height
.TP
\fBimage height \fIname\fR
+.
Returns a decimal string giving the height of image \fIname\fR
in pixels.
+.\" METHOD: inuse
.TP
\fBimage inuse \fIname\fR
+.
Returns a boolean value indicating whether or not the image given by
\fIname\fR is in use by any widgets.
+.\" METHOD: names
.TP
\fBimage names\fR
+.
Returns a list containing the names of all existing images.
+.\" METHOD: type
.TP
\fBimage type \fIname\fR
+.
Returns the type of image \fIname\fR (the value of the \fItype\fR
argument to \fBimage create\fR when the image was created).
+.\" METHOD: types
.TP
\fBimage types\fR
+.
Returns a list whose elements are all of the valid image types
(i.e., all of the values that may be supplied for the \fItype\fR
argument to \fBimage create\fR).
+.\" METHOD: width
.TP
\fBimage width \fIname\fR
+.
Returns a decimal string giving the width of image \fIname\fR
in pixels.
.PP
@@ -83,18 +99,15 @@ page for the particular image type for details.
The following image types are defined by Tk so they will be available
in any Tk application.
Individual applications or extensions may define additional types.
-.TP
-\fBbitmap\fR
+.IP \fBbitmap\fR
Each pixel in the image displays a foreground color, a background
color, or nothing.
See the \fBbitmap\fR manual entry for more information.
-.TP
-\fBphoto\fR
+.IP \fBphoto\fR
Displays a variety of full-color images, using dithering to
approximate colors on displays with limited color capabilities.
See the \fBphoto\fR manual entry for more information.
-.TP
-\fBnsimage\fR
+.IP \fBnsimage\fR
This type is only available in the Aqua platform. It is a full-color
image which may be created from a named system image. It has options
designed to facilitate the use of these images in buttons. An
diff --git a/doc/label.n b/doc/label.n
index 290ac8a..e50f8b1 100644
--- a/doc/label.n
+++ b/doc/label.n
@@ -12,7 +12,7 @@
.SH NAME
label \- Create and manipulate 'label' non-interactive text or image widgets
.SH SYNOPSIS
-\fBlabel\fR \fIpathName \fR?\fIoptions\fR?
+\fBlabel\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-disabledforeground \-padx
\-activeforeground \-font \-pady
@@ -80,14 +80,18 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for label widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBlabel\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -108,18 +112,18 @@ labels are not intended to be interactive.
.PP
.CS
# Make the widgets
-\fBlabel\fR .t \-text "This widget is at the top" \-bg red
-\fBlabel\fR .b \-text "This widget is at the bottom" \-bg green
-\fBlabel\fR .l \-text "Left\enHand\enSide"
-\fBlabel\fR .r \-text "Right\enHand\enSide"
+\fBlabel\fR .t -text "This widget is at the top" -bg red
+\fBlabel\fR .b -text "This widget is at the bottom" -bg green
+\fBlabel\fR .l -text "Left\enHand\enSide"
+\fBlabel\fR .r -text "Right\enHand\enSide"
text .mid
\&.mid insert end "This layout is like Java's BorderLayout"
# Lay them out
-pack .t \-side top \-fill x
-pack .b \-side bottom \-fill x
-pack .l \-side left \-fill y
-pack .r \-side right \-fill y
-pack .mid \-expand 1 \-fill both
+pack .t -side top -fill x
+pack .b -side bottom -fill x
+pack .l -side left -fill y
+pack .r -side right -fill y
+pack .mid -expand 1 -fill both
.CE
.SH "SEE ALSO"
labelframe(n), button(n), ttk::label(n)
diff --git a/doc/labelframe.n b/doc/labelframe.n
index d8dd2c3..5027d34 100644
--- a/doc/labelframe.n
+++ b/doc/labelframe.n
@@ -12,7 +12,7 @@
.SH NAME
labelframe \- Create and manipulate 'labelframe' labelled container widgets
.SH SYNOPSIS
-\fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR?
+\fBlabelframe\fI pathName\fR ?\fIoptions\fR?
.SO
\-borderwidth \-highlightbackground \-pady
\-cursor \-highlightcolor \-relief
@@ -101,14 +101,18 @@ operations on the widget. It has the following general form:
the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for frame widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBlabelframe\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -132,10 +136,10 @@ This shows how to build part of a GUI for a hamburger vendor. The
the kinds of things that the choices are being made over.
.PP
.CS
-grid [\fBlabelframe\fR .burger \-text "Burger"] \e
- [\fBlabelframe\fR .bun \-text "Bun"] \-sticky news
-grid [\fBlabelframe\fR .cheese \-text "Cheese Option"] \e
- [\fBlabelframe\fR .pickle \-text "Pickle Option"] \-sticky news
+grid [\fBlabelframe\fR .burger -text "Burger"] \e
+ [\fBlabelframe\fR .bun -text "Bun"] -sticky news
+grid [\fBlabelframe\fR .cheese -text "Cheese Option"] \e
+ [\fBlabelframe\fR .pickle -text "Pickle Option"] -sticky news
foreach {type name val} {
burger Beef beef
burger Lamb lamb
@@ -157,9 +161,9 @@ foreach {type name val} {
pickle Onions onion
pickle Chili chili
} {
- set w [radiobutton .$type.$val \-text $name \-anchor w \e
- \-variable $type \-value $val]
- pack $w \-side top \-fill x
+ set w [radiobutton .$type.$val -text $name -anchor w \e
+ -variable $type -value $val]
+ pack $w -side top -fill x
}
set burger beef
set bun white
diff --git a/doc/listbox.n b/doc/listbox.n
index a047be6..e1ac2de 100644
--- a/doc/listbox.n
+++ b/doc/listbox.n
@@ -12,7 +12,7 @@
.SH NAME
listbox \- Create and manipulate 'listbox' item list widgets
.SH SYNOPSIS
-\fBlistbox\fR \fIpathName \fR?\fIoptions\fR?
+\fBlistbox\fI pathName \fR?\fIoptions\fR?
.SO
\-background \-borderwidth \-cursor
\-disabledforeground \-exportselection \-font
@@ -95,37 +95,28 @@ Many of the widget commands for listboxes take one or more indices
as arguments.
An index specifies a particular element of the listbox, in any of
the following ways:
-.TP 12
-\fInumber\fR
-.
+.IP \fInumber\fR 12
Specifies the element as a numerical index, where 0 corresponds
to the first element in the listbox.
-.TP 12
-\fBactive\fR
-.
+.IP \fBactive\fR 12
Indicates the element that has the location cursor. This element
will be displayed as specified by \fB\-activestyle\fR when the listbox
has the keyboard focus, and it is specified with the \fBactivate\fR
widget command.
-.TP 12
-\fBanchor\fR
-.
+.IP \fBanchor\fR 12
Indicates the anchor point for the selection, which is set with the
\fBselection anchor\fR widget command.
-.TP 12
-\fBend\fR
-.
+.IP \fBend\fR 12
Indicates the end of the listbox.
For most commands this refers to the last element in the listbox,
but for a few commands such as \fBindex\fR and \fBinsert\fR
it refers to the element just after the last one.
-.TP 12
-\fB@\fIx\fB,\fIy\fR
+.IP \fB@\fIx\fB,\fIy\fR 12
Indicates the element that covers the point in the listbox window
specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no
element covers that point, then the closest element to that
point is used.
-.LP
+.PP
Indexes support the same simple interpretation as
for the command \fBstring index\fR, with simple integer index
arithmetic and indexing relative to \fBend\fR.
@@ -144,8 +135,9 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for listbox widgets:
+.\" METHOD: activate
.TP
-\fIpathName \fBactivate\fR \fIindex\fR
+\fIpathName \fBactivate\fI index\fR
.
Sets the active element to the one indicated by \fIindex\fR.
If \fIindex\fR is outside the range of elements in the listbox
@@ -153,8 +145,9 @@ then the closest element is activated.
The active element is drawn as specified by \fB\-activestyle\fR when the
widget has the input focus, and its index may be retrieved with the
index \fBactive\fR.
+.\" METHOD: bbox
.TP
-\fIpathName \fBbbox\fR \fIindex\fR
+\fIpathName \fBbbox\fI index\fR
.
Returns a list of four numbers describing the bounding box of
the text in the element given by \fIindex\fR.
@@ -168,13 +161,15 @@ or if \fIindex\fR refers to a non-existent element,
then the result is an empty string; if the element is
partially visible, the result gives the full area of the element,
including any parts that are not visible.
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBlistbox\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -190,6 +185,7 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBlistbox\fR
command.
+.\" METHOD: curselection
.TP
\fIpathName \fBcurselection\fR
.
@@ -197,6 +193,7 @@ Returns a list containing the numerical indices of
all of the elements in the listbox that are currently selected.
If there are no elements selected in the listbox then an empty
string is returned.
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
.
@@ -204,6 +201,7 @@ Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR
are indices specifying the first and last elements in the range
to delete. If \fIlast\fR is not specified it defaults to
\fIfirst\fR, i.e. a single element is deleted.
+.\" METHOD: get
.TP
\fIpathName \fBget \fIfirst\fR ?\fIlast\fR?
.
@@ -215,12 +213,14 @@ are all of the listbox elements between \fIfirst\fR and \fIlast\fR,
inclusive.
Both \fIfirst\fR and \fIlast\fR may have any of the standard
forms for indices.
+.\" METHOD: index
.TP
\fIpathName \fBindex \fIindex\fR
.
Returns the integer index value that corresponds to \fIindex\fR.
If \fIindex\fR is \fBend\fR the return value is a count of the number
of elements in the listbox (not the index of the last element).
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR?
.
@@ -228,12 +228,14 @@ Inserts zero or more new elements in the list just before the
element given by \fIindex\fR. If \fIindex\fR is specified as
\fBend\fR then the new elements are added to the end of the
list. Returns an empty string.
+.\" METHOD: itemcget
.TP
\fIpathName \fBitemcget \fIindex option\fR
.
Returns the current value of the item configuration option given
by \fIoption\fR. \fIOption\fR may have any of the values accepted
by the \fBitemconfigure\fR command.
+.\" METHOD: itemconfigure
.TP
\fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
.
@@ -249,22 +251,26 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. The following options
are currently supported for items:
.RS
+.\" OPTION: -background
.TP
\fB\-background \fIcolor\fR
.
\fIColor\fR specifies the background color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
+.\" OPTION: -foreground
.TP
\fB\-foreground \fIcolor\fR
.
\fIColor\fR specifies the foreground color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
+.\" OPTION: -selectbackground
.TP
\fB\-selectbackground \fIcolor\fR
.
\fIcolor\fR specifies the background color to use when displaying the
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
+.\" OPTION: -selectforeground
.TP
\fB\-selectforeground \fIcolor\fR
.
@@ -272,13 +278,15 @@ item while it is selected. It may have any of the forms accepted by
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.RE
+.\" METHOD: nearest
.TP
\fIpathName \fBnearest \fIy\fR
.
Given a y-coordinate within the listbox window, this command returns
the index of the (visible) listbox element nearest to that y-coordinate.
+.\" METHOD: scan
.TP
-\fIpathName \fBscan\fR \fIoption args\fR
+\fIpathName \fBscan\fI option args\fR
.
This command is used to implement scanning on listboxes. It has
two forms, depending on \fIoption\fR:
@@ -302,6 +310,7 @@ with mouse motion events in the widget, to produce the effect of
dragging the list at high speed through the window. The return
value is an empty string.
.RE
+.\" METHOD: see
.TP
\fIpathName \fBsee \fIindex\fR
.
@@ -311,6 +320,7 @@ If the element is already visible then the command has no effect;
if the element is near one edge of the window then the listbox
scrolls to bring the element into view at the edge; otherwise
the listbox scrolls to center the element.
+.\" METHOD: selection
.TP
\fIpathName \fBselection \fIoption arg\fR
.
@@ -346,11 +356,13 @@ Selects all of the elements in the range between
\fIfirst\fR and \fIlast\fR, inclusive, without affecting
the selection state of elements outside that range.
.RE
+.\" METHOD: size
.TP
\fIpathName \fBsize\fR
.
Returns a decimal string indicating the total number of elements
in the listbox.
+.\" METHOD: xview
.TP
\fIpathName \fBxview \fR?\fIargs\fR
.
@@ -399,6 +411,7 @@ If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
\fInumber\fR character units (the width of the \fB0\fR character)
on the display.
.RE
+.\" METHOD: yview
.TP
\fIpathName \fByview \fR?\fIargs\fR?
.
@@ -408,6 +421,7 @@ It can take any of the following forms:
.RS
.TP
\fIpathName \fByview\fR
+.
Returns a list containing two elements, both of which are real fractions
between 0 and 1.
The first element gives the position of the listbox element at the
diff --git a/doc/loadTk.n b/doc/loadTk.n
index e1c93c8..bd0b037 100644
--- a/doc/loadTk.n
+++ b/doc/loadTk.n
@@ -11,7 +11,7 @@
.SH NAME
safe::loadTk \- Load Tk into a safe interpreter.
.SH SYNOPSIS
-\fBsafe::loadTk \fIchild\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR?
+\fBsafe::loadTk \fIchild\fR ?\fB\-use\fI windowId\fR? ?\fB\-display\fI displayName\fR?
.BE
.SH DESCRIPTION
.PP
@@ -32,7 +32,7 @@ a window belonging to another application. As a convenience, if the window you
plan to use is a Tk Window of the application you can use the window name
(e.g.,
.QW \fB.x.y\fR )
-instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR).
+instead of its window Id (e.g., from \fBwinfo id\fI .x.y\fR).
When \fB\-use\fR is not specified, a new toplevel window is created for the
.QW .
window of the safe interpreter. On X11 if you want the embedded window to use
@@ -51,7 +51,7 @@ Tk initialization is now safe with respect to not trusting the child's state
for startup. \fBsafe::loadTk\fR registers the child's name so when the Tk
initialization (\fBTk_SafeInit\fR) is called and in turn calls the parent's
\fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent
-(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.)
+(\fB\-use\fI windowId\fR, correct \fB\-display\fR, etc.)
.PP
When \fB\-use\fR is not used, the new toplevel created is specially decorated
so the user is always aware that the user interface presented comes from a
diff --git a/doc/menu.n b/doc/menu.n
index 3b5485a..9894a6c 100644
--- a/doc/menu.n
+++ b/doc/menu.n
@@ -13,8 +13,9 @@
menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars
.SH SYNOPSIS
.nf
-\fBmenu\fR \fIpathName \fR?\fIoptions\fR?
-\fBtk_menuSetFocus\fR \fIpathName\fR
+\fBmenu\fI pathName \fR?\fIoptions\fR?
+\fBtk_menuSetFocus\fI pathName\fR
+.fi
.SO
\-activebackground \-borderwidth \-foreground
\-activeborderwidth \-cursor \-relief
@@ -312,57 +313,36 @@ Many of the widget commands for a menu take as one argument an
indicator of which entry of the menu to operate on. These
indicators are called \fIindex\fRes and may be specified in
any of the following forms:
-.TP 12
-\fBactive\fR
-.
+.IP \fBactive\fR 12
Indicates the entry that is currently active. If no entry is
active then this form is equivalent to \fB{}\fR. This form may
not be abbreviated.
-.TP 12
-\fBend\fR
-.
+.IP \fBend\fR 12
Indicates the bottommost entry in the menu. If there are no
entries in the menu then this form is equivalent to \fB{}\fR.
This form may not be abbreviated.
-.TP 12
-\fBlast\fR
-.
+.IP \fBlast\fR 12
Same as \fBend\fR.
-.TP 12
-\fB{}\fR
-.
+.IP \fB{}\fR 12
Indicates
.QW "no entry at all" ;
this is used most commonly with
the \fBactivate\fR option to deactivate all the entries in the
menu. In most cases the specification of \fB{}\fR causes
nothing to happen in the widget command.
-.TP 12
-\fBnone\fR
-.
-Same as \fB{}\fR
-This form is deprecated and may not be abbreviated.
-.TP 12
-\fB@\fIx\fB,\fIy\fR
-.
+.IP \fB@\fIx\fB,\fIy\fR 12
Indicates the entry that covers the point in the menu's window specified
by \fIx\fR and \fIy\fR (in pixel coordinates).
If no entry covers that point, then this form is equivalent to \fB{}\fR.
If only a single number is specified, it is treated as the y-coordinate.
-.TP 12
-\fInumber\fR
-.
+.IP \fInumber\fR 12
Specifies the entry numerically, where 0 corresponds
to the top-most entry of the menu, 1 to the entry below it, and
so on.
-.TP 12
-\fIid\fR
-.
+.IP \fIid\fR 12
If the index does not satisfy one of the above forms then the menu is
searched for an entry with the specified id.
-.TP 12
-\fIpattern\fR
-.
+.IP \fIpattern\fR 12
If all of the above methods for finding an entry fail, this
form is used. \fIPattern\fR is pattern-matched against the label of
each entry in the menu, in order from the top down, until a
@@ -376,15 +356,17 @@ for the command \fBstring index\fR, with simple integer index
arithmetic and indexing relative to \fBend\fR.
.PP
The following widget commands are possible for menu widgets:
+.\" METHOD: activate
.TP
\fIpathName \fBactivate \fIindex\fR
.
Change the state of the entry indicated by \fIindex\fR to \fBactive\fR
and redisplay it using its active colors.
Any previously-active entry is deactivated. If \fIindex\fR
-is specified as \fB{}\fR or \fBnone\fR, or if the specified entry is
+is specified as \fB{}\fR, or if the specified entry is
disabled, then the menu ends up with no active entry.
Returns an empty string.
+.\" METHOD: add
.TP
\fIpathName \fBadd \fItype \fR?\fIid\fR? ?\fIoption value option value ...\fR?
.
@@ -398,6 +380,7 @@ identifier is generated.
If additional arguments are present, they specify the options listed in the
\fBMENU ENTRY OPTIONS\fR section below.
The \fBadd\fR widget command returns the id of the new entry.
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
@@ -405,6 +388,7 @@ Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBmenu\fR
command.
+.\" METHOD: clone
.TP
\fIpathName \fBclone \fInewPathname\fR ?\fIcloneType\fR?
.
@@ -414,6 +398,7 @@ propagated to the original menu and vice versa. \fIcloneType\fR can be
\fBnormal\fR, \fBmenubar\fR, or \fBtearoff\fR. Should not normally be
called outside of the Tk library. See the \fBCLONES\fR section for
more information.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -429,6 +414,7 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBmenu\fR
command.
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fIindex1\fR ?\fIindex2\fR?
.
@@ -437,6 +423,7 @@ Delete all of the menu entries between \fIindex1\fR and
If \fIindex2\fR is omitted then it defaults to \fIindex1\fR.
Attempts to delete a tear-off menu entry are ignored (instead, you
should change the \fB\-tearoff\fR option to remove the tear-off entry).
+.\" METHOD: entrycget
.TP
\fIpathName \fBentrycget \fIindex option\fR
.
@@ -444,6 +431,7 @@ Returns the current value of a configuration option for
the entry given by \fIindex\fR.
\fIOption\fR may have any of the names described in the
\fBMENU ENTRY OPTIONS\fR section below.
+.\" METHOD: entryconfigure
.TP
\fIpathName \fBentryconfigure \fIindex \fR?\fIoptions...\fR?
.
@@ -457,6 +445,7 @@ modified as indicated in the command and the command returns an empty string.
If no \fIoptions\fR are specified, returns a list describing
the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for
information on the format of this list).
+.\" METHOD: id
.TP
\fIpathName \fBid \fIindex\fR
.
@@ -465,11 +454,13 @@ This is the identifier that was assigned to the entry when it was created
using the \fBadd\fR or \fBinsert\fR widget command.
Returns an empty string for the tear-off entry, or if \fIindex\fR is
equivalent to \fB{}\fR.
+.\" METHOD: index
.TP
\fIpathName \fBindex \fIindex\fR
.
Returns the numerical index corresponding to \fIindex\fR, or
-\fB{}\fR if \fIindex\fR was specified as \fB{}\fR or \fBnone\fR.
+\fB{}\fR if \fIindex\fR was specified as \fB{}\fR.
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fIindex type \fR?\fIid\fR? ?\fIoption value option value ...\fR?
.
@@ -480,6 +471,7 @@ to the end of the menu. The \fItype\fR, \fIid\fR, \fIoption\fR, and
widget command. It is not possible to insert new menu entries before the
tear-off entry, if the menu has one.
The \fBinsert\fR widget command returns the id of the new entry.
+.\" METHOD: invoke
.TP
\fIpathName \fBinvoke \fIindex\fR
.
@@ -492,6 +484,7 @@ command. Otherwise the result is an empty string. Note: invoking
a menu entry does not automatically unpost the menu; the default
bindings normally take care of this before invoking the \fBinvoke\fR
widget command.
+.\" METHOD: post
.TP
\fIpathName \fBpost \fIx y\fR ?\fIindex\fR?
.
@@ -506,6 +499,7 @@ posting the menu and the result of that script is returned as the
result of the \fBpost\fR widget command. If an error returns while
executing the command, then the error is returned without posting the
menu.
+.\" METHOD: postcascade
.TP
\fIpathName \fBpostcascade \fIindex\fR
.
@@ -515,6 +509,7 @@ If \fIindex\fR does not correspond to a cascade entry,
or if \fIpathName\fR is not posted,
the command has no effect except to unpost any currently posted
submenu.
+.\" METHOD: type
.TP
\fIpathName \fBtype \fIindex\fR
.
@@ -522,6 +517,7 @@ Returns the type of the menu entry given by \fIindex\fR.
This is the \fItype\fR argument passed to the \fBadd\fR or \fBinsert\fR widget
command when the entry was created, such as \fBcommand\fR
or \fBseparator\fR, or \fBtearoff\fR for a tear-off entry.
+.\" METHOD: unpost
.TP
\fIpathName \fBunpost\fR
.
@@ -529,11 +525,13 @@ Unmap the window so that it is no longer displayed. If a
lower-level cascaded menu is posted, unpost that menu. Returns an
empty string. This subcommand does not work on Windows and the
Macintosh, as those platforms have their own way of unposting menus.
+.\" METHOD: xposition
.TP
\fIpathName \fBxposition \fIindex\fR
.
Returns a decimal string giving the x-coordinate within the menu
window of the leftmost pixel in the entry specified by \fIindex\fR.
+.\" METHOD: yposition
.TP
\fIpathName \fByposition \fIindex\fR
.
@@ -542,6 +540,7 @@ window of the topmost pixel in the entry specified by \fIindex\fR.
.SH "MENU ENTRY OPTIONS"
The following options are allowed on menu entries. Most options are not
supported by all entry types.
+.\" OPTION: -activebackground
.TP
\fB\-activebackground \fIvalue\fR
.
@@ -553,6 +552,7 @@ If the \fBtk_strictMotif\fR variable has been set to request strict
Motif compliance, then this option is ignored and the \fB\-background\fR
option is used in its place.
This option is not available for separator or tear-off entries.
+.\" OPTION: -activeforeground
.TP
\fB\-activeforeground \fIvalue\fR
.
@@ -560,7 +560,7 @@ Specifies a foreground color to use for displaying this entry when it
is active. This option is ignored on Aqua/macOS.
If this option is specified as an empty string (the default), then the
\fB\-activeforeground\fR option for the overall menu is used.
-This option is not available for separator or tear-off entries.
+.\" OPTION: -accelerator
.TP
\fB\-accelerator \fIvalue\fR
.
@@ -570,6 +570,7 @@ used to invoke the same function as the menu entry. This is a display
option, it does not actually set the corresponding binding (which can
be achieved using the \fBbind\fR command). This option is not available
for separator or tear-off entries.
+.\" OPTION: -background
.TP
\fB\-background \fIvalue\fR
.
@@ -579,6 +580,7 @@ This option is ignored on Aqua/macOS.
If it is specified as an empty string (the default), then the
\fB\-background\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
+.\" OPTION: -bitmap
.TP
\fB\-bitmap \fIvalue\fR
.
@@ -591,6 +593,7 @@ to an empty string to enable a textual label to be displayed.
If a \fB\-image\fR option has been specified, it overrides
\fB\-bitmap\fR.
This option is not available for separator or tear-off entries.
+.\" OPTION: -columnbreak
.TP
\fB\-columnbreak \fIvalue\fR
.
@@ -599,11 +602,13 @@ this option is one, the entry appears at the top of a new column in the
menu.
This option is ignored on Aqua/macOS, where menus are always a single
column.
+.\" OPTION: -command
.TP
\fB\-command \fIvalue\fR
.
Specifies a Tcl command to execute when the menu entry is invoked.
Not available for separator or tear-off entries.
+.\" OPTION: -compound
.TP
\fB\-compound \fIvalue\fR
.
@@ -614,6 +619,7 @@ Valid values for this option are \fBbottom\fR, \fBcenter\fR,
is \fBnone\fR, meaning that the button will display either an image or
text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
options.
+.\" OPTION: -font
.TP
\fB\-font \fIvalue\fR
.
@@ -622,6 +628,7 @@ string in this entry.
If this option is specified as an empty string (the default) then
the \fB\-font\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
+.\" OPTION: -foreground
.TP
\fB\-foreground \fIvalue\fR
.
@@ -631,6 +638,7 @@ This option is ignored on Aqua/macOS.
If it is specified as an empty string (the default), then the
\fB\-foreground\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
+.\" OPTION: -hidemargin
.TP
\fB\-hidemargin \fIvalue\fR
.
@@ -638,6 +646,7 @@ Specifies whether the standard margins should be drawn for this menu
entry. This is useful when creating palette with images in them, i.e.,
color palettes, pattern palettes, etc. 1 indicates that the margin for
the entry is hidden; 0 means that the margin is used.
+.\" OPTION: -image
.TP
\fB\-image \fIvalue\fR
.
@@ -650,34 +659,40 @@ This option overrides the \fB\-label\fR and \fB\-bitmap\fR options
but may be reset to an empty string to enable a textual or
bitmap label to be displayed.
This option is not available for separator or tear-off entries.
+.\" OPTION: -indicatoron
.TP
\fB\-indicatoron \fIvalue\fR
.
Available only for checkbutton and radiobutton entries.
\fIValue\fR is a boolean that determines whether or not the
indicator should be displayed.
+.\" OPTION: -label
.TP
\fB\-label \fIvalue\fR
.
Specifies a string to display as an identifying label in the menu
entry. Not available for separator or tear-off entries.
+.\" OPTION: -menu
.TP
\fB\-menu \fIvalue\fR
.
Available only for cascade entries. Specifies the path name of
the submenu associated with this entry.
The submenu must be a child of the menu.
+.\" OPTION: -offvalue
.TP
\fB\-offvalue \fIvalue\fR
.
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is
deselected.
+.\" OPTION: -onvalue
.TP
\fB\-onvalue \fIvalue\fR
.
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
+.\" OPTION: -selectcolor
.TP
\fB\-selectcolor \fIvalue\fR
.
@@ -686,6 +701,7 @@ Specifies the color to display in the indicator when the entry is
selected.
If the value is an empty string (the default) then the \fB\-selectcolor\fR
option for the menu determines the indicator color.
+.\" OPTION: -selectimage
.TP
\fB\-selectimage \fIvalue\fR
.
@@ -696,6 +712,7 @@ the \fB\-image\fR option) when it is selected.
by some previous invocation of \fBimage create\fR.
This option is ignored unless the \fB\-image\fR option has
been specified.
+.\" OPTION: -state
.TP
\fB\-state \fIvalue\fR
.
@@ -713,6 +730,7 @@ In this state the entry is displayed according to the
\fB\-disabledforeground\fR option for the menu and the
\fB\-background\fR option from the entry.
This option is not available for separator entries.
+.\" OPTION: -underline
.TP
\fB\-underline \fIvalue\fR
.
@@ -723,6 +741,7 @@ implement keyboard traversal.
1 to the next character, and so on.
If a bitmap or image is displayed in the entry then this option is ignored.
This option is not available for separator or tear-off entries.
+.\" OPTION: -value
.TP
\fB\-value \fIvalue\fR
.
@@ -730,6 +749,7 @@ Available only for radiobutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
If an empty string is specified, then the \fB\-label\fR option
for the entry as the value to store in the variable.
+.\" OPTION: -variable
.TP
\fB\-variable \fIvalue\fR
.
diff --git a/doc/menubutton.n b/doc/menubutton.n
index d07a8fe..375b69a 100644
--- a/doc/menubutton.n
+++ b/doc/menubutton.n
@@ -12,7 +12,7 @@
.SH NAME
menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets
.SH SYNOPSIS
-\fBmenubutton\fR \fIpathName \fR?\fIoptions\fR?
+\fBmenubutton\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-disabledforeground \-padx
\-activeforeground \-font \-pady
@@ -122,6 +122,7 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for menubutton widgets:
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
@@ -129,6 +130,7 @@ Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBmenubutton\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
diff --git a/doc/message.n b/doc/message.n
index a8bf6b7..1ac1c02 100644
--- a/doc/message.n
+++ b/doc/message.n
@@ -12,7 +12,7 @@
.SH NAME
message \- Create and manipulate 'message' non-interactive text widgets
.SH SYNOPSIS
-\fBmessage\fR \fIpathName \fR?\fIoptions\fR?
+\fBmessage\fI pathName \fR?\fIoptions\fR?
.SO
\-anchor \-background \-borderwidth
\-cursor \-font \-foreground
@@ -111,6 +111,7 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for message widgets:
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
@@ -118,6 +119,7 @@ Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBmessage\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
diff --git a/doc/messageBox.n b/doc/messageBox.n
index 4350b22..33825dc 100644
--- a/doc/messageBox.n
+++ b/doc/messageBox.n
@@ -23,14 +23,17 @@ popped up, \fBtk_messageBox\fR waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
.PP
The following option-value pairs are supported:
+.\" OPTION: -command
.TP
-\fB\-command\fR \fIstring\fR
+\fB\-command\fI string\fR
+.
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog. The actual command consists of \fIstring\fR followed by a space
and the name of the button clicked by the user to close the dialog. This
is only available on Mac OS X.
+.\" OPTION: -default
.TP
-\fB\-default\fR \fIname\fR
+\fB\-default\fI name\fR
.
\fIName\fR gives the symbolic name of the default button for
this message window (
@@ -39,65 +42,59 @@ this message window (
and so on). See \fB\-type\fR
for a list of the symbolic names. If this option is not specified,
the first button in the dialog will be made the default.
+.\" OPTION: -detail
.TP
-\fB\-detail\fR \fIstring\fR
+\fB\-detail\fI string\fR
.
Specifies an auxiliary message to the main message given by the
\fB\-message\fR option. The message detail will be presented beneath the main
message and, where supported by the OS, in a less emphasized font than the
main message.
+.\" OPTION: -icon
.TP
-\fB\-icon\fR \fIiconImage\fR
+\fB\-icon\fI iconImage\fR
.
Specifies an icon to display. \fIIconImage\fR must be one of the
following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or
\fBwarning\fR. If this option is not specified, then the info icon will be
displayed.
+.\" OPTION: -message
.TP
-\fB\-message\fR \fIstring\fR
+\fB\-message\fI string\fR
.
Specifies the message to display in this message box. The
default value is an empty string.
+.\" OPTION: -parent
.TP
-\fB\-parent\fR \fIwindow\fR
+\fB\-parent\fI window\fR
.
Makes \fIwindow\fR the logical parent of the message box. The message
box is displayed on top of its parent window.
+.\" OPTION: -title
.TP
-\fB\-title\fR \fItitleString\fR
+\fB\-title\fI titleString\fR
.
Specifies a string to display as the title of the message box. The
default value is an empty string.
+.\" OPTION: -type
.TP
-\fB\-type\fR \fIpredefinedType\fR
+\fB\-type\fI predefinedType\fR
.
Arranges for a predefined set of buttons to be displayed. The
following values are possible for \fIpredefinedType\fR:
.RS
-.TP 18
-\fBabortretryignore\fR
-.
+.IP \fBabortretryignore\fR 18
Displays three buttons whose symbolic names are \fBabort\fR,
\fBretry\fR and \fBignore\fR.
-.TP 18
-\fBok\fR
-.
+.IP \fBok\fR 18
Displays one button whose symbolic name is \fBok\fR.
-.TP 18
-\fBokcancel\fR
-.
+.IP \fBokcancel\fR 18
Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR.
-.TP 18
-\fBretrycancel\fR
-.
+.IP \fBretrycancel\fR 18
Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR.
-.TP 18
-\fByesno\fR
-.
+.IP \fByesno\fR 18
Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR.
-.TP 18
-\fByesnocancel\fR
-.
+.IP \fByesnocancel\fR 18
Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR
and \fBcancel\fR.
.RE
@@ -105,13 +102,13 @@ and \fBcancel\fR.
.SH EXAMPLE
.PP
.CS
-set answer [\fBtk_messageBox\fR \-message "Really quit?" \e
- \-icon question \-type yesno \e
- \-detail "Select \e"Yes\e" to make the application exit"]
-switch \-\- $answer {
+set answer [\fBtk_messageBox\fR -message "Really quit?" \e
+ -icon question -type yesno \e
+ -detail "Select \e"Yes\e" to make the application exit"]
+switch -- $answer {
yes exit
- no {\fBtk_messageBox\fR \-message "I know you like this application!" \e
- \-type ok}
+ no {\fBtk_messageBox\fR -message "I know you like this application!" \e
+ -type ok}
}
.CE
.SH KEYWORDS
diff --git a/doc/nsimage.n b/doc/nsimage.n
index 8b401d7..d62416f 100644
--- a/doc/nsimage.n
+++ b/doc/nsimage.n
@@ -26,67 +26,68 @@ name.
.SH OPTIONS
.PP
Valid \fIoptions\fR are:
+.\" OPTION: -source
.TP
-\fB\-source\fR
+\fB\-source\fI string\fR
.PP
The value of the \fB\-source\fR option is a string describing an
NSimage. There are several ways to interpret this string, and the
interpretation is determined by the value of the \fB\-as\fR option.
This option is required.
.PP
+.\" OPTION: -as
.TP
-\fB\-as\fR
+\fB\-as\fI type\fR
.PP
-There are four possible values for the \fB-as\fR option which specify
+There are four possible values for the \fB\-as\fR option which specify
how the source string should be interpreted. The allowed values and
their meanings are:
-.IP
-\fBname\fR
-.IP
+.RS
+.IP \fBname\fR
The source should be interpreted as the name of a named NSImage
-provided by the system. This is the default if the -as option is not specified.
-.IP
-\fBfile\fR
-.IP
+provided by the system.
+This is the default if the \fB\-as\fR option is not specified.
+.IP \fBfile\fR
The source should be interpreted as a path to an image
file in one of the formats understood by the NSImage class.
-.IP
-\fBpath\fR
-.IP
+.IP \fBpath\fR
The source should be interpreted as a path to an arbitrary
file. The type of the file will be examined and the resulting image
will be the system icon for files of that type.
-.IP
-\fBfiletype\fR
-.IP
+.IP \fBfiletype\fR
The source is interpreted as a string identifying a
particular file type. It may be a filename extension, an Apple Uniform Type
Identifier or a 4-character OSType value as used in the HFS filesystem.
+.RE
+.\" OPTION: -width
.TP
-\fB\-width\fR
+\fB\-width\fI pixels\fR
.PP
The value of the \fIwidth\fR option is an integer specifying the width
in pixels of the nsimage. If the width is not specified it will be
computed from the height so as to preserve the aspect ration. If
neither width nor height are specified then the width and height of
the underlying NSImage will be used.
+.\" OPTION: -height
.TP
-\fB\-height\fR
+\fB\-height\fI pixels\fR
.PP
The value of the \fIheight\fR option is an integer specifying the
height in pixels of the nsimage. If the height is not specified it
will be computed from the height so as to preserve the aspect ration.
If neither width nor height are specified then the width and height of
the underlying NSImage will be used.
+.\" OPTION: -radius
.TP
-\fB\-radius\fR
+\fB\-radius\fI pixels\fR
.PP
The value of the \fIradius\fR option is an integer. If non-zero the
image will be clipped to a rounded rectangle with the same width and
height as the image, but with circular arcs of the specified radius
cutting off the corners of the rectangle.
+.\" OPTION: -ring
.TP
-\fB\-ring\fR
+\fB\-ring\fI pixels\fR
.PP
The value of the \fIring\fR option is an integer. If non-zero then it
specifies the thickness of a focus ring which will be drawn around the
@@ -95,15 +96,17 @@ Preferences. The image is resized to reduce its width and height by
twice the thickness of the ring. Note that this may create a small
amount of distortion. The aspect ration of a non-square image will
change slightly.
+.\" OPTION: -alpha
.TP
-\fB\-alpha\fR
+\fB\-alpha\fI float\fR
.PP
The value of the \fIalpha\fR option should be a floating point number
between 0.0 and 1.0. This alpha value will be applied to each pixel
of the nsimage, producing a partially transparent image. The default value
-is 1,0, which makes the image opaque.
+is 1.0, which makes the image opaque.
+.\" OPTION: -pressed
.TP
-\fB\-pressed\fR
+\fB\-pressed\fI boolean\fR
.PP
The \fIpressed\fR option takes a boolean value. If the value is true
or 1 then the image will be algorithmically modified to become darker
@@ -111,8 +114,9 @@ in light mode or lighter in dark mode. The default is false. For an
image button, the primary image should use the value false while the
pressed image should be the same image but with the \fIpressed\fR
option set to true.
+.\" OPTION: -template
.TP
-\fB\-template\fR
+\fB\-template\fI boolean\fR
.PP
The \fItemplate\fR option takes a boolean value. If the value is true
or 1 then the image will be marked as being a template image. This
diff --git a/doc/option.n b/doc/option.n
index 6042010..8411ce4 100644
--- a/doc/option.n
+++ b/doc/option.n
@@ -22,8 +22,9 @@ option \- Add/retrieve window options to/from the option database
.SH DESCRIPTION
.PP
The \fBoption\fR command allows you to add entries to the Tk option
-database or to retrieve options from the database. The \fBadd\fR
-form of the command adds a new option to the database.
+database or to retrieve options from the database.
+.\" METHOD: add
+The \fBadd\fR form of the command adds a new option to the database.
\fIPattern\fR contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format (see
@@ -35,6 +36,7 @@ is specified, it indicates the priority level for this option (see
below for legal values); it defaults to \fBinteractive\fR.
This command always returns an empty string.
.PP
+.\" METHOD: clear
The \fBoption clear\fR command clears the option database. Default
options (from the
\fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR
@@ -42,6 +44,7 @@ file) will be reloaded automatically the next time an
option is added to the database or removed from it. This command
always returns an empty string.
.PP
+.\" METHOD: get
The \fBoption get\fR command returns the value of the option
specified for \fIwindow\fR
under \fIname\fR and \fIclass\fR. If several entries in the option
@@ -52,6 +55,7 @@ entries at the same priority level, then it returns whichever entry
was most recently entered into the option database. If there are
no matching entries, then the empty string is returned.
.PP
+.\" METHOD: readfile
The \fBreadfile\fR form of the command reads \fIfileName\fR,
which should have the standard format for an
X resource database such as \fB.Xdefaults\fR, and adds all the
@@ -67,20 +71,16 @@ This cannot be changed, setting the [encoding system] has no effect.
.PP
The \fIpriority\fR arguments to the \fBoption\fR command are
normally specified symbolically using one of the following values:
-.TP
-\fBwidgetDefault\fR
+.IP \fBwidgetDefault\fR3
Level 20. Used for default values hard-coded into widgets.
-.TP
-\fBstartupFile\fR
+.IP \fBstartupFile\fR
Level 40. Used for options specified in application-specific
startup files.
-.TP
-\fBuserDefault\fR
+.IP \fBuserDefault\fR
Level 60. Used for options specified in user-specific defaults
files, such as \fB.Xdefaults\fR, resource databases loaded into
the X server, or user-specific startup files.
-.TP
-\fBinteractive\fR
+.IP \fBinteractive\fR
Level 80. Used for options specified interactively after the application
starts running. If \fIpriority\fR is not specified, it defaults to
this level.
diff --git a/doc/options.n b/doc/options.n
index 71e4713..41bf565 100644
--- a/doc/options.n
+++ b/doc/options.n
@@ -60,7 +60,7 @@ Specifies foreground color to use when drawing active elements.
See above for definition of active elements.
.OP \-activerelief activeRelief Relief
Specifies the 3-D effect desired for the active item of the widget.
-See the \fB-relief\fR option for details.
+See the \fB\-relief\fR option for details.
.OP \-anchor anchor Anchor
Specifies how the information in a widget (e.g. text or a bitmap)
is to be displayed in the widget.
@@ -292,7 +292,7 @@ The script must return \fB0\fR, \fB1\fR, or an empty string: a
\fB0\fR or \fB1\fR value specifies whether the window will receive
the input focus, and an empty string results in the default decision
described above.
-Note: this interpretation of the option is defined entirely by
+Note that this interpretation of the option is defined entirely by
the Tcl scripts that implement traversal: the widget implementations
ignore the option entirely, so you can change its meaning if you
redefine the keyboard traversal scripts.
diff --git a/doc/pack.n b/doc/pack.n
index cdcfeb8..3956be0 100644
--- a/doc/pack.n
+++ b/doc/pack.n
@@ -23,12 +23,15 @@ The \fBpack\fR command can have any of several forms, depending
on the \fIoption\fR argument:
.TP
\fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
+.
If the first argument to \fBpack\fR is a window name (any value
starting with
.QW . ),
then the command is processed in the same way as \fBpack configure\fR.
+.\" METHOD: configure
.TP
\fBpack configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
+.
The arguments consist of the names of one or more content windows
followed by pairs of arguments that specify how
to manage the content.
@@ -36,80 +39,98 @@ See \fBTHE PACKER ALGORITHM\fR below for details on how the options
are used by the packer.
The following options are supported:
.RS
+.\" OPTION: -after
.TP
\fB\-after \fIother\fR
+.
\fIOther\fR must the name of another window.
Use its container as the container for the content, and insert
the content just after \fIother\fR in the packing order.
+.\" OPTION: -anchor
.TP
\fB\-anchor \fIanchor\fR
+.
\fIAnchor\fR must be a valid anchor position such as \fBn\fR
or \fBsw\fR; it specifies where to position each content in its
parcel.
Defaults to \fBcenter\fR.
+.\" OPTION: -before
.TP
\fB\-before \fIother\fR
+.
\fIOther\fR must the name of another window.
Use its container as the container for the content, and insert
the content just before \fIother\fR in the packing order.
+.\" OPTION: -expand
.TP
\fB\-expand \fIboolean\fR
+.
Specifies whether the content should be expanded to consume
extra space in their container.
\fIBoolean\fR may have any proper boolean value, such as \fB1\fR
or \fBno\fR.
Defaults to 0.
+.\" OPTION: -fill
.TP
\fB\-fill \fIstyle\fR
+.
If a content's parcel is larger than its requested dimensions, this
option may be used to stretch the content.
\fIStyle\fR must have one of the following values:
.RS
-.TP
-\fBnone\fR
+.IP \fBnone\fR
Give the content its requested dimensions plus any internal padding
requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default.
-.TP
-\fBx\fR
+.IP \fBx\fR
Stretch the content horizontally to fill the entire width of its
parcel (except leave external padding as specified by \fB\-padx\fR).
-.TP
-\fBy\fR
+.IP \fBy\fR
Stretch the content vertically to fill the entire height of its
parcel (except leave external padding as specified by \fB\-pady\fR).
-.TP
-\fBboth\fR
+.IP \fBboth\fR
Stretch the content both horizontally and vertically.
.RE
+.\" OPTION: -in
.TP
\fB\-in \fIcontainer\fR
+.
Insert the window at the end of the packing order for the container
window given by \fIcontainer\fR.
+.\" OPTION: -ipadx
.TP
\fB\-ipadx \fIamount\fR
+.
\fIAmount\fR specifies how much horizontal internal padding to
leave on each side of the content.
\fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
It defaults to 0.
+.\" OPTION: -ipady
.TP
\fB\-ipady \fIamount\fR
+.
\fIAmount\fR specifies how much vertical internal padding to
leave on each side of the content.
\fIAmount\fR defaults to 0.
+.\" OPTION: -padx
.TP
\fB\-padx \fIamount\fR
+.
\fIAmount\fR specifies how much horizontal external padding to
leave on each side of the content. \fIAmount\fR may be a list
of two values to specify padding for left and right separately.
\fIAmount\fR defaults to 0.
+.\" OPTION: -pady
.TP
\fB\-pady \fIamount\fR
+.
\fIAmount\fR specifies how much vertical external padding to
leave on each side of the content. \fIAmount\fR may be a list
of two values to specify padding for top and bottom separately.
\fIAmount\fR defaults to 0.
+.\" OPTION: -side
.TP
\fB\-side \fIside\fR
+.
Specifies which side of the container the content will be packed against.
Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR.
Defaults to \fBtop\fR.
@@ -124,29 +145,43 @@ If any of the content are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
than receiving default values.
.RE
+.\" METHOD: content
+.TP
+\fBpack content \fIwindow\fR
+.
+Returns a list of all of the content windows in the packing order for
+\fIwindow\fR. The order of the content windows in the list is the same as
+their order in the packing order.
+If \fIwindow\fR has no content then an empty string is returned.
+.\" METHOD: forget
.TP
\fBpack forget \fIwindow \fR?\fIwindow ...\fR?
+.
Removes each of the \fIwindow\fRs from the packing order for its
container and unmaps their windows.
The content will no longer be managed by the packer.
.RS
.PP
.VS "TIP 518"
-If the last content window of the container becomes unmanaged, this will also send
-the virtual event \fB<<NoManagedChild>>\fR to the container; the container
-may choose to resize itself (or otherwise respond) to such a change.
+If the last content window of the container becomes unmanaged, this will
+also send the virtual event \fB<<NoManagedChild>>\fR to the container; the
+container may choose to resize itself (or otherwise respond) to such a change.
.VE "TIP 518"
.RE
+.\" METHOD: info
.TP
\fBpack info \fIwindow\fR
+.
Returns a list whose elements are the current configuration state of
the window given by \fIwindow\fR in the same option-value form that
might be specified to \fBpack configure\fR.
The first two elements of the list are
.QW "\fB\-in \fIcontainer\fR"
where \fIcontainer\fR is the window's container.
+.\" METHOD: propagate
.TP
\fBpack propagate \fIcontainer\fR ?\fIboolean\fR?
+.
If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
then propagation is enabled for \fIcontainer\fR, which must be a window
name (see \fBGEOMETRY PROPAGATION\fR below).
@@ -157,12 +192,7 @@ If \fIboolean\fR is omitted then the command returns \fB0\fR or
\fB1\fR to indicate whether propagation is currently enabled
for \fIcontainer\fR.
Propagation is enabled by default.
-.TP
-\fBpack content \fIwindow\fR
-Returns a list of all of the content windows in the packing order for \fIwindow\fR.
-The order of the content windows in the list is the same as their order in
-the packing order.
-If \fIwindow\fR has no content then an empty string is returned.
+.\" METHOD: slaves
.TP
\fBpack slaves \fIwindow\fR
.
@@ -273,18 +303,18 @@ the stacking order of either the container or the content.
.PP
.CS
# Make the widgets
-label .t \-text "This widget is at the top" \-bg red
-label .b \-text "This widget is at the bottom" \-bg green
-label .l \-text "Left\enHand\enSide"
-label .r \-text "Right\enHand\enSide"
+label .t -text "This widget is at the top" -bg red
+label .b -text "This widget is at the bottom" -bg green
+label .l -text "Left\enHand\enSide"
+label .r -text "Right\enHand\enSide"
text .mid
\&.mid insert end "This layout is like Java's BorderLayout"
# Lay them out
-\fBpack\fR .t \-side top \-fill x
-\fBpack\fR .b \-side bottom \-fill x
-\fBpack\fR .l \-side left \-fill y
-\fBpack\fR .r \-side right \-fill y
-\fBpack\fR .mid \-expand 1 \-fill both
+\fBpack\fR .t -side top -fill x
+\fBpack\fR .b -side bottom -fill x
+\fBpack\fR .l -side left -fill y
+\fBpack\fR .r -side right -fill y
+\fBpack\fR .mid -expand 1 -fill both
.CE
.SH "SEE ALSO"
grid(n), place(n)
diff --git a/doc/palette.n b/doc/palette.n
index 6a04450..ed0da59 100644
--- a/doc/palette.n
+++ b/doc/palette.n
@@ -11,11 +11,11 @@
.SH NAME
tk_setPalette, tk_bisque \- Modify the Tk color palette
.SH SYNOPSIS
+.nf
\fBtk_setPalette \fIbackground\fR
-.sp
\fBtk_setPalette \fIname value \fR?\fIname value ...\fR?
-.sp
\fBtk_bisque\fR
+.fi
.BE
.SH DESCRIPTION
.PP
diff --git a/doc/panedwindow.n b/doc/panedwindow.n
index cad256a..1d19219 100644
--- a/doc/panedwindow.n
+++ b/doc/panedwindow.n
@@ -12,7 +12,7 @@
.SH NAME
panedwindow \- Create and manipulate 'panedwindow' split container widgets
.SH SYNOPSIS
-\fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR?
+\fBpanedwindow\fI pathName \fR?\fIoptions\fR?
.SO
\-background \-borderwidth \-cursor
\-orient \-relief
@@ -38,17 +38,17 @@ version of the sash is displayed during the resizing to show where the
panes will be resized to when releasing the mouse button. This
.QW ghost
version of the sash is the proxy. It's rendering can be configured
-using the \fB-proxybackground\fR, \fB-proxyborderwidth\fR and
-\fB-proxyrelief\fR options.
+using the \fB\-proxybackground\fR, \fB\-proxyborderwidth\fR and
+\fB\-proxyrelief\fR options.
.OP \-proxybackground proxyBackground ProxyBackground
Background color to use when drawing the proxy. If an empty string, the
-value of the \fB-background\fR option will be used.
+value of the \fB\-background\fR option will be used.
.OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth
Specifies the borderwidth of the proxy. May be any value accepted by
\fBTk_GetPixels\fR.
.OP \-proxyrelief proxyRelief ProxyRelief
Relief to use when drawing the proxy. May be any of the standard Tk
-relief values. If an empty string, the value of the \fB-sashrelief\fR
+relief values. If an empty string, the value of the \fB\-sashrelief\fR
option will be used.
.OP \-sashcursor sashCursor SashCursor
Mouse cursor to use when over a sash. If null,
@@ -98,6 +98,7 @@ following general form:
the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for panedwindow widgets:
+.\" METHOD: add
.TP
\fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption value ...\fR?
.
@@ -106,12 +107,14 @@ The arguments consist of the names of one or more windows
followed by pairs of arguments that specify how to manage the windows.
\fIOption\fR may have any of the values accepted by the
\fBconfigure\fR subcommand.
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
Returns the current value of the configuration option given by
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
\fBpanedwindow\fR command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -126,11 +129,13 @@ one or more \fIoption\-value\fR pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. \fIOption\fR may have
any of the values accepted by the \fBpanedwindow\fR command.
+.\" METHOD: forget
.TP
\fIpathName \fBforget \fIwindow \fR?\fIwindow ...\fR?
.
Remove the pane containing \fIwindow\fR from the panedwindow. All
geometry management options for \fIwindow\fR will be forgotten.
+.\" METHOD: identify
.TP
\fIpathName \fBidentify \fIx y\fR
.
@@ -140,11 +145,13 @@ sash or a sash handle, the result is a two element list containing the
index of the sash or handle, and a word indicating whether it is over
a sash or a handle, such as {0 sash} or {2 handle}. If the point is
over any other part of the panedwindow, the result is an empty list.
+.\" METHOD: panecget
.TP
\fIpathName \fBpanecget \fIwindow option\fR
.
Query a management option for \fIwindow\fR. \fIOption\fR may be any
value allowed by the \fBpaneconfigure\fR subcommand.
+.\" METHOD: paneconfigure
.TP
\fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -160,16 +167,19 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. The following options
are supported:
.RS
+.\" OPTION: -after
.TP
\fB\-after \fIwindow\fR
.
Insert the window after the window specified. \fIwindow\fR should be the
name of a window already managed by \fIpathName\fR.
+.\" OPTION: -before
.TP
\fB\-before \fIwindow\fR
.
Insert the window before the window specified. \fIwindow\fR should be
the name of a window already managed by \fIpathName\fR.
+.\" OPTION: -height
.TP
\fB\-height \fIsize\fR
.
@@ -179,12 +189,14 @@ is an empty string, or if \fB\-height\fR is not specified, then the
height requested internally by the window will be used initially; the
height may later be adjusted by the movement of sashes in the
panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
+.\" OPTION: -hide
.TP
\fB\-hide \fIboolean\fR
.
Controls the visibility of a pane. When the \fIboolean\fR is true
(according to \fBTcl_GetBoolean\fR) the pane will not be visible, but
it will still be maintained in the list of panes.
+.\" OPTION: -minsize
.TP
\fB\-minsize \fIn\fR
.
@@ -193,18 +205,21 @@ Specifies that the size of the window cannot be made less than
paned dimension \(em the x dimension for horizontal panedwindows, the y
dimension for vertical panedwindows. May be any value accepted by
\fBTk_GetPixels\fR.
+.\" OPTION: -padx
.TP
\fB\-padx \fIn\fR
.
Specifies a non-negative value indicating how much extra space to
leave on each side of the window in the X-direction. The value may
have any of the forms accepted by \fBTk_GetPixels\fR.
+.\" OPTION: -pady
.TP
\fB\-pady \fIn\fR
.
Specifies a non-negative value indicating how much extra space to
leave on each side of the window in the Y-direction. The value may
have any of the forms accepted by \fBTk_GetPixels\fR.
+.\" OPTION: -sticky
.TP
\fB\-sticky \fIstyle\fR
.
@@ -219,6 +234,7 @@ will
to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR)
are specified, the window will be stretched to fill the entire height
(or width) of its cavity.
+.\" OPTION: -stretch
.TP
\fB\-stretch \fIwhen\fR
.
@@ -231,29 +247,20 @@ for stretching. The space will be distributed based on each panes
current ratio of the whole. The \fIwhen\fR values have the following
definition:
.RS
-.TP
-\fBalways\fR
-.
+.IP \fBalways\fR
This pane will always stretch.
-.TP
-\fBfirst\fR
-.
+.IP \fBfirst\fR
Only if this pane is the first pane (left-most or top-most) will it
stretch.
-.TP
-\fBlast\fR
-.
+.IP \fBlast\fR
Only if this pane is the last pane (right-most or bottom-most) will it
stretch. This is the default value.
-.TP
-\fBmiddle\fR
-.
+.IP \fBmiddle\fR
Only if this pane is not the first or last pane will it stretch.
-.TP
-\fBnever\fR
-.
+.IP \fBnever\fR
This pane will never stretch.
.RE
+.\" OPTION: -width
.TP
\fB\-width \fIsize\fR
.
@@ -264,10 +271,12 @@ width requested internally by the window will be used initially; the
width may later be adjusted by the movement of sashes in the
panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
.RE
+.\" METHOD: panes
.TP
\fIpathName \fBpanes\fR
.
Returns an ordered list of the widgets managed by \fIpathName\fR.
+.\" METHOD: proxy
.TP
\fIpathName \fBproxy \fR?\fIargs\fR?
.
@@ -289,8 +298,10 @@ Remove the proxy from the display.
.
Place the proxy at the given \fIx\fR and \fIy\fR coordinates.
.RE
+.\" METHOD: sash
.TP
\fIpathName \fBsash \fR?\fIargs\fR?
+.
This command is used to query and change the position of sashes in the
panedwindow. It can take any of the following forms:
.RS
diff --git a/doc/photo.n b/doc/photo.n
index bc97319..676c70e 100644
--- a/doc/photo.n
+++ b/doc/photo.n
@@ -43,10 +43,14 @@ procedural interface. At present, only
.VS 8.6
PNG,
.VE 8.6
-GIF and PPM/PGM formats are supported, but an interface exists to
+GIF, PPM/PGM,
+.VS 8.7
+and (read-only) SVG
+.VE 8.7
+formats are supported, but an interface exists to
allow additional image file formats to be added easily. A photo image
is (semi)transparent if the image data it was obtained from had
-transparency informaton. In regions where no image data has been
+transparency information. In regions where no image data has been
supplied, it is fully transparent. Transparency may also be modified
with the \fBtransparency set\fR subcommand.
.SH "CREATING PHOTOS"
@@ -54,6 +58,7 @@ with the \fBtransparency set\fR subcommand.
Like all images, photos are created using the \fBimage create\fR
command.
Photos support the following \fIoptions\fR:
+.\" OPTION: -data
.TP
\fB\-data \fIstring\fR
.
@@ -68,20 +73,23 @@ format of the string must be one of those for which there is an image
file format handler that will accept string data. If both the
\fB\-data\fR and \fB\-file\fR options are specified, the \fB\-file\fR
option takes precedence.
+.\" OPTION: -format
.TP
\fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?}
.
Specifies the name of the file format for the data specified with the
\fB\-data\fR or \fB\-file\fR option and optional arguments passed to
-the format handler. Note: the value of this option must be a Tcl list.
+the format handler. Note that the value of this option must be a Tcl list.
This means that the braces may be omitted if the argument has only one
word. Also, instead of braces, double quotes may be used for quoting.
+.\" OPTION: -file
.TP
\fB\-file \fIname\fR
.
\fIname\fR gives the name of a file that is to be read to supply data
for the photo image. The file format must be one of those for which
there is an image file format handler that can read data.
+.\" OPTION: -gamma
.TP
\fB\-gamma \fIvalue\fR
.
@@ -94,6 +102,7 @@ The value specified must be greater than zero. The default
value is one (no correction). In general, values greater than one
will make the image lighter, and values less than one will make it
darker.
+.\" OPTION: -height
.TP
\fB\-height \fInumber\fR
.
@@ -102,6 +111,7 @@ primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink vertically to fit the data stored in it.
.VS 8.7
+.\" OPTION: -metadata
.TP
\fB\-metadata \fImetadata\fR
.
@@ -111,6 +121,7 @@ if image data is processed due to a \fB\-file\fR or \fB\-data\fR options
and the driver outputs any metadata keys.
See section \fBMETADATA DICTIONARY\fR below.
.VE 8.7
+.\" OPTION: -palette
.TP
\fB\-palette \fIpalette-spec\fR
.
@@ -123,6 +134,7 @@ numbers separated by slashes (/), specifying the number of shades of
red, green and blue to use, respectively. If the first form (a single
number) is used, the image will be displayed in monochrome (i.e.,
grayscale).
+.\" OPTION: -width
.TP
\fB\-width \fInumber\fR
.
@@ -151,19 +163,23 @@ case the width and/or height, respectively, of the image will not be
changed.
.PP
The following commands are possible for photo images:
+.\" METHOD: blank
.TP
\fIimageName \fBblank\fR
.
Blank the image; that is, set the entire image to have no data, so it
will be displayed as transparent, and the background of whatever
-window it is displayed in will show through. The metadata dict of the image is not changed.
+window it is displayed in will show through. The metadata dict of the
+image is not changed.
+.\" METHOD: cget
.TP
-\fIimageName \fBcget\fR \fIoption\fR
+\fIimageName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the
\fBimage create\fR \fBphoto\fR command.
+.\" METHOD: configure
.TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -180,11 +196,12 @@ this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the
\fBimage create\fR \fBphoto\fR command.
.VS 8.7
-Note: setting the \fB\-metadata\fR option without any other option
+Note that setting the \fB\-metadata\fR option without any other option
will not invoke the image format driver to recreate the bitmap.
.VE 8.7
+.\" METHOD: copy
.TP
-\fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBcopy\fI sourceImage\fR ?\fIoption value(s) ...\fR?
.
Copies a region from the image called \fIsourceImage\fR (which must
be a photo image) to the image called \fIimageName\fR, possibly with
@@ -193,6 +210,7 @@ command copies the whole of \fIsourceImage\fR into \fIimageName\fR,
starting at coordinates (0,0) in \fIimageName\fR. The following
options may be specified:
.RS
+.\" OPTION: -from
.TP
\fB\-from \fIx1 y1 x2 y2\fR
.
@@ -203,6 +221,7 @@ default value is the bottom-right corner of the source image. The
pixels copied will include the left and top edges of the specified
rectangle but not the bottom or right edges. If the \fB\-from\fR
option is not given, the default is the whole source image.
+.\" OPTION: -to
.TP
\fB\-to \fIx1 y1 x2 y2\fR
.
@@ -213,6 +232,7 @@ the default value is (\fIx1,y1\fR) plus the size of the source
region (after subsampling and zooming, if specified). If \fIx2\fR and
\fIy2\fR are specified, the source region will be replicated if
necessary to fill the destination region in a tiled fashion.
+.\" OPTION: -shrink
.TP
\fB\-shrink\fR
.
@@ -221,6 +241,7 @@ necessary, so that the region being copied into is at the bottom-right
corner of the image. This option will not affect the width or height
of the image if the user has specified a non-zero value for the
\fB\-width\fR or \fB\-height\fR configuration option, respectively.
+.\" OPTION: -zoom
.TP
\fB\-zoom \fIx y\fR
.
@@ -230,6 +251,7 @@ is not given, the default value is the same as \fIx\fR. With this
option, each pixel in the source image will be expanded into a block
of \fIx\fR x \fIy\fR pixels in the destination image, all the same
color. \fIx\fR and \fIy\fR must be greater than 0.
+.\" OPTION: -subsample
.TP
\fB\-subsample \fIx y\fR
.
@@ -238,6 +260,7 @@ only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in
the Y direction. Negative values will cause the image to be flipped
about the Y or X axes, respectively. If \fIy\fR is not given, the
default value is the same as \fIx\fR.
+.\" OPTION: -compositingrule
.TP
\fB\-compositingrule \fIrule\fR
.
@@ -250,6 +273,7 @@ is set, the old contents of the destination image are discarded and
the source image is used as-is. The default compositing rule is
\fIoverlay\fR.
.RE
+.\" METHOD: data
.TP
\fIimageName \fBdata\fR ?\fIoption value(s) ...\fR?
.
@@ -257,17 +281,19 @@ Returns image data in the form of a string.
.VS 8.7
The format of the string depends on the format handler. By default, a
human readable format as a list of lists of pixel data is used, other
-formats can be chosen with the \fB-format\fR option.
+formats can be chosen with the \fB\-format\fR option.
See \fBIMAGE FORMATS\fR below for details.
.VE 8.7
The following options may be specified:
.RS
+.\" OPTION: -background
.TP
\fB\-background\fI color\fR
.
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
+.\" OPTION: -format
.TP
\fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?}
.
@@ -283,9 +309,10 @@ per pixel/column) of colors in
.QW \fB#\fIrrggbb\fR
format (see \fBIMAGE FORMATS\fR below).
.VE 8.7
-Note: the value of this option must be a Tcl list.
+Note that the value of this option must be a Tcl list.
This means that the braces may be omitted if the argument has only one
word. Also, instead of braces, double quotes may be used for quoting.
+.\" OPTION: -from
.TP
\fB\-from \fIx1 y1 x2 y2\fR
.
@@ -296,14 +323,16 @@ extends from \fI(x1,y1)\fR to the bottom-right corner of
diagonally opposite corners of the rectangular region, including x1,y1
and excluding x2,y2. The default, if this option is not given, is the
whole image.
+.\" OPTION: -grayscale
.TP
\fB\-grayscale\fR
.
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
.VS 8.7
+.\" OPTION: -metadata
.TP
-\fB\-metadata\fR \fImetadata\fR
+\fB\-metadata\fI metadata\fR
.
Image format handler may use metadata to be included in the returned
data string.
@@ -313,17 +342,19 @@ If no \fB\-metadata\fR option is given, the current metadata of the
image is used.
.VE 8.7
.RE
-\fIimageName \fBget\fR \fIx y\fR ?\fB-withalpha\fR?
+.\" METHOD: get
+.TP
+\fIimageName \fBget\fI x y\fR ?\fB\-withalpha\fR?
.
Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the
image as a list of three integers between 0 and 255, representing the
-red, green and blue components respectively. If the \fB-withalpha\fR
+red, green and blue components respectively. If the \fB\-withalpha\fR
option is specified, the returned list will have a fourth element
representing the alpha value of the pixel as an integer between 0 and
255.
-.VE 8.7
+.\" METHOD: put
.TP
-\fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBput\fI data\fR ?\fIoption value(s) ...\fR?
.
Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR.
.VS 8.7
@@ -334,6 +365,7 @@ See \fBIMAGE FORMATS\fR below for details on formats for image data.
.VE 8.7
The following options may be specified:
.RS
+.\" OPTION: -format
.TP
\fB\-format\fR {\fIformat-name\fR ?\fIoption value ..\fR?}
.
@@ -342,18 +374,20 @@ arguments to be passed to the format handler.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
-Note: the value of this option must be a Tcl list.
+Note that the value of this option must be a Tcl list.
This means that the braces may be omitted if the argument has only one
word. Also, instead of braces, double quotes may be used for quoting.
.VS 8.7
+.\" OPTION: -metadata
.TP
-\fB\-metadata\fR \fImetadata\fR
+\fB\-metadata\fI metadata\fR
.
A specified \fImetadata\fR is passed to the image format driver when interpreting
the data.
-Note: The current metadata of the image is not passed to the format driver
+Note that the current metadata of the image is not passed to the format driver
and is not changed by the command.
.VE 8.7
+.\" OPTION: -to
.TP
\fB\-to \fIx1 y1\fR ?\fIx2 y2\fR?
.
@@ -362,14 +396,15 @@ of the region of \fIimageName\fR into which the image data will be
copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given
and \fIdata\fR is not large enough to cover the rectangle specified by
this option, the image data extracted will be tiled so it covers the
-entire destination rectangle. If the region specified with this opion
+entire destination rectangle. If the region specified with this option
is smaller than the supplied \fIdata\fR, the exceeding data is silently
discarded. Note that if \fIdata\fR specifies a
single color value, then a region extending to the bottom-right corner
represented by (\fIx2\fR,\fIy2\fR) will be filled with that color.
.RE
+.\" METHOD: read
.TP
-\fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBread\fI filename\fR ?\fIoption value(s) ...\fR?
.
Reads image data from the file named \fIfilename\fR into the image.
This command first searches the list of
@@ -378,6 +413,7 @@ in \fIfilename\fR, and then reads the image in \fIfilename\fR into
\fIimageName\fR (the destination image). The following options may be
specified:
.RS
+.\" OPTION: -format
.TP
\fB\-format {\fIformat-name\fR ?\fIoption value ..\fR?}
.
@@ -386,9 +422,10 @@ optionally, additional options to the format handler.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
-Note: the value of this option must be a Tcl list.
+Note that the value of this option must be a Tcl list.
This means that the braces may be omitted if the argument has only one
word. Also, instead of braces, double quotes may be used for quoting.
+.\" OPTION: -from
.TP
\fB\-from \fIx1 y1 x2 y2\fR
.
@@ -400,14 +437,16 @@ specified, they specify diagonally opposite corners or the region.
The default, if this option is not specified, is the whole of the
image in the image file.
.VS 8.7
+.\" OPTION: -metadata
.TP
-\fB\-metadata\fR \fImetadata\fR
+\fB\-metadata\fI metadata\fR
.
A specified \fImetadata\fR is passed to the image format driver when interpreting
the data.
-Note: The current metadata of the image is not passed to the format driver
+Note that the current metadata of the image is not passed to the format driver
and is not changed by the command.
.VE 8.7
+.\" OPTION: -shrink
.TP
\fB\-shrink\fR
.
@@ -417,6 +456,7 @@ is at the bottom-right corner of the \fIimageName\fR. This option
will not affect the width or height of the image if the user has
specified a non-zero value for the \fB\-width\fR or \fB\-height\fR
configuration option, respectively.
+.\" OPTION: -to
.TP
\fB\-to \fIx y\fR
.
@@ -424,6 +464,7 @@ Specifies the coordinates of the top-left corner of the region of
\fIimageName\fR into which data from \fIfilename\fR are to be read.
The default is (0,0).
.RE
+.\" METHOD: redither
.TP
\fIimageName \fBredither\fR
.
@@ -434,45 +475,46 @@ dithered image may not be exactly correct. Normally the difference is
not noticeable, but if it is a problem, this command can be used to
recalculate the dithered image in each window where the image is
displayed.
+.\" METHOD: transparency
.TP
\fIimageName \fBtransparency \fIsubcommand \fR?\fIarg ...\fR?
.
Allows examination and manipulation of the transparency information in
the photo image. Several subcommands are available:
.RS
-.VS 8.7
.TP
-\fIimageName \fBtransparency get \fIx y\fR ?\fB-alpha\fR?
-.
+\fIimageName \fBtransparency get \fIx y\fR ?\fB\-alpha\fR?
+.VS 8.7
Returns true if the pixel at (\fIx\fR,\fIy\fR) is fully transparent,
-false otherwise. If the option \fB-alpha\fR is passed, returns the
+false otherwise. If the option \fB\-alpha\fR is passed, returns the
alpha value of the pixel instead, as an integer in the range 0 to 255.
.VE 8.7
-
-.VS 8.7
.TP
-\fIimageName \fBtransparency set \fIx y\fR \fInewVal\fR ?\fB-alpha\fR?
-.
+\fIimageName \fBtransparency set \fIx y newVal\fR ?\fB\-alpha\fR?
+.VS 8.7
Change the transparency of the pixel at (\fIx\fR,\fIy\fR) to
\fInewVal.\fR If no additional option is passed, \fInewVal\fR is
interpreted as a boolean and the pixel is made fully transparent if
-that value is true, fully opaque otherwise. If the \fB-alpha\fR
+that value is true, fully opaque otherwise. If the \fB\-alpha\fR
option is passed, \fInewVal\fR is interpreted as an integral alpha
value for the pixel, which must be in the range 0 to 255.
.VE 8.7
.RE
+.\" METHOD: write
.TP
\fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR?
.
Writes image data from \fIimageName\fR to a file named \fIfilename\fR.
The following options may be specified:
.RS
+.\" OPTION: -background
.TP
\fB\-background\fI color\fR
.
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
+.\" OPTION: -format
.TP
\fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?}
.
@@ -484,9 +526,10 @@ and which has the capability to write an image file. If this option
is not given, the format is guessed from the file extension. If that
cannot be determined, this subcommand uses the first handler that has
the capability to write an image file.
-Note: the value of this option must be a Tcl list.
+Note that the value of this option must be a Tcl list.
This means that the braces may be omitted if the argument has only one
word. Also, instead of braces, double quotes may be used for quoting.
+.\" OPTION: -from
.TP
\fB\-from \fIx1 y1 x2 y2\fR
.
@@ -496,14 +539,16 @@ extends from \fI(x1,y1)\fR to the bottom-right corner of
\fIimageName\fR. If all four coordinates are given, they specify
diagonally opposite corners of the rectangular region. The default,
if this option is not given, is the whole image.
+.\" OPTION: -grayscale
.TP
\fB\-grayscale\fR
.
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
.VS 8.7
+.\" OPTION: -metadata
.TP
-\fB\-metadata\fR \fBmetadata\fR
+\fB\-metadata\fI metadata\fR
.
Image format handler may use metadata to be included in the written file.
The specified \fImetadata\fR is passed to the driver for inclusion in the
@@ -518,8 +563,8 @@ The photo image code is structured to allow handlers for additional
image file formats to be added easily. The photo image code maintains
a list of these handlers. Handlers are added to the list by
registering them with a call to \fBTk_CreatePhotoImageFormat\fR. The
-standard Tk distribution comes with handlers for PPM/PGM, PNG and GIF
-formats,
+standard Tk distribution comes with handlers for PPM/PGM, PNG, GIF and
+(read-only) SVG formats,
.VS 8.7
as well as the \fBdefault\fR handler to encode/decode image
data in a human readable form.
@@ -555,7 +600,7 @@ from/to a file. Its sole purpose is to encode and decode image data in
string form in a clear text, human readable, form. The \fIimageName\fR
\fBdata\fR subcommand uses this handler when no other format is
specified. When reading image data from a string with \fIimageName\fR
-\fBput\fR or the \fB-data\fR option, the default handler is treated
+\fBput\fR or the \fB\-data\fR option, the default handler is treated
as the other handlers.
.PP
Image data in the \fBdefault\fR string format is a (top-to-bottom)
@@ -568,24 +613,26 @@ the forms described in the \fBCOLOR FORMATS\fR section below.
.SS "FORMAT SUBOPTIONS"
.PP
.VS 8.6
-Image formats may support sub-options, wich ahre specified using
+Image formats may support sub-options, which are specified using
additional words in the value to the \fB\-format\fR option. These
suboptions can affect how image data is read or written to file or
string. The nature and values of these options is up to the format
handler.
The built-in handlers support these suboptions:
+.\" OPTION -colorformat
.VS 8.7
.TP
\fBdefault \-colorformat\fI formatType\fR
.
The option is allowed when writing image data to a string with
-\fIimageName\fR \fBdata\fR. Specifies the format to use for the color
+\fIimageName \fBdata\fR. Specifies the format to use for the color
string of each pixel. \fIformatType\fR may be one of: \fBrgb\fR to
encode pixel data in the form \fB#\fIRRGGBB\fR, \fBrgba\fR to encode
pixel data in the form \fB#\fIRRGGBBAA\fR or \fBlist\fR to encode
pixel data as a list with four elements. See \fBCOLOR FORMATS\fR
below for details. The default is \fBrgb\fR.
.VE 8.7
+.\" OPTION -index
.TP
\fBgif \-index\fI indexValue\fR
.
@@ -594,6 +641,7 @@ parsing a multi-part GIF image, Tk normally only accesses the first
image. By giving the \fB\-index\fR sub-option, the \fIindexValue\fR'th
value may be used instead. The \fIindexValue\fR must be an integer
from 0 up to the number of image parts in the GIF data.
+.\" OPTION -alpha
.TP
\fBpng \-alpha\fI alphaValue\fR
.
@@ -602,48 +650,73 @@ an additional alpha filtering for the overall image, which allows the
background on which the image is displayed to show through. This
usually also has the effect of desaturating the image. The
\fIalphaValue\fR must be between 0.0 and 1.0.
+.\" OPTION -dpi
+.\" OPTION -scale
+.\" OPTION -scaletowidth
+.\" OPTION -scaletoheight
.TP
-\fBsvg \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-scaletowidth \fI width\fB \-scaletoheight\fI height\fR
+\fBsvg \-dpi\fI dpiValue \fB\-scale\fI scaleValue \fB\-scaletowidth\fI width \fB\-scaletoheight\fI height\fR
.
\fIdpiValue\fR is used in conversion between given coordinates and
screen resolution. The value must be greater than 0 and the default
value is 96.
+.PP
+.RS
\fIscaleValue\fR is used to scale the resulting image. The value must
be greater than 0 and the default value is 1.
\fIwidth\fR and \fIheight\fR are the width or height that the image
will be adjusted to. Only one parameter among \fB\-scale\fR,
\fB\-scaletowidth\fR and \fB\-scaletoheight\fR can be given at a time
and the aspect ratio of the original image is always preserved.
-The svg format supports a wide range of SVG features, but the
+The \fBsvg\fR format supports a wide range of SVG features, but the
full SVG standard is not available, for instance the 'text' feature
is missing and silently ignored when reading the SVG data.
The supported SVG features are:
+.TP
+\fBelements:\fR
.
-.RS
-\fB elements:\fR g, path, rect, circle, ellipse, line, polyline, polygon,
+g, path, rect, circle, ellipse, line, polyline, polygon,
linearGradient, radialGradient, stop, defs, svg, style
-.PP
-\fB attributes:\fR width, height, viewBox,
+.TP
+\fBattributes:\fR
+.
+width, height, viewBox,
preserveAspectRatio with none, xMin, xMid, xMax, yMin, yMid, yMax, slice
-.PP
-\fB gradient attributes:\fR gradientUnits with objectBoundingBox,
+.TP
+\fBgradient attributes:\fR
+.
+gradientUnits with objectBoundingBox,
gradientTransform, cx, cy, r fx, fy x1, y1, x2, y2
spreadMethod with pad, reflect or repeat,
xlink:href
-.PP
-\fB poly attributes: \fR points
-.PP
-\fB line attributes: \fR x1, y1, x2, y2
-.PP
-\fB ellipse attributes: \fR cx, cy, rx, ry
-.PP
-\fB circle attributes: \fR cx, cy, r
-.PP
-\fB rectangle attributes: \fR x, y, width, height, rx, ry
-.PP
-\fB path attributes: \fR d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z
-.PP
-\fB style attributes: \fR display with none, visibility, hidden, visible,
+.TP
+\fBpoly attributes:\fR
+.
+points
+.TP
+\fBline attributes:\fR
+.
+x1, y1, x2, y2
+.TP
+\fBellipse attributes:\fR
+.
+cx, cy, rx, ry
+.TP
+\fBcircle attributes:\fR
+.
+cx, cy, r
+.TP
+\fBrectangle attributes:\fR
+.
+x, y, width, height, rx, ry
+.TP
+\fBpath attributes:\fR
+.
+d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z
+.TP
+\fBstyle attributes:\fR
+.
+display with none, visibility, hidden, visible,
fill with nonzero and evenodd, opacity, fill-opacity,
stroke, stroke-width, stroke-dasharray, stroke-dashoffset, stroke-opacity,
stroke-linecap with butt, round and square,
@@ -652,10 +725,12 @@ fill-rule, font-size,
transform with matrix, translate, scale, rotate, skewX and skewY,
stop-color, stop-opacity, offset, id, class
.RE
-.
+.PP
+.RS
Currently only SVG images reading and conversion into (pixel-based
format) photos is supported: Tk does not (yet) support bundling photo
images in SVG vector graphics.
+.RE
.VE 8.6
.VS 8.7
.SH "COLOR FORMATS"
@@ -746,46 +821,42 @@ parsed, or may use metadata to be included in image files or formats.
.PP
Each image format driver supports an individual set of metadata dictionary
keys. Predefined keys are:
-.TP
-DPI
-.
+.IP \fBDPI\fR
Horizontal image resolution in DPI as a double value.
Supported by format \fBpng\fR.
-.TP
-aspect
-.
+.IP \fBaspect\fR
Aspect ratio horizontal divided by vertical as double value.
Supported by formats \fBgif\fR and \fBpng\fR.
-.TP
-comment
-.
+.IP \fBcomment\fR
Image text comment.
Supported by formats \fBgif\fR and \fBpng\fR.
.PP
It is valid to set any key in the metadata dict.
-A format driver will ignore keys it does not handle.
+A format driver will ignore keys that it does not handle.
.SS "METADATA KEYS FOR ANIMATED GIF INFORMATION"
.PP
The following metadata keys are reported when reading a \fBgif\fR format file.
-They are typically used in conjunction with the \fI-index\fR option of an
+They are typically used in conjunction with the \fB\-index\fR option of an
animated \fBgif\fR file to properly display the subimage sequence.
-The options are linked to each subimage selected by \fI-index\fR.
+The options are linked to each subimage selected by \fB\-index\fR.
.TP
-\fBdelay time\fR \fItime\fR
+\fBdelay time\fI time\fR
.
-Update delay time in 10ms unit. This key is only present, if delay time is not 0.
+Update delay time in 10ms units.
+This key is only present if the delay time is not 0.
.TP
-\fBdisposal method\fR \fImethod\fR
+\fBdisposal method\fI method\fR
.
Disposal method of the preceeding image, if given for the current image.
-Possible values are: \fIdo not dispose\fR, \fIrestore to background color\fR, \fIrestore to previous\fR.
+Possible values are: \fBdo not dispose\fR, \fBrestore to background color\fR,
+\fBrestore to previous\fR.
.TP
-\fBuser interaction\fR \fIbool\fR
+\fBuser interaction\fI bool\fR
.
The key is present with a value of 1, if user interaction is specified.
Otherwise, the key is not present.
.TP
-\fBupdate region\fR \fIX0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR
+\fBupdate region\fI X0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR
.
Update region of the current subimage, if subimage has not the same size as
the full image. The pixel outside of this box are all fully transparent.
@@ -803,14 +874,14 @@ is useful for producing a tiled background:
.PP
.CS
# These lines should be called once
-\fBimage create photo\fR untiled \-file "theFile.ppm"
+\fBimage create photo\fR untiled -file "theFile.ppm"
\fBimage create photo\fR tiled
# These lines should be called whenever .someWidget changes
# size; a <Configure> binding is useful here
set width [winfo width .someWidget]
set height [winfo height .someWidget]
-tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink
+tiled \fBcopy\fR untiled -to 0 0 $width $height -shrink
.CE
.PP
.VS 8.6
@@ -819,10 +890,10 @@ during loading, which is useful for generating images suitable for disabled
buttons:
.PP
.CS
-\fBimage create photo\fR icon \-file "icon.png"
-\fBimage create photo\fR iconDisabled \-file "icon.png" \e
- \-format "png \-alpha 0.5"
-button .b \-image icon \-disabledimage iconDisabled
+\fBimage create photo\fR icon -file "icon.png"
+\fBimage create photo\fR iconDisabled -file "icon.png" \e
+ -format "png -alpha 0.5"
+button .b -image icon -disabledimage iconDisabled
.CE
.VE 8.6
.PP
diff --git a/doc/place.n b/doc/place.n
index b56ad58..22e9699 100644
--- a/doc/place.n
+++ b/doc/place.n
@@ -30,13 +30,16 @@ centered inside the container.
.PP
.TP
\fBplace \fIwindow option value \fR?\fIoption value ...\fR?
+.
Arrange for the placer to manage the geometry of a content whose
pathName is \fIwindow\fR. The remaining arguments consist of one or
more \fIoption\-value\fR pairs that specify the way in which
\fIwindow\fR's geometry is managed. \fIOption\fR may have any of the
values accepted by the \fBplace configure\fR command.
+.\" METHOD: configure
.TP
\fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the geometry options of the content given by
\fIwindow\fR. If no \fIoption\fR is specified, this command returns a
list describing the available options (see \fBTk_ConfigureInfo\fR for
@@ -50,8 +53,10 @@ the command returns an empty string.
.RS
.PP
The following \fIoption\-value\fR pairs are supported:
+.\" OPTION: -anchor
.TP
\fB\-anchor \fIwhere\fR
+.
\fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
\fB\-relx\fR, and \fB\-rely\fR options.
@@ -61,8 +66,10 @@ Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
\fIwindow\fR's border will appear at the given (x,y) location
in the container.
The anchor position defaults to \fBnw\fR.
+.\" OPTION: -bordermode
.TP
\fB\-bordermode \fImode\fR
+.
\fIMode\fR determines the degree to which borders within the
container are used in determining the placement of the content.
The default and most common value is \fBinside\fR.
@@ -84,8 +91,10 @@ to be its official X area, which includes any internal border but
no external border. A bordermode of \fBignore\fR is probably
not very useful.
.RE
+.\" OPTION: -height
.TP
\fB\-height \fIsize\fR
+.
\fISize\fR specifies the height for \fIwindow\fR in screen units
(i.e. any of the forms accepted by \fBTk_GetPixels\fR).
The height will be the outer dimension of \fIwindow\fR including its
@@ -93,8 +102,10 @@ border, if any.
If \fIsize\fR is an empty string, or if no \fB\-height\fR or
\fB\-relheight\fR option is specified, then the height requested
internally by the window will be used.
+.\" OPTION: -in
.TP
\fB\-in \fIcontainer\fR
+.
\fIContainer\fR specifies the path name of the window relative
to which \fIwindow\fR is to be placed.
\fIContainer\fR must either be \fIwindow\fR's parent or a descendant
@@ -105,8 +116,10 @@ These restrictions are necessary to guarantee
that \fIwindow\fR is visible whenever \fIcontainer\fR is visible.
If this option is not specified then the other window defaults to
\fIwindow\fR's parent.
+.\" OPTION: -relheight
.TP
\fB\-relheight \fIsize\fR
+.
\fISize\fR specifies the height for \fIwindow\fR.
In this case the height is specified as a floating-point number
relative to the height of the container: 0.5 means \fIwindow\fR will
@@ -115,8 +128,10 @@ the same height as the container, and so on.
If both \fB\-height\fR and \fB\-relheight\fR are specified for a content,
their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR
makes the content 2 pixels shorter than the container.
+.\" OPTION: -relwidth
.TP
\fB\-relwidth \fIsize\fR
+.
\fISize\fR specifies the width for \fIwindow\fR.
In this case the width is specified as a floating-point number
relative to the width of the container: 0.5 means \fIwindow\fR will
@@ -125,8 +140,10 @@ the same width as the container, and so on.
If both \fB\-width\fR and \fB\-relwidth\fR are specified for a content,
their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR
makes the content 5 pixels wider than the container.
+.\" OPTION: -relx
.TP
\fB\-relx \fIlocation\fR
+.
\fILocation\fR specifies the x-coordinate within the container window
of the anchor point for \fIwindow\fR.
In this case the location is specified in a relative fashion
@@ -137,8 +154,10 @@ If both \fB\-x\fR and \fB\-relx\fR are specified for a content
then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR
positions the left edge of the content 2 pixels to the left of the
center of its container.
+.\" OPTION: -rely
.TP
\fB\-rely \fIlocation\fR
+.
\fILocation\fR specifies the y-coordinate within the container window
of the anchor point for \fIwindow\fR.
In this case the value is specified in a relative fashion
@@ -149,8 +168,10 @@ If both \fB\-y\fR and \fB\-rely\fR are specified for a content
then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR
positions the top edge of the content 3 pixels below the
center of its container.
+.\" OPTION: -width
.TP
\fB\-width \fIsize\fR
+.
\fISize\fR specifies the width for \fIwindow\fR in screen units
(i.e. any of the forms accepted by \fBTk_GetPixels\fR).
The width will be the outer width of \fIwindow\fR including its
@@ -158,15 +179,19 @@ border, if any.
If \fIsize\fR is an empty string, or if no \fB\-width\fR
or \fB\-relwidth\fR option is specified, then the width requested
internally by the window will be used.
+.\" OPTION: -x
.TP
\fB\-x \fIlocation\fR
+.
\fILocation\fR specifies the x-coordinate within the container window
of the anchor point for \fIwindow\fR.
The location is specified in screen units (i.e. any of the forms
accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
of the container window.
+.\" OPTION: -y
.TP
\fB\-y \fIlocation\fR
+.
\fILocation\fR specifies the y-coordinate within the container window
of the anchor point for \fIwindow\fR.
The location is specified in screen units (i.e. any of the forms
@@ -177,23 +202,31 @@ If the same value is specified separately with
two different options, such as \fB\-x\fR and \fB\-relx\fR, then
the most recent option is used and the older one is ignored.
.RE
+.\" METHOD: content
+.TP
+\fBplace content \fIwindow\fR
+.
+Returns a list of all the content windows for which \fIwindow\fR is the
+container. If there is no content for \fIwindow\fR then an empty string
+is returned.
+.\" METHOD: forget
.TP
\fBplace forget \fIwindow\fR
+.
Causes the placer to stop managing the geometry of \fIwindow\fR. As a
side effect of this command \fIwindow\fR will be unmapped so that it
does not appear on the screen. If \fIwindow\fR is not currently managed
by the placer then the command has no effect. This command returns an
empty string.
+.\" METHOD: info
.TP
\fBplace info \fIwindow\fR
+.
Returns a list giving the current configuration of \fIwindow\fR.
The list consists of \fIoption\-value\fR pairs in exactly the
same form as might be specified to the \fBplace configure\fR
command.
-.TP
-\fBplace content \fIwindow\fR
-Returns a list of all the content windows for which \fIwindow\fR is the container.
-If there is no content for \fIwindow\fR then an empty string is returned.
+.\" METHOD: slaves
.TP
\fBplace slaves \fIwindow\fR
.
@@ -247,13 +280,14 @@ frames and canvases that provide configuration options for this purpose.
Make the label occupy the middle bit of the toplevel, no matter how it
is resized:
.CS
-label .l \-text "In the\enMiddle!" \-bg black \-fg white
-\fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35
+label .l -text "In the\enMiddle!" -bg black -fg white
+\fBplace\fR .l -relwidth .3 -relx .35 -relheight .3 -rely .35
.CE
.SH "SEE ALSO"
grid(n), pack(n)
.SH KEYWORDS
-geometry manager, height, location, container, place, rubber sheet, content, width
+geometry manager, height, location, container, place, rubber sheet,
+content, width
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/doc/popup.n b/doc/popup.n
index 9543750..ca9d485 100644
--- a/doc/popup.n
+++ b/doc/popup.n
@@ -31,11 +31,11 @@ How to attach a simple popup menu to a widget.
.CS
# Create a menu
set m [menu .popupMenu]
-$m add command \-label "Example 1" \-command bell
-$m add command \-label "Example 2" \-command bell
+$m add command -label "Example 1" -command bell
+$m add command -label "Example 2" -command bell
# Create something to attach it to
-pack [label .l \-text "Click me!"]
+pack [label .l -text "Click me!"]
# Arrange for the menu to pop up when the label is clicked
bind .l <Button-1> {\fBtk_popup\fR .popupMenu %X %Y}
diff --git a/doc/radiobutton.n b/doc/radiobutton.n
index 2169515..b51a7e6 100644
--- a/doc/radiobutton.n
+++ b/doc/radiobutton.n
@@ -12,7 +12,7 @@
.SH NAME
radiobutton \- Create and manipulate 'radiobutton' pick-one widgets
.SH SYNOPSIS
-\fBradiobutton\fR \fIpathName \fR?\fIoptions\fR?
+\fBradiobutton\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-disabledforeground \-padx
\-activeforeground \-font \-pady
@@ -65,8 +65,8 @@ The empty string is the default value.
Specifies a background color to use when the button is selected.
If \fBindicatorOn\fR is true then the color is used as the background for
the indicator regardless of the select state.
-If \fB\-indicatoron\fR is false, this color is used as the background
-for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR,
+If \fB\-indicatoron\fR is false, this color is used as the background for the
+entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
@@ -181,13 +181,15 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for radiobutton widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBradiobutton\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -203,6 +205,7 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBradiobutton\fR
command.
+.\" METHOD: deselect
.TP
\fIpathName \fBdeselect\fR
.
@@ -210,6 +213,7 @@ Deselects the radiobutton and sets the associated variable to an
empty string.
If this radiobutton was not currently selected, the command has
no effect.
+.\" METHOD: flash
.TP
\fIpathName \fBflash\fR
.
@@ -218,6 +222,7 @@ several times, alternating between active and normal colors. At
the end of the flash the radiobutton is left in the same normal/active
state as when the command was invoked.
This command is ignored if the radiobutton's state is \fBdisabled\fR.
+.\" METHOD: invoke
.TP
\fIpathName \fBinvoke\fR
.
@@ -227,6 +232,7 @@ its associated Tcl command, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the radiobutton.
This command is ignored if the radiobutton's state is \fBdisabled\fR.
+.\" METHOD: select
.TP
\fIpathName \fBselect\fR
.
@@ -257,7 +263,8 @@ actions occur: the radiobutton is completely non-responsive.
The behavior of radiobuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH "SEE ALSO"
-checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n)
+checkbutton(n), labelframe(n), listbox(n), options(n), scale(n),
+ttk::radiobutton(n)
.SH KEYWORDS
radiobutton, widget
'\" Local Variables:
diff --git a/doc/raise.n b/doc/raise.n
index 7741001..752bcd6 100644
--- a/doc/raise.n
+++ b/doc/raise.n
@@ -41,11 +41,11 @@ it. This is is often necessary when building GUIs in the style where
you create your activity widgets first before laying them out on the
display:
.CS
-button .b \-text "Hi there!"
-pack [frame .f \-background blue]
-pack [label .f.l1 \-text "This is above"]
-pack .b \-in .f
-pack [label .f.l2 \-text "This is below"]
+button .b -text "Hi there!"
+pack [frame .f -background blue]
+pack [label .f.l1 -text "This is above"]
+pack .b -in .f
+pack [label .f.l2 -text "This is below"]
\fBraise\fR .b
.CE
.SH "SEE ALSO"
diff --git a/doc/scale.n b/doc/scale.n
index 86abdec..b73bd7f 100644
--- a/doc/scale.n
+++ b/doc/scale.n
@@ -12,7 +12,7 @@
.SH NAME
scale \- Create and manipulate 'scale' value-controlled slider widgets
.SH SYNOPSIS
-\fBscale\fR \fIpathName \fR?\fIoptions\fR?
+\fBscale\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-foreground \-relief
\-background \-highlightbackground \-repeatdelay
@@ -78,7 +78,9 @@ specified by the \fB\-activebackground\fR option.
.OP \-tickinterval tickInterval TickInterval
Must be a real value.
Determines the spacing between numerical
-tick marks displayed below or to the left of the slider. The values will all be displayed with the same number of decimal places, which will be enough to ensure they are all accurate to within 20% of a tick interval.
+tick marks displayed below or to the left of the slider. The values will all
+be displayed with the same number of decimal places, which will be enough to
+ensure they are all accurate to within 20% of a tick interval.
If 0, no tick marks will be displayed.
.OP \-to to To
Specifies a real value corresponding
@@ -143,13 +145,15 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for scale widgets:
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBscale\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -165,6 +169,7 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBscale\fR
command.
+.\" METHOD: coords
.TP
\fIpathName \fBcoords \fR?\fIvalue\fR?
.
@@ -172,6 +177,7 @@ Returns a list whose elements are the x and y coordinates of
the point along the centerline of the trough that corresponds
to \fIvalue\fR.
If \fIvalue\fR is omitted then the scale's current value is used.
+.\" METHOD: get
.TP
\fIpathName \fBget\fR ?\fIx y\fR?
.
@@ -181,6 +187,7 @@ pixel coordinates within the widget; the command returns
the scale value corresponding to the given pixel.
Only one of \fIx\fR or \fIy\fR is used: for horizontal scales
\fIy\fR is ignored, and for vertical scales \fIx\fR is ignored.
+.\" METHOD: identify
.TP
\fIpathName \fBidentify \fIx y\fR
.
@@ -193,6 +200,7 @@ and \fBtrough2\fR means that the point is over the portion
of the slider below or to the right of the slider.
If the point is not over one of these elements, an empty string
is returned.
+.\" METHOD: set
.TP
\fIpathName \fBset \fIvalue\fR
.
diff --git a/doc/scrollbar.n b/doc/scrollbar.n
index ee6f6dd..b7e177e 100644
--- a/doc/scrollbar.n
+++ b/doc/scrollbar.n
@@ -12,7 +12,7 @@
.SH NAME
scrollbar \- Create and manipulate 'scrollbar' scrolling control and indicator widgets
.SH SYNOPSIS
-\fBscrollbar\fR \fIpathName \fR?\fIoptions\fR?
+\fBscrollbar\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-highlightcolor \-repeatdelay
\-background \-highlightthickness \-repeatinterval
@@ -42,7 +42,7 @@ as described in \fBSCROLLING COMMANDS\fR below.
Specifies the width of borders drawn around the internal elements
of the scrollbar (the two arrows and the slider). The value may
have any of the forms acceptable to \fBTk_GetPixels\fR.
-If this value is negative (the default is -1), the value of
+If this value is the empty string (the default), the value of
the \fB\-borderwidth\fR option is used in its place.
.OP \-width width Width
Specifies the desired narrow dimension of the scrollbar window,
@@ -81,20 +81,15 @@ below for details.
.PP
A scrollbar displays five elements, which are referred to in the
widget commands for the scrollbar:
-.TP 10
-\fBarrow1\fR
+.IP \fBarrow1\fR 10
The top or left arrow in the scrollbar.
-.TP 10
-\fBtrough1\fR
+.IP \fBtrough1\fR 10
The region between the slider and \fBarrow1\fR.
-.TP 10
-\fBslider\fR
+.IP \fBslider\fR 10
The rectangle that indicates what is visible in the associated widget.
-.TP 10
-\fBtrough2\fR
+.IP \fBtrough2\fR 10
The region between the slider and \fBarrow2\fR.
-.TP 10
-\fBarrow2\fR
+.IP \fBarrow2\fR 10
The bottom or right arrow in the scrollbar.
.SH "WIDGET COMMAND"
.PP
@@ -108,6 +103,7 @@ operations on the widget. It has the following general form:
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for scrollbar widgets:
+.\" METHOD: activate
.TP
\fIpathName \fBactivate \fR?\fIelement\fR?
.
@@ -121,6 +117,7 @@ will be active.
If \fIelement\fR is not specified, the command returns
the name of the element that is currently active, or an empty string
if no element is active.
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
@@ -128,6 +125,7 @@ Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBscrollbar\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -143,6 +141,7 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBscrollbar\fR
command.
+.\" METHOD: delta
.TP
\fIpathName \fBdelta \fIdeltaX deltaY\fR
.
@@ -155,6 +154,7 @@ ignored in this case).
If the scrollbar is vertical, the result indicates how much the
scrollbar setting must change to move the slider \fIdeltaY\fR pixels
down. The arguments and the result may be zero or negative.
+.\" METHOD: fraction
.TP
\fIpathName \fBfraction \fIx y\fR
.
@@ -167,11 +167,13 @@ the middle, and so on.
widget.
If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest
point in the trough is used.
+.\" METHOD: get
.TP
\fIpathName \fBget\fR
.
Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent \fBset\fR widget command.
+.\" METHOD: identify
.TP
\fIpathName \fBidentify \fIx y\fR
.
@@ -180,6 +182,7 @@ Returns the name of the element under the point given by \fIx\fR and
not lie in any element of the scrollbar.
\fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar
widget.
+.\" METHOD: set
.TP
\fIpathName \fBset \fIfirst last\fR
.
@@ -204,6 +207,7 @@ The command may take any of the following forms.
In each case, \fIprefix\fR is the contents of the
\fB\-command\fR option, which usually has a form like
.QW "\fB.t yview\fR" .
+.\" METHOD: moveto
.TP
\fIprefix \fBmoveto \fIfraction\fR
.
@@ -214,6 +218,7 @@ If \fIfraction\fR is 0 it refers to the beginning of the
document. 1.0 refers to the end of the document, 0.333
refers to a point one-third of the way through the document,
and so on.
+.\" METHOD: scroll
.TP
\fIprefix \fBscroll \fInumber \fBpages\fR
.
@@ -308,11 +313,11 @@ The End key adjusts the view to the bottom (right edge) of the document.
Create a window with a scrollable \fBtext\fR widget:
.CS
toplevel .tl
-text .tl.t \-yscrollcommand {.tl.s set}
-\fBscrollbar\fR .tl.s \-command {.tl.t yview}
-grid .tl.t .tl.s \-sticky nsew
-grid columnconfigure .tl 0 \-weight 1
-grid rowconfigure .tl 0 \-weight 1
+text .tl.t -yscrollcommand {.tl.s set}
+\fBscrollbar\fR .tl.s -command {.tl.t yview}
+grid .tl.t .tl.s -sticky nsew
+grid columnconfigure .tl 0 -weight 1
+grid rowconfigure .tl 0 -weight 1
.CE
.SH "SEE ALSO"
ttk:scrollbar(n)
diff --git a/doc/selection.n b/doc/selection.n
index a26c5d9..2f51d51 100644
--- a/doc/selection.n
+++ b/doc/selection.n
@@ -26,8 +26,9 @@ Note that for management of the \fBCLIPBOARD\fR selection (see below), the
The first argument to \fBselection\fR determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
+.\" METHOD: clear
.TP
-\fBselection clear\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR?
+\fBselection clear\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR?
.
If \fIselection\fR exists anywhere on \fIwindow\fR's display, clear it
so that no window owns the selection anymore. \fISelection\fR
@@ -37,8 +38,9 @@ Communication Conventions Manual for complete details.
\fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to
.QW . .
Returns an empty string.
+.\" METHOD: get
.TP
-\fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR?
+\fBselection get\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? ?\fB\-type\fI type\fR?
.
Retrieves the value of \fIselection\fR from \fIwindow\fR's display and
returns it as a result. \fISelection\fR defaults to \fBPRIMARY\fR and
@@ -61,8 +63,9 @@ collection of fields separated by spaces: atoms are converted to their
textual names, and anything else is converted to hexadecimal integers.
Note that \fBselection get\fR does not retrieve the selection in the
\fBUTF8_STRING\fR format unless told to.
+.\" METHOD: handle
.TP
-\fBselection handle\fR ?\fB\-selection\fR \fIs\fR? ?\fB\-type\fR \fIt\fR? ?\fB\-format\fR \fIf\fR? \fIwindow command\fR
+\fBselection handle\fR ?\fB\-selection\fI s\fR? ?\fB\-type\fI t\fR? ?\fB\-format\fI f\fR? \fIwindow command\fR
.
Creates a handler for selection requests, such that \fIcommand\fR will
be executed whenever selection \fIs\fR is owned by \fIwindow\fR and
@@ -119,10 +122,11 @@ used to retrieve the selection then the value is converted back to
a string at the requesting end, so \fIformat\fR is
irrelevant.
.RE
+.\" METHOD: own
.TP
-\fBselection own\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR?
+\fBselection own\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR?
.TP
-\fBselection own\fR ?\fB\-command\fR \fIcommand\fR? ?\fB\-selection\fR \fIselection\fR? \fIwindow\fR
+\fBselection own\fR ?\fB\-command\fI command\fR? ?\fB\-selection\fI selection\fR? \fIwindow\fR
.
The first form of \fBselection own\fR returns the path name of the
window in this application that owns \fIselection\fR on the display
@@ -142,23 +146,42 @@ some other window claims ownership of the selection away from
.RE
.SH WIDGET FACILITIES
.PP
-The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a widget has this option set to boolean \fBtrue\fR, then (in an unsafe interpreter) a selection made in the widget is automatically written to the \fBPRIMARY\fR selection.
+The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR
+and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a
+widget has this option set to boolean \fBtrue\fR, then (in an unsafe
+interpreter) a selection made in the widget is automatically written to the
+\fBPRIMARY\fR selection.
.PP
-A GUI event, for example \fB<<PasteSelection>>\fR, can copy the \fBPRIMARY\fR selection to certain widgets. This copy is implemented by a widget binding to the event. The binding script makes appropriate calls to the \fBselection\fR command.
+A GUI event, for example \fB<<PasteSelection>>\fR, can copy the \fBPRIMARY\fR
+selection to certain widgets. This copy is implemented by a widget binding to
+the event. The binding script makes appropriate calls to the \fBselection\fR
+command.
.PP
.SH PORTABILITY ISSUES
.PP
-On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, allowing communication between different processes that are X11 clients.
+On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server,
+allowing communication between different processes that are X11 clients.
.PP
-On Windows, the \fBPRIMARY\fR selection is not provided by the system, but only by Tk, and so it is shared only between windows of a parent interpreter and its child interpreters. It is not shared between interpreters in different processes or different threads. Each parent interpreter has a separate \fBPRIMARY\fR selection that is shared only with its child interpreters which are not safe interpreters.
+On Windows, the \fBPRIMARY\fR selection is not provided by the system, but
+only by Tk, and so it is shared only between windows of a parent interpreter
+and its child interpreters. It is not shared between interpreters in
+different processes or different threads. Each parent interpreter has a
+separate \fBPRIMARY\fR selection that is shared only with its child
+interpreters which are not safe interpreters.
.PP
.SH SECURITY
.PP
-A safe interpreter cannot read from the \fBPRIMARY\fR selection because its \fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR selection cannot be written to the Tk widgets of a safe interpreter.
+A safe interpreter cannot read from the \fBPRIMARY\fR selection because its
+\fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR
+selection cannot be written to the Tk widgets of a safe interpreter.
.PP
-A Tk widget can have its option \fB\-exportselection\fR set to boolean \fBtrue\fR, but in a safe interpreter this option has no effect: writing from the widget to the \fBPRIMARY\fR selection is disabled.
+A Tk widget can have its option \fB\-exportselection\fR set to boolean
+\fBtrue\fR, but in a safe interpreter this option has no effect: writing
+from the widget to the \fBPRIMARY\fR selection is disabled.
.PP
-These are security features. A safe interpreter may run untrusted code, and it is a security risk if this untrusted code can read or write the \fBPRIMARY\fR selection used by other interpreters.
+These are security features. A safe interpreter may run untrusted code, and
+it is a security risk if this untrusted code can read or write the
+\fBPRIMARY\fR selection used by other interpreters.
.PP
.SH EXAMPLES
.PP
@@ -167,14 +190,14 @@ On X11 platforms, one of the standard selections available is the
it using Tk:
.PP
.CS
-set selContents [\fBselection get\fR \-selection SECONDARY]
+set selContents [\fBselection get\fR -selection SECONDARY]
.CE
.PP
Many different types of data may be available for a selection; the
special type \fBTARGETS\fR allows you to get a list of available types:
.PP
.CS
-foreach type [\fBselection get\fR \-type TARGETS] {
+foreach type [\fBselection get\fR -type TARGETS] {
puts "Selection PRIMARY supports type $type"
}
.CE
@@ -184,7 +207,7 @@ data for the selection. Then you have to claim the selection...
.CS
# Set up the data handler ready for incoming requests
set foo "This is a string with some data in it... blah blah"
-\fBselection handle\fR \-selection SECONDARY . getData
+\fBselection handle\fR -selection SECONDARY . getData
proc getData {offset maxChars} {
puts "Retrieving selection starting at $offset"
return [string range $::foo $offset [expr {$offset+$maxChars-1}]]
@@ -192,7 +215,7 @@ proc getData {offset maxChars} {
# Now we grab the selection itself
puts "Claiming selection"
-\fBselection own\fR \-command lost \-selection SECONDARY .
+\fBselection own\fR -command lost -selection SECONDARY .
proc lost {} {
puts "Lost selection"
}
diff --git a/doc/send.n b/doc/send.n
index f200128..943c92f 100644
--- a/doc/send.n
+++ b/doc/send.n
@@ -30,21 +30,27 @@ command to be executed, just as for the \fBeval\fR command.
If the initial arguments of the command begin with
.QW \-
they are treated as options. The following options are currently defined:
+.\" OPTION: -async
.TP
\fB\-async\fR
+.
Requests asynchronous invocation. In this case the \fBsend\fR
command will complete immediately without waiting for \fIcmd\fR
to complete in the target application; no result will be available
and errors in the sent command will be ignored.
If the target application is in the same process as the sending
application then the \fB\-async\fR option is ignored.
+.\" OPTION: -displayof
.TP
-\fB\-displayof\fR \fIpathName\fR
+\fB\-displayof\fI pathName\fR
+.
Specifies that the target application's main window is on the display
of the window given by \fIpathName\fR, instead of the display containing
the application's main window.
+.\" OPTION: --
.TP
\fB\-\|\-\fR
+.
Serves no purpose except to terminate the list of options. This
option is needed only if \fIapp\fR could contain a leading
.QW \-
@@ -90,7 +96,7 @@ This script fragment can be used to make an application that only runs
once on a particular display.
.CS
if {[tk appname FoobarApp] ne "FoobarApp"} {
- \fBsend\fR \-async FoobarApp RemoteStart $argv
+ \fBsend\fR -async FoobarApp RemoteStart $argv
exit
}
# The command that will be called remotely, which raises
diff --git a/doc/spinbox.n b/doc/spinbox.n
index f44d145..b90b822 100644
--- a/doc/spinbox.n
+++ b/doc/spinbox.n
@@ -12,7 +12,7 @@
.SH NAME
spinbox \- Create and manipulate 'spinbox' value spinner widgets
.SH SYNOPSIS
-\fBspinbox\fR \fIpathName \fR?\fIoptions\fR?
+\fBspinbox\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-highlightthickness \-repeatinterval
\-background \-insertbackground \-selectbackground
@@ -168,8 +168,8 @@ The \fB\-validatecommand\fR will be called when the spinbox is edited.
The \fB\-validatecommand\fR will be called for all above conditions.
.PP
It is possible to perform percent substitutions on the \fB\-validatecommand\fR
-and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The
-following substitutions are recognized:
+and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script.
+The following substitutions are recognized:
.PP
.IP \fB%d\fR 5
Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
@@ -213,26 +213,26 @@ validated. If you wish to edit the value of the widget
during validation and still have the \fB\-validate\fR option set, you should
include the command
.CS
- \fI%W config \-validate %v\fR
+ \fI%W config -validate %v\fR
.CE
in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you
were editing the spinbox widget from). It is also recommended to not set an
associated \fB\-textvariable\fR during validation, as that can cause the
spinbox widget to become out of sync with the \fB\-textvariable\fR.
.PP
-Also, the \fB-validate\fR option will set itself to \fBnone\fR when the
-spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR
-and the \fB-validatecommand\fR returns false. For instance
+Also, the \fB\-validate\fR option will set itself to \fBnone\fR when the
+spinbox value gets changed because of adjustment of \fB\-from\fR or \fB\-to\fR
+and the \fB\-validatecommand\fR returns false. For instance
.CS
- \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR
+ \fIspinbox pathName -from 1 -to 10 -validate all -validatecommand {return 0}\fR
.CE
-will in fact set the \fB-validate\fR option to \fBnone\fR because the default
-value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR
+will in fact set the \fB\-validate\fR option to \fBnone\fR because the default
+value for the spinbox gets changed (due to the \fB\-from\fR and \fB\-to\fR
options) to a value not accepted by the validation script.
.PP
Moreover, forced validation is performed when invoking any spinbutton of
the spinbox. If the validation script returns false in this situation,
-then the \fB-validate\fR option will be automatically set to \fBnone\fR.
+then the \fB\-validate\fR option will be automatically set to \fBnone\fR.
.SH "WIDGET COMMAND"
.PP
The \fBspinbox\fR command creates a new Tcl command whose
@@ -250,32 +250,39 @@ arguments. An index specifies a particular character in the spinbox's
string, in any of the following ways:
.TP 12
\fInumber\fR
+.
Specifies the character as a numerical index, where 0 corresponds
to the first character in the string.
.TP 12
\fBanchor\fR
+.
Indicates the anchor point for the selection, which is set with the
\fBselect from\fR and \fBselect adjust\fR widget commands.
.TP 12
\fBend\fR
+.
Indicates the character just after the last one in the spinbox's string.
This is equivalent to specifying a numerical index equal to the length
of the spinbox's string.
.TP 12
\fBinsert\fR
+.
Indicates the character adjacent to and immediately following the
insertion cursor.
.TP 12
\fBsel.first\fR
+.
Indicates the first character in the selection. It is an error to
use this form if the selection is not in the spinbox window.
.TP 12
\fBsel.last\fR
+.
Indicates the character just after the last one in the selection.
It is an error to use this form if the selection is not in the
spinbox window.
.TP 12
\fB@\fInumber\fR
+.
In this form, \fInumber\fR is treated as an x-coordinate in the
spinbox's window; the character spanning that x-coordinate is used.
For example,
@@ -294,8 +301,10 @@ arithmetic and indexing relative to \fBend\fR.
.SS SUBCOMMANDS
.PP
The following commands are possible for spinbox widgets:
+.\" METHOD: bbox
.TP
\fIpathName \fBbbox \fIindex\fR
+.
Returns a list of four numbers describing the bounding box of the
character given by \fIindex\fR.
The first two elements of the list give the x and y coordinates of
@@ -304,14 +313,18 @@ the upper-left corner of the screen area covered by the character
the width and height of the character, in pixels.
The bounding box may refer to a region outside the visible area
of the window.
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBspinbox\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -324,8 +337,10 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBspinbox\fR
command.
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
+.
Delete one or more elements of the spinbox.
\fIFirst\fR is the index of the first character to delete, and
\fIlast\fR is the index of the character just after the last
@@ -333,42 +348,58 @@ one to delete.
If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This command returns an empty string.
+.\" METHOD: get
.TP
\fIpathName \fBget\fR
+.
Returns the spinbox's string.
+.\" METHOD: icursor
.TP
\fIpathName \fBicursor \fIindex\fR
+.
Arrange for the insertion cursor to be displayed just before the character
given by \fIindex\fR. Returns an empty string.
+.\" METHOD: identify
.TP
\fIpathName \fBidentify\fI x y\fR
+.
Returns the name of the window element corresponding to coordinates
\fIx\fR and \fIy\fR in the spinbox. Return value is one of:
\fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR.
+.\" METHOD: index
.TP
\fIpathName \fBindex\fI index\fR
+.
Returns the numerical index corresponding to \fIindex\fR.
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fIindex string\fR
+.
Insert the characters of \fIstring\fR just before the character
indicated by \fIindex\fR. Returns an empty string.
+.\" METHOD: invoke
.TP
\fIpathName \fBinvoke\fI element\fR
+.
Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR,
to be invoked, triggering the action associated with it.
+.\" METHOD: scan
.TP
-\fIpathName \fBscan\fR \fIoption args\fR
+\fIpathName \fBscan\fI option args\fR
+.
This command is used to implement scanning on spinboxes. It has
two forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx\fR
+.
Records \fIx\fR and the current view in the spinbox window; used in
conjunction with later \fBscan dragto\fR commands. Typically this
command is associated with a mouse button press in the widget. It
returns an empty string.
.TP
\fIpathName \fBscan dragto \fIx\fR
+.
This command computes the difference between its \fIx\fR argument
and the \fIx\fR argument to the last \fBscan mark\fR command for
the widget. It then adjusts the view left or right by 10 times the
@@ -377,13 +408,16 @@ with mouse motion events in the widget, to produce the effect of
dragging the spinbox at high speed through the window. The return
value is an empty string.
.RE
+.\" METHOD: selection
.TP
\fIpathName \fBselection \fIoption arg\fR
+.
This command is used to adjust the selection within a spinbox. It
has several forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBselection adjust \fIindex\fR
+.
Locate the end of the selection nearest to the character given by
\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
(i.e. including but not going beyond \fIindex\fR). The other
@@ -395,24 +429,29 @@ selection anchor point, inclusive.
Returns an empty string.
.TP
\fIpathName \fBselection clear\fR
+.
Clear the selection if it is currently in this widget. If the
selection is not in this widget then the command has no effect.
Returns an empty string.
.TP
\fIpathName \fBselection element\fR ?\fIelement\fR?
+.
Sets or gets the currently selected element. If a spinbutton element
is specified, it will be displayed depressed.
.TP
\fIpathName \fBselection from \fIindex\fR
+.
Set the selection anchor point to just before the character
given by \fIindex\fR. Does not change the selection.
Returns an empty string.
.TP
\fIpathName \fBselection present\fR
+.
Returns 1 if there is are characters selected in the spinbox,
0 if nothing is selected.
.TP
\fIpathName \fBselection range \fIstart end\fR
+.
Sets the selection to include the characters starting with
the one indexed by \fIstart\fR and ending with the one just
before \fIend\fR.
@@ -420,6 +459,7 @@ If \fIend\fR refers to the same character as \fIstart\fR or an
earlier one, then the spinbox's selection is cleared.
.TP
\fIpathName \fBselection to \fIindex\fR
+.
If \fIindex\fR is before the anchor point, set the selection
to the characters from \fIindex\fR up to but not including
the anchor point.
@@ -433,25 +473,32 @@ If the selection is not in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
+.\" METHOD: set
.TP
\fIpathName \fBset\fR ?\fIstring\fR?
+.
If \fIstring\fR is specified, the spinbox will try and set it to this
value, otherwise it just returns the spinbox's string.
If validation is on, it will occur when setting the string.
+.\" METHOD: validate
.TP
\fIpathName \fBvalidate\fR
+.
This command is used to force an evaluation of the \fB\-validatecommand\fR
independent of the conditions specified by the \fB\-validate\fR option.
This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR.
It returns 0 or 1.
+.\" METHOD: xview
.TP
\fIpathName \fBxview \fIargs\fR
+.
This command is used to query and change the horizontal position of the
text in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fBxview\fR
+.
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
@@ -462,15 +509,18 @@ These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
\fIpathName \fBxview \fIindex\fR
+.
Adjusts the view in the window so that the character given by \fIindex\fR
is displayed at the left edge of the window.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
+.
Adjusts the view in the window so that the character \fIfraction\fR of the
way through the text appears at the left edge of the window.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
+.
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer or a float, but if it is a float then
diff --git a/doc/sysnotify.n b/doc/sysnotify.n
index ea1ab89..a80f316 100644
--- a/doc/sysnotify.n
+++ b/doc/sysnotify.n
@@ -7,14 +7,17 @@
'\"
.TH tk sysnotify n "" Tk "Tk Built-In Commands"
.so man.macros
+.BS
.SH NAME
sysnotify \- Creates a notification window with a title and message.
.SH SYNOPSIS
-\fBtk sysnotify\fR \fItitle\fR \fImessage\fR
+\fBtk sysnotify\fI title message\fR
.BE
.SH DESCRIPTION
.PP
-The \fBtk sysnotify\fR command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen.
+The \fBtk sysnotify\fR command creates a platform-specific system notification
+alert. Its intent is to provide a brief, unobtrusive notification to the user
+by popping up a window that briefly appears in a corner of the screen.
.SH EXAMPLE
.PP
Here is an example of the \fBtk sysnotify\fR code:
diff --git a/doc/systray.n b/doc/systray.n
index c215c29..f008978 100644
--- a/doc/systray.n
+++ b/doc/systray.n
@@ -7,17 +7,16 @@
'\"
.TH tk systray n "" Tk "Tk Built-In Commands"
.so man.macros
+.BS
.SH NAME
systray \- Creates an icon display in the platform-specific system tray.
.SH SYNOPSIS
-\fBtk systray create \fI\-image image\fR \fI?\-text text\fR? \fI?\-button1 callback?\fR \fI?\-button3 callback?\fR
-.sp
+.nf
+\fBtk systray create \-image \fIimage\fR ?\fB\-text \fItext\fR? ?\fB\-button1 \fIcallback\fR? ?\fB\-button3 \fIcallback\fR?
\fBtk systray configure \fI?option? ?value option value ...?\fR
-.sp
\fBtk systray exists\fR
-.sp
\fBtk systray destroy\fR
-.BE
+.fi
.BE
.SH DESCRIPTION
.PP
diff --git a/doc/text.n b/doc/text.n
index f494414..90602ed 100644
--- a/doc/text.n
+++ b/doc/text.n
@@ -13,10 +13,11 @@
text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hypertext editing widgets
.SH SYNOPSIS
.nf
-\fBtext\fR \fIpathName \fR?\fIoptions\fR?
-\fBtk_textCopy\fR \fIpathName\fR
-\fBtk_textCut\fR \fIpathName\fR
-\fBtk_textPaste\fR \fIpathName\fR
+\fBtext\fI pathName \fR?\fIoptions\fR?
+\fBtk_textCopy\fI pathName\fR
+\fBtk_textCut\fI pathName\fR
+\fBtk_textPaste\fI pathName\fR
+.fi
.SO
\-background \-highlightthickness \-relief
\-borderwidth \-insertbackground \-selectbackground
@@ -416,11 +417,13 @@ individual tags using the
widget command. If a character has been tagged, then the display options
associated with the tag override the default display style. The following
options are currently supported for tags:
+.\" OPTION: -background
.TP
\fB\-background \fIcolor\fR
.
\fIColor\fR specifies the background color to use for characters associated
with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR.
+.\" OPTION: -bgstipple
.TP
\fB\-bgstipple \fIbitmap\fR
.
@@ -428,18 +431,21 @@ with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR.
background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If
\fIbitmap\fR has not been specified, or if it is specified as an empty string,
then a solid fill will be used for the background.
+.\" OPTION: -borderwidth
.TP
\fB\-borderwidth \fIpixels\fR
.
\fIPixels\fR specifies the width of a border to draw around the tag using any
of the forms accepted by \fBTk_GetPixels\fR. This option should be used in
conjunction with the \fB\-relief\fR option to provide the desired border.
+.\" OPTION: -elide
.TP
\fB\-elide \fIboolean\fR
.
\fIElide\fR specifies whether the data should be elided. Elided data
(characters, images, embedded windows, etc.) is not displayed and takes no
space on screen, but further on behaves just as normal data.
+.\" OPTION: -fgstipple
.TP
\fB\-fgstipple \fIbitmap\fR
.
@@ -448,17 +454,20 @@ text and other foreground information such as underlines. It may have any of
the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been
specified, or if it is specified as an empty string, then a solid fill will be
used.
+.\" OPTION: -font
.TP
\fB\-font \fIfontName\fR
.
\fIFontName\fR is the name of a font to use for drawing characters. It may
have any of the forms accepted by \fBTk_GetFont\fR.
+.\" OPTION: -foreground
.TP
\fB\-foreground \fIcolor\fR
.
\fIColor\fR specifies the color to use when drawing text and other foreground
information such as underlines. It may have any of the forms accepted by
\fBTk_GetColor\fR.
+.\" OPTION: -justify
.TP
\fB\-justify \fIjustify\fR
.
@@ -467,6 +476,7 @@ option has been specified, then \fIjustify\fR determines how to justify the
line. It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. If a line
wraps, then the justification for each line on the display is determined by
the first non-elided character of that display line.
+.\" OPTION: -lmargin1
.TP
\fB\-lmargin1 \fIpixels\fR
.
@@ -476,6 +486,7 @@ should be indented from the left edge of the window. \fIPixels\fR may have any
of the standard forms for screen distances. If a line of text wraps, this
option only applies to the first line on the display; the \fB\-lmargin2\fR
option controls the indentation for subsequent lines.
+.\" OPTION: -lmargin2
.TP
\fB\-lmargin2 \fIpixels\fR
.
@@ -486,6 +497,7 @@ much the line should be indented from the left edge of the window.
\fIPixels\fR may have any of the standard forms for screen distances. This
option is only used when wrapping is enabled, and it only applies to the
second and later display lines for a text line.
+.\" OPTION: -lmargincolor
.TP
\fB\-lmargincolor \fIcolor\fR
.
@@ -494,8 +506,9 @@ contain characters because they are indented by \fB\-lmargin1\fR or
\fB\-lmargin2\fR. It may have any of the forms accepted by
\fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is
specified as an empty string, then the color used is specified by the
-\fB-background\fR tag option (or, if this is also unspecified, by the
-\fB-background\fR widget option).
+\fB\-background\fR tag option (or, if this is also unspecified, by the
+\fB\-background\fR widget option).
+.\" OPTION: -offset
.TP
\fB\-offset \fIpixels\fR
.
@@ -504,12 +517,14 @@ vertically from the baseline of the overall line, in pixels. For example, a
positive offset can be used for superscripts and a negative offset can be used
for subscripts. \fIPixels\fR may have any of the standard forms for screen
distances.
+.\" OPTION: -overstrike
.TP
\fB\-overstrike \fIboolean\fR
.
Specifies whether or not to draw a horizontal rule through the middle of
characters. \fIBoolean\fR may have any of the forms accepted by
\fBTcl_GetBoolean\fR.
+.\" OPTION: -overstrikefg
.TP
\fB\-overstrikefg \fIcolor\fR
.
@@ -517,6 +532,7 @@ characters. \fIBoolean\fR may have any of the forms accepted by
have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color
specified by the \fB\-foreground\fR tag option is used.
+.\" OPTION: -relief
.TP
\fB\-relief \fIrelief\fR
.
@@ -524,6 +540,7 @@ specified by the \fB\-foreground\fR tag option is used.
of the forms accepted by \fBTk_GetRelief\fR. This option is used in
conjunction with the \fB\-borderwidth\fR option to enable to the desired
border appearance.
+.\" OPTION: -rmargin
.TP
\fB\-rmargin \fIpixels\fR
.
@@ -534,6 +551,7 @@ leave between the end of the line and the right edge of the window.
option is only used when wrapping is enabled. If a text line wraps, the right
margin for each line on the display is determined by the first non-elided
character of that display line.
+.\" OPTION: -rmargincolor
.TP
\fB\-rmargincolor \fIcolor\fR
.
@@ -541,40 +559,48 @@ character of that display line.
contain characters because they are indented by \fB\-rmargin\fR. It may
have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color
-used is specified by the \fB-background\fR tag option (or, if this is also
-unspecified, by the \fB-background\fR widget option).
+used is specified by the \fB\-background\fR tag option (or, if this is also
+unspecified, by the \fB\-background\fR widget option).
+.\" OPTION: -selectbackground
.TP
\fB\-selectbackground \fIcolor\fR
+.
\fIColor\fR specifies the background color to use when displaying selected
items. It may have any of the forms accepted by \fBTk_GetColor\fR. If
\fIcolor\fR has not been specified, or if it is specified as an empty
string, then the color specified by the \fB\-background\fR tag option is
used.
+.\" OPTION: -selectforeground
.TP
\fB\-selectforeground \fIcolor\fR
+.
\fIColor\fR specifies the foreground color to use when displaying selected
items. It may have any of the forms accepted by \fBTk_GetColor\fR. If
\fIcolor\fR has not been specified, or if it is specified as an empty
string, then the color specified by the \fB\-foreground\fR tag option is
used.
+.\" OPTION: -spacing1
.TP
\fB\-spacing1 \fIpixels\fR
.
\fIPixels\fR specifies how much additional space should be left above each
text line, using any of the standard forms for screen distances. If a line
wraps, this option only applies to the first line on the display.
+.\" OPTION: -spacing2
.TP
\fB\-spacing2 \fIpixels\fR
.
For lines that wrap, this option specifies how much additional space to leave
between the display lines for a single text line. \fIPixels\fR may have any of
the standard forms for screen distances.
+.\" OPTION: -spacing3
.TP
\fB\-spacing3 \fIpixels\fR
.
\fIPixels\fR specifies how much additional space should be left below each
text line, using any of the standard forms for screen distances. If a line
wraps, this option only applies to the last line on the display.
+.\" OPTION: -tabs
.TP
\fB\-tabs \fItabList\fR
.
@@ -586,6 +612,7 @@ unspecified for the tag (the default). If the option is specified as a
non-empty string that is an empty list, such as \fB\-tags\0{\0}\fR, then it
requests default 8-character tabs as described for the \fB\-tags\fR widget
option.
+.\" OPTION: -tabstyle
.TP
\fB\-tabstyle \fIstyle\fR
.
@@ -594,11 +621,13 @@ tabbing to use for the text widget. This option only applies to a display line
if it applies to the first non-elided character on that display line. If this
option is specified as an empty string, it cancels the option, leaving it
unspecified for the tag (the default).
+.\" OPTION: -underline
.TP
\fB\-underline \fIboolean\fR
.
\fIBoolean\fR specifies whether or not to draw an underline underneath
characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR.
+.\" OPTION: -underlinefg
.TP
\fB\-underlinefg \fIcolor\fR
.
@@ -606,6 +635,7 @@ characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR.
have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color
specified by the \fB\-foreground\fR tag option is used.
+.\" OPTION: -wrap
.TP
\fB\-wrap \fImode\fR
.
@@ -696,9 +726,9 @@ then the window is destroyed. Similarly if the text widget as a whole is
deleted, then the window is destroyed.
.PP
Eliding an embedded window immediately after scheduling it for creation via
-\fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it from being
+\fIpathName \fBwindow create \fIindex \fB\-create\fR will prevent it from being
effectively created. Uneliding an elided embedded window scheduled for creation
-via \fIpathName \fBwindow create \fIindex \fB-create\fR will automatically
+via \fIpathName \fBwindow create \fIindex \fB\-create\fR will automatically
trigger the associated creation script. After destroying an elided embedded
window, the latter won't get automatically recreated.
.PP
@@ -707,6 +737,7 @@ When an embedded window is added to a text widget with the \fIpathName
associated with it. These options may be modified later with the \fIpathName
\fBwindow configure\fR widget command. The following options are currently
supported:
+.\" OPTION: -align
.TP
\fB\-align \fIwhere\fR
.
@@ -717,6 +748,7 @@ line), \fBcenter\fR (center the window within the range of the line),
\fBbottom\fR (align the bottom of the window with the bottom of the line's
area), or \fBbaseline\fR (align the bottom of the window with the baseline of
the line).
+.\" OPTION: -create
.TP
\fB\-create \fIscript\fR
.
@@ -729,18 +761,21 @@ the name of that window as its result. Two substitutions will be performed in
the parent text widget, and \fI%%\fR will be substituted by a single \fI%\fR.
If the annotation's window should ever be deleted, \fIscript\fR will be
evaluated again the next time the annotation is displayed.
+.\" OPTION: -padx
.TP
\fB\-padx \fIpixels\fR
.
\fIPixels\fR specifies the amount of extra space to leave on each side of the
embedded window. It may have any of the usual forms defined for a screen
distance.
+.\" OPTION: -pady
.TP
\fB\-pady \fIpixels\fR
.
\fIPixels\fR specifies the amount of extra space to leave on the top and on
the bottom of the embedded window. It may have any of the usual forms defined
for a screen distance.
+.\" OPTION: -stretch
.TP
\fB\-stretch \fIboolean\fR
.
@@ -749,6 +784,7 @@ line in which it is displayed, this option can be used to specify whether the
window should be stretched vertically to fill its line. If the \fB\-pady\fR
option has been specified as well, then the requested padding will be retained
even if the window is stretched.
+.\" OPTION: -window
.TP
\fB\-window \fIpathName\fR
.
@@ -775,9 +811,9 @@ containing the embedded image is deleted then that copy of the image is removed
from the screen.
.PP
Eliding an embedded image immediately after scheduling it for creation via
-\fIpathName \fBimage create \fIindex \fB-create\fR will prevent it from being
+\fIpathName \fBimage create \fIindex \fB\-create\fR will prevent it from being
effectively created. Uneliding an elided embedded image scheduled for creation
-via \fIpathName \fBimage create \fIindex \fB-create\fR will automatically
+via \fIpathName \fBimage create \fIindex \fB\-create\fR will automatically
trigger the associated creation script. After destroying an elided embedded
image, the latter won't get automatically recreated.
.PP
@@ -797,6 +833,7 @@ When an embedded image is added to a text widget with the \fIpathName \fBimage
create\fR widget command, several configuration options may be associated with
it. These options may be modified later with the \fIpathName \fBimage
configure\fR widget command. The following options are currently supported:
+.\" OPTION: -align
.TP
\fB\-align \fIwhere\fR
.
@@ -806,11 +843,13 @@ of the values \fBtop\fR (align the top of the image with the top of the line),
\fBcenter\fR (center the image within the range of the line), \fBbottom\fR
(align the bottom of the image with the bottom of the line's area), or
\fBbaseline\fR (align the bottom of the image with the baseline of the line).
+.\" OPTION: -image
.TP
\fB\-image \fIimage\fR
.
Specifies the name of the Tk image to display in the annotation. If
\fIimage\fR is not a valid Tk image, then an error is returned.
+.\" OPTION: -name
.TP
\fB\-name \fIImageName\fR
.
@@ -818,12 +857,14 @@ Specifies the name by which this image instance may be referenced in the text
widget. If \fIImageName\fR is not supplied, then the name of the Tk image is
used instead. If the \fIimageName\fR is already in use, \fI#nn\fR is appended
to the end of the name as described above.
+.\" OPTION: -padx
.TP
\fB\-padx \fIpixels\fR
.
\fIPixels\fR specifies the amount of extra space to leave on each side of the
embedded image. It may have any of the usual forms defined for a screen
distance.
+.\" OPTION: -pady
.TP
\fB\-pady \fIpixels\fR
.
@@ -979,7 +1020,7 @@ In order to maintain a responsive user-experience, the text widget calculates
lines metrics (line heights in pixels) asynchronously. Because of this, some
commands of the text widget may return wrong results if the asynchronous
calculations are not finished at the time of calling. This applies to
-\fIpathName \fBcount -ypixels\fR and \fIpathName \fByview\fR.
+\fIpathName \fBcount \-ypixels\fR and \fIpathName \fByview\fR.
.PP
Again for performance reasons, it would not be appropriate to let these
commands always wait for the end of the update calculation each time they are
@@ -1061,6 +1102,7 @@ operations on the widget. It has the following general form:
\fIPathName\fR is the name of the command, which is the same as the text
widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact
behavior of the command. The following commands are possible for text widgets:
+.\" METHOD: bbox
.TP
\fIpathName \fBbbox \fIindex\fR
.
@@ -1071,13 +1113,15 @@ and the last two elements give the width and height of the area. If the
character is only partially visible on the screen, then the return value
reflects just the visible part. If the character is not visible on the screen
then the return value is an empty list.
+.\" METHOD: cget
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBtext\fR command.
+.\" METHOD: compare
.TP
-\fIpathName \fBcompare\fR \fIindex1 op index2\fR
+\fIpathName \fBcompare\fI index1 op index2\fR
.
Compares the indices given by \fIindex1\fR and \fIindex2\fR according to the
relational operator given by \fIop\fR, and returns 1 if the relationship is
@@ -1085,6 +1129,7 @@ satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==,
>=, >, or !=. If \fIop\fR is == then 1 is returned if the two indices refer to
the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers
to an earlier character in the text than \fIindex2\fR, and so on.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -1098,6 +1143,7 @@ specified). If one or more \fIoption\-value\fR pairs are specified, then the
command modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. \fIOption\fR may have any of
the values accepted by the \fBtext\fR command.
+.\" METHOD: count
.TP
\fIpathName \fBcount\fR ?\fIoptions\fR? \fIindex1 index2\fR
.
@@ -1161,6 +1207,7 @@ supplied. For example
.QW ".text count \-xpixels \-ypixels 1.3 4.5"
is perfectly valid and will return a list of two elements.
.RE
+.\" METHOD: debug
.TP
\fIpathName \fBdebug \fR?\fIboolean\fR?
.
@@ -1181,6 +1228,7 @@ global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR to the lists of
indices that are redrawn. The values of these variables are tested by Tk's
test suite.
.RE
+.\" METHOD: delete
.TP
\fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR?
.
@@ -1208,6 +1256,7 @@ side-effects. If multiple ranges with the same start index are given,
then the longest range is used. If overlapping ranges are given, then
they will be merged into spans that do not cause deletion of text
outside the given ranges due to text shifted during deletion.
+.\" METHOD: dlineinfo
.TP
\fIpathName \fBdlineinfo \fIindex\fR
.
@@ -1224,6 +1273,7 @@ width of the window then the area returned reflects just the portion of the
line that is occupied by characters and embedded windows. If the display line
containing \fIindex\fR is not visible on the screen then the return value is
an empty list.
+.\" METHOD: dump
.TP
\fIpathName \fBdump \fR?\fIswitches\fR? \fIindex1 \fR?\fIindex2\fR?
.
@@ -1242,11 +1292,13 @@ the text, mark name, tag name, image name, or window name. The \fIindex\fR
information is the index of the start of the text, mark, tag transition, image
or window. One or more of the following switches (or abbreviations thereof)
may be specified to control the dump:
+.\" OPTION: -all
.TP
\fB\-all\fR
.
Return information about all elements: text, marks, tags, images and windows.
This is the default.
+.\" OPTION: -command
.TP
\fB\-command \fIcommand\fR
.
@@ -1254,20 +1306,24 @@ Instead of returning the information as the result of the dump operation,
invoke the \fIcommand\fR on each element of the text widget within the range.
The command has three arguments appended to it before it is evaluated: the
\fIkey\fR, \fIvalue\fR, and \fIindex\fR.
+.\" OPTION: -image
.TP
\fB\-image\fR
.
Include information about images in the dump results.
+.\" OPTION: -mark
.TP
\fB\-mark\fR
.
Include information about marks in the dump results.
+.\" OPTION: -tag
.TP
\fB\-tag\fR
.
Include information about tag transitions in the dump results. Tag information
is returned as \fBtagon\fR and \fBtagoff\fR elements that indicate the begin
and end of each range of each tag, respectively.
+.\" OPTION: -text
.TP
\fB\-text\fR
.
@@ -1276,6 +1332,7 @@ to the next element or the end of range indicated by \fIindex2\fR. A text
element does not span newlines. A multi-line block of text that contains no
marks or tag transitions will still be dumped as a set of text segments that
each end with a newline. The newline is part of the value.
+.\" OPTION: -window
.TP
\fB\-window\fR
.
@@ -1284,6 +1341,7 @@ window is its Tk pathname, unless the window has not been created yet. (It
must have a create script.) In this case an empty string is returned, and you
must query the window by its index position to get more information.
.RE
+.\" METHOD: edit
.TP
\fIpathName \fBedit \fIoption \fR?\fIarg ...\fR?
.
@@ -1334,6 +1392,7 @@ edit action is defined as all the insert and delete commands that are recorded
on the undo stack in between two separators. Generates an error when the undo
stack is empty. Does nothing when the \fB\-undo\fR option is false.
.RE
+.\" METHOD: get
.TP
\fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \fIindex1\fR ?\fIindex2 ...\fR?
.
@@ -1352,6 +1411,7 @@ order passed to \fIpathName \fBget\fR. If the \fB\-displaychars\fR option is
given, then, within each range, only those characters which are not elided
will be returned. This may have the effect that some of the returned ranges
are empty strings.
+.\" METHOD: image
.TP
\fIpathName \fBimage \fIoption \fR?\fIarg ...\fR?
.
@@ -1394,12 +1454,14 @@ identifier returned.
Returns a list whose elements are the names of all image instances currently
embedded in \fIwindow\fR.
.RE
+.\" METHOD: index
.TP
\fIpathName \fBindex \fIindex\fR
.
Returns the position corresponding to \fIindex\fR in the form \fIline.char\fR
where \fIline\fR is the line number and \fIchar\fR is the character number.
\fIIndex\fR may have any of the forms described under \fBINDICES\fR above.
+.\" METHOD: insert
.TP
\fIpathName \fBinsert \fIindex chars \fR?\fItagList chars tagList ...\fR?
.
@@ -1417,6 +1479,7 @@ of the tags present around the insertion point. If multiple
effect as if a separate \fIpathName \fBinsert\fR widget command had been
issued for each pair, in order. The last \fItagList\fR argument may be
omitted.
+.\" METHOD: mark
.TP
\fIpathName \fBmark \fIoption \fR?\fIarg ...\fR?
.
@@ -1447,7 +1510,7 @@ position if there are multiple marks at the same index. These semantics mean
that the \fBmark next\fR operation can be used to step through all the marks
in a text widget in the same order as the mark information returned by the
\fIpathName \fBdump\fR operation. If a mark has been set to the special
-\fBend\fR index, then it appears to be \fIafter\fR \fBend\fR with respect to
+\fBend\fR index, then it appears to be \fIafter \fBend\fR with respect to
the \fIpathName \fBmark next\fR operation. An empty string is returned if
there are no marks after \fIindex\fR.
.TP
@@ -1479,6 +1542,7 @@ calls to
.QW "\fIpathName \fBmark names\fR" .
This command returns an empty string.
.RE
+.\" METHOD: peer
.TP
\fIpathName \fBpeer \fIoption args\fR
.
@@ -1498,11 +1562,15 @@ be overridden with the standard configuration options.
Returns a list of peers of this widget (this does not include the widget
itself). The order within this list is undefined.
.RE
+.\" METHOD: pendingsync
.TP
\fIpathName \fBpendingsync\fR
+.
Returns 1 if the line heights calculations are not up-to-date, 0 otherwise.
+.\" METHOD: replace
.TP
-\fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR?
+\fIpathName \fBreplace\fI index1 index2 chars\fR ?\fItagList chars tagList ...\fR?
+.
Replaces the range of characters between \fIindex1\fR and \fIindex2\fR
with the given characters and tags. See the section on \fIpathName
\fBinsert\fR for an explanation of the handling of the \fItagList...\fR
@@ -1517,6 +1585,7 @@ the window or movement of insertion cursor occurs. In addition the undo/redo
stack are correctly modified, if undo operations are active in the text
widget. The command returns an empty string.
.RE
+.\" METHOD: scan
.TP
\fIpathName \fBscan \fIoption args\fR
.
@@ -1540,6 +1609,7 @@ coordinates. This command is typically associated with mouse motion events in
the widget, to produce the effect of dragging the text at high speed through
the window. The return value is an empty string.
.RE
+.\" METHOD: search
.TP
\fIpathName \fBsearch \fR?\fIswitches\fR? \fIpattern index \fR?\fIstopIndex\fR?
.
@@ -1549,12 +1619,14 @@ first character in the match is returned as result; otherwise an empty string
is returned. One or more of the following switches (or abbreviations thereof)
may be specified to control the search:
.RS
+.\" OPTION: -forwards
.TP
\fB\-forwards\fR
.
The search will proceed forward through the text, finding the first matching
range starting at or after the position given by \fIindex\fR. This is the
default.
+.\" OPTION: -backwards
.TP
\fB\-backwards\fR
.
@@ -1564,11 +1636,13 @@ allowed to be at \fIindex\fR). Note that, for a variety of reasons, backwards
searches can be substantially slower than forwards searches (particularly when
using \fB\-regexp\fR), so it is recommended that performance-critical code use
forward searches.
+.\" OPTION: -exact
.TP
\fB\-exact\fR
.
Use exact matching: the characters in the matching range must be identical to
those in \fIpattern\fR. This is the default.
+.\" OPTION: -regexp
.TP
\fB\-regexp\fR
.
@@ -1580,6 +1654,7 @@ details). The default matching automatically passes both the
\fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line,
and \fI.\fR, \fI[^\fR sequences will never match the newline character
\fI\en\fR.
+.\" OPTION: -nolinestop
.TP
\fB\-nolinestop\fR
.
@@ -1588,10 +1663,12 @@ This allows \fI.\fR and \fI[^\fR sequences to match the newline character
details). This option is only meaningful if \fB\-regexp\fR is also given, and
an error will be thrown otherwise. For example, to match the entire text, use
.QW "\fIpathName \fBsearch \-nolinestop \-regexp\fR \N'34'.*\N'34' 1.0" .
+.\" OPTION: -nocase
.TP
\fB\-nocase\fR
.
Ignore case differences between the pattern and the text.
+.\" OPTION: -count
.TP
\fB\-count\fI varName\fR
.
@@ -1602,6 +1679,7 @@ or windows in the matching range (and there are no elided characters if
\fB\-elide\fR is not given), this is equivalent to the number of characters
matched. In either case, the range \fImatchIdx\fR to \fImatchIdx + $count
chars\fR will return the entire matched text.
+.\" OPTION: -all
.TP
\fB\-all\fR
.
@@ -1621,6 +1699,7 @@ will just match twice, once for each word, and matching
against
.QW ZooZooZoo
will just match once.
+.\" OPTION: -overlap
.TP
\fB\-overlap\fR
.
@@ -1638,6 +1717,7 @@ against
.QW ZooZooZoo
will now match twice. An error will be thrown if this switch is used without
\fB\-all\fR.
+.\" OPTION: -strictlimits
.TP
\fB\-strictlimits\fR
.
@@ -1645,10 +1725,12 @@ When performing any search, the normal behaviour is that the start and stop
limits are checked with respect to the start of the matching text. With the
\fB\-strictlimits\fR flag, the entire matching range must lie inside the start
and stop limits specified for the match to be valid.
+.\" OPTION: -elide
.TP
\fB\-elide\fR
.
Find elided (hidden) text as well. By default only displayed text is searched.
+.\" OPTION: --
.TP
\fB\-\|\-\fR
.
@@ -1671,6 +1753,7 @@ no wrap-around will occur. This means that, for example, if the search is
\fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a
number of minor limitations of the \fIpathName \fBsearch\fR command.
.RE
+.\" METHOD: see
.TP
\fIpathName \fBsee \fIindex\fR
.
@@ -1680,23 +1763,28 @@ nothing. If \fIindex\fR is a short distance out of view, the command adjusts
the view just enough to make \fIindex\fR visible at the edge of the window.
If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the
window.
+.\" METHOD: sync
.TP
-\fIpathName \fBsync\fR ?\fB-command \fIcommand\fR?
+\fIpathName \fBsync\fR ?\fB\-command \fIcommand\fR?
+.
Controls the synchronization of the view of the text widget.
.RS
.TP
\fIpathName \fBsync\fR
+.
Immediately brings the line metrics up-to-date by forcing computation of any
outdated line heights. The command returns immediately if there is no such
outdated line heights, otherwise it returns only at the end of the computation.
The command returns an empty string.
.TP
-\fIpathName \fBsync -command \fIcommand\fR
+\fIpathName \fBsync \-command \fIcommand\fR
+.
Schedules \fIcommand\fR to be executed (by the event loop) exactly once as soon
as all line heights are up-to-date. If there are no pending line metrics
calculations, the scheduling is immediate. The command returns the empty
string. \fBbgerror\fR is called on \fIcommand\fR failure.
.RE
+.\" METHOD: tag
.TP
\fIpathName \fBtag \fIoption \fR?\fIarg ...\fR?
.
@@ -1838,7 +1926,7 @@ of the range and the index of the character just after the last one in the
range. If no matching range is found then the return value is an empty string.
If \fIindex2\fR is not given then it defaults to the beginning of the text.
.TP
-\fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR?
+\fIpathName \fBtag raise \fItagName \fR?\fIaboveThis\fR?
.
Changes the priority of tag \fItagName\fR so that it is just higher in
priority than the tag whose name is \fIaboveThis\fR. If \fIaboveThis\fR is
@@ -1866,6 +1954,7 @@ characters in the specified range (e.g. \fIindex1\fR is past the end of the
file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command
has no effect. This command returns an empty string.
.RE
+.\" METHOD: window
.TP
\fIpathName \fBwindow \fIoption \fR?\fIarg ...\fR?
.
@@ -1906,6 +1995,7 @@ information on the options that are supported. Returns an empty string.
Returns a list whose elements are the names of all windows currently embedded
in \fIwindow\fR.
.RE
+.\" METHOD: xview
.TP
\fIpathName \fBxview \fIoption args\fR
.
@@ -1951,6 +2041,7 @@ right by \fInumber\fR average-width characters on the display. If \fInumber\fR i
negative then characters farther to the left become visible; if it is positive
then characters farther to the right become visible.
.RE
+.\" METHOD: yview
.TP
\fIpathName \fByview \fR?\fIargs\fR?
.
@@ -2255,7 +2346,7 @@ practice this is a rare problem, but it can occur, for example:
.CS
pack [\fBtext\fR .t]
\&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en"
-\&.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0
+\&.t search -regexp -- {(a+|b+\enc+\enb+)+\ena+} 1.0
.CE
will not find a match when one exists of 19 characters starting from the first
.QW b .
@@ -2271,7 +2362,7 @@ portions of the widget. For example:
.CS
pack [\fBtext\fR .t]
\&.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n"
-\&.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end
+\&.t search -regexp -backward -- {b+\en|a+\en(b+\en)+} end
.CE
matches at
.QW 5.0
diff --git a/doc/tk.n b/doc/tk.n
index 27a2d58..e2a81c4 100644
--- a/doc/tk.n
+++ b/doc/tk.n
@@ -12,7 +12,7 @@
.SH NAME
tk \- Manipulate Tk internal state
.SH SYNOPSIS
-\fBtk\fR \fIoption \fR?\fIarg ...\fR?
+\fBtk\fI option \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -23,6 +23,7 @@ application as a whole, or to a screen or display, rather than to a
particular window.
The command can take any of a number of different forms
depending on the \fIoption\fR argument. The legal forms are:
+.\" METHOD: appname
.TP
\fBtk appname \fR?\fInewName\fR?
.
@@ -44,6 +45,7 @@ be able to find some options for the application.
If sends have been disabled by deleting the \fBsend\fR command,
this command will reenable them and recreate the \fBsend\fR
command.
+.\" METHOD: busy
.TP
\fBtk busy \fIsubcommand\fR ...
.
@@ -51,6 +53,7 @@ This command controls the marking of window hierarchies as
.QW busy ,
rendering them non-interactive while some other operation is proceeding. For
more details see the \fBbusy\fR manual page.
+.\" METHOD: caret
.TP
\fBtk caret \fIwindow \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
.
@@ -63,6 +66,7 @@ the last values used for setting the caret are return in option-value pair
format. \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and
\fB\-height\fR is the height of the current cursor location, or the height
of the specified \fIwindow\fR if none is given.
+.\" METHOD: inactive
.TP
\fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR?
.
@@ -81,10 +85,13 @@ the timer is reset and an empty string is returned. Resetting the
inactivity time is forbidden in safe interpreters and will throw an
error if tried.
.RE
+.\" METHOD: fontchooser
.TP
\fBtk fontchooser \fIsubcommand\fR ...
+.
Controls the Tk font selection dialog. For more details see the
\fBfontchooser\fR manual page.
+.\" METHOD: print
.TP
\fBtk print \fIwindow\fR
.
@@ -92,6 +99,7 @@ The \fBtk print\fR command posts a dialog that allows users to print output
from the \fBcanvas\fR and \fBtext\fR widgets. The printing will be done using
platform-native APIs and dialogs where available. For more details see the
\fBprint\fR manual page.
+.\" METHOD: scaling
.TP
\fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
.
@@ -117,6 +125,7 @@ after the scaling factor is changed will use the new scaling factor, but it
is undefined whether existing widgets will resize themselves dynamically to
accommodate the new scaling factor.
.RE
+.\" METHOD: sysnotify
.TP
\fBtk sysnotify \fP \fItitle\fP? \fImessage\fP?
.
@@ -124,11 +133,13 @@ The \fBtk sysnotify\fP command creates a platform-specific system
notification alert. Its intent is to provide a brief, unobtrusive
notification to the user by popping up a window that briefly appears in a
corner of the screen. For more details see the \fBsysnotify\fR manual page.
+.\" METHOD: systray
.TP
\fBtk systray create\fP \fIsubcommand...\fP
.
The \fBtk systray\fP command creates an icon in the platform-specific
tray. For more details see the \fBsystray\fR manual page.
+.\" METHOD: useinputmethods
.TP
\fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR?
.
@@ -139,6 +150,7 @@ feature is only significant on X. If XIM support is not available, this
will always return 0. If the \fIwindow\fR argument is omitted, it defaults
to the main window. If the \fIboolean\fR argument is omitted, the current
state is returned. This is turned on by default for the main display.
+.\" METHOD: windowingsystem
.TP
\fBtk windowingsystem\fR
.
diff --git a/doc/tk_mac.n b/doc/tk_mac.n
index 2ce1374..18b6336 100644
--- a/doc/tk_mac.n
+++ b/doc/tk_mac.n
@@ -35,7 +35,6 @@ tk::mac \- Access Mac-Specific Functionality on OS X from Tk
\fB::tk::mac::antialiasedtext \fInumber\fR
\fB::tk::mac::useThemedToplevel \fIboolean\fR
-
\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR
.fi
.BE
@@ -45,6 +44,7 @@ The Aqua/Mac OS X application environment defines a number of additional
events that applications should respond to. These events are mapped by Tk to
calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if
the command is absent, no action will be taken.
+.\" COMMAND: DoScriptFile
.TP
\fB::tk::mac::DoScriptFile\fR
.
@@ -52,6 +52,7 @@ The default Apple Event handler for AEDoScriptHandler. This command
executes a Tcl file when an AppleScript sends a
.QW "do script"
command to Wish with a file path as a parameter.
+.\" COMMAND: DoScriptText
.TP
\fB::tk::mac::DoScriptText\fR
.
@@ -59,6 +60,7 @@ The default Apple Event handler for AEDoScriptHandler. This command
executes Tcl code when an AppleScript sends a
.QW "do script"
command to Wish with Tcl code or a Tcl procedure as a parameter.
+.\" COMMAND: ShowPreferences
.TP
\fB::tk::mac::ShowPreferences\fR
.
@@ -77,6 +79,7 @@ proc ::tk::mac::ShowPreferences {} {
}
.CE
.RE
+.\" COMMAND: OpenApplication
.TP
\fB::tk::mac::OpenApplication\fR
.
@@ -84,6 +87,7 @@ If a proc of this name is defined, this proc fill fire when your application
is initially opened. It is the default Apple Event handler for
kAEOpenApplication,
.QW oapp .
+.\" COMMAND: ReopenApplication
.TP
\fB::tk::mac::ReopenApplication\fR
.
@@ -106,6 +110,7 @@ proc ::tk::mac::ReopenApplication {} {
}
.CE
.RE
+.\" COMMAND: OpenDocument
.TP
\fB::tk::mac::OpenDocument \fIfile...\fR
.
@@ -124,6 +129,7 @@ proc ::tk::mac::OpenDocument {args} {
}
.CE
.RE
+.\" COMMAND: PrintDocument
.TP
\fB::tk::mac::PrintDocument \fIfile...\fR
.
@@ -132,6 +138,7 @@ kAEPrintDocuments,
.QW pdoc ,
the Apple Event sent when your application is asked to print a
document. It takes a single absolute file path as an argument.
+.\" COMMAND: Quit
.TP
\fB::tk::mac::Quit\fR
.
@@ -142,17 +149,20 @@ the Apple Event sent when your application is asked to be quit, e.g. via the
quit menu item in the application menu, the quit menu item in the Dock menu,
or during a logout/restart/shutdown etc. If this is not defined, \fBexit\fR is
called instead.
+.\" COMMAND: OnHide
.TP
\fB::tk::mac::OnHide\fR
.
If defined, this is called when your application receives a kEventAppHidden
event, e.g. via the hide menu item in the application or Dock menus.
+.\" COMMAND: OnShow
.TP
\fB::tk::mac::OnShow\fR
.
If defined, this is called when your application receives a kEventAppShown
event, e.g. via the show all menu item in the application menu, or by clicking
the Dock icon of a hidden application.
+.\" COMMAND: ShowHelp
.TP
\fB::tk::mac::ShowHelp\fR
.
@@ -162,6 +172,7 @@ platform-specific standard Help menu item
performs the default Cocoa action of showing the Help Book configured in the
application's Info.plist (or displaying an alert if no Help Book is
set).
+.\" COMMAND: PerformService
.TP
\fB::tk::mac::PerformService\fR
.
@@ -193,6 +204,7 @@ key in Wish's Info.plist file is currently set as
.QW "Wish"
; if a developer changes the name of the Wish executable to something
else, this key should be modified with the same name.
+.\" COMMAND: LaunchURL
.TP
\fB::tk::mac::LaunchURL \fIURL...\fR
.
@@ -202,19 +214,18 @@ an RSS feed, rather than launching a default application to handle the
URL, although it can defined as such. Wish includes a stub URL scheme
of
.QW foo://
-in the CFBundleURLSchemes key of its Info.plist file; this should be customized for the specific URL
-scheme the developer wants to support.
+in the CFBundleURLSchemes key of its Info.plist file; this should be
+customized for the specific URL scheme the developer wants to support.
.TP
\fB::tk::mac::GetAppPath\fR
.
Returns the current applications's file path.
-.TP
-
-
+.PP
.SH "ADDITIONAL DIALOGS"
.PP
The Aqua/Mac OS X defines additional dialogs that applications should
support.
+.\" COMMAND: standardAboutPanel
.TP
\fB::tk::mac::standardAboutPanel\fR
.
@@ -233,22 +244,26 @@ procedure will be called instead of opening the standardAboutPanel.
.PP
There are a number of additional global configuration options that control the
details of how Tk renders by default.
+.\" COMMAND: useCompatibilityMetrics
.TP
\fB::tk::mac::useCompatibilityMetrics \fIboolean\fR
.
Preserves compatibility with older Tk/Aqua metrics; set to \fBfalse\fR for
more native spacing.
+.\" COMMAND: CGAntialiasLimit
.TP
\fB::tk::mac::CGAntialiasLimit \fIlimit\fR
.
Sets the antialiasing limit; lines thinner that \fIlimit\fR pixels will not be
antialiased. Integer, set to 0 by default, making all lines be antialiased.
+.\" COMMAND: antialiasedtext
.TP
\fB::tk::mac::antialiasedtext \fInumber\fR
.
Sets anti-aliased text. Controls text antialiasing, possible values for
\fInumber\fR are -1 (default, use system default for text AA), 0 (no text AA),
1 (use text AA).
+.\" COMMAND: useThemedToplevel
.TP
\fB::tk::mac::useThemedToplevel \fIboolean\fR
.
@@ -257,6 +272,7 @@ background. Equivalent to configuring the toplevel with
.QW "\fB\-background systemWindowHeaderBackground\fR" ,
or to using a \fBttk::frame\fR.
.SH "SUPPORT COMMANDS"
+.\" COMMAND: iconBitmap
.TP
\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR
.
@@ -278,26 +294,32 @@ NSImage url string
.PP
The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define
the dimensions of the image to create, and \fI\-kind\fR must be one of:
+.\" OPTION: -file
.TP
\fB\-file\fR
.
icon of file at given path
+.\" OPTION: -fileType
.TP
\fB\-fileType\fR
.
icon of given file type
+.\" OPTION: -osType
.TP
\fB\-osType\fR
.
icon of given 4-char OSType file type
+.\" OPTION: -systemType
.TP
\fB\-systemType\fR
.
icon for given IconServices 4-char OSType
+.\" OPTION: -namedImage
.TP
\fB\-namedImage\fR
.
named NSImage for given name
+.\" OPTION: -imageFile
.TP
\fB\-imageFile\fR
.
diff --git a/doc/tkerror.n b/doc/tkerror.n
index 53cb0d1..b1e4b81 100644
--- a/doc/tkerror.n
+++ b/doc/tkerror.n
@@ -18,13 +18,15 @@ tkerror \- Command invoked to process background errors
.PP
Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to
\fBbgerror\fR because the event loop (which is what usually invokes
-it) is now part of Tcl. For backward compatibility
+it) is now part of Tcl. Using the \fBtkerror\fR name is deprecated.
+.PP
+For backward compatibility
the \fBbgerror\fR provided by the current Tk version still
tries to call \fBtkerror\fR if there is one (or an auto loadable one),
so old script defining that error handler should still work, but you
should anyhow modify your scripts to use \fBbgerror\fR instead
of \fBtkerror\fR because that support for the old name might vanish
-in the near future. If that call fails, \fBbgerror\fR
+in the future. If that call fails, \fBbgerror\fR
posts a dialog showing the error and offering to see the stack trace
to the user. If you want your own error management you should
directly override \fBbgerror\fR instead of \fBtkerror\fR.
diff --git a/doc/tkvars.n b/doc/tkvars.n
index e211575..cd69906 100644
--- a/doc/tkvars.n
+++ b/doc/tkvars.n
@@ -16,6 +16,7 @@ geometry, tk_library, tk_patchLevel, tk::scalingPct, tk_strictMotif, tk::svgFmt,
.PP
The following Tcl variables are either set or used by Tk at various times
in its execution:
+.\" VARIABLE: tk_library
.TP 15
\fBtk_library\fR
.
@@ -40,6 +41,7 @@ working directory.
The variable can be modified by an application to switch to a different
library.
.RE
+.\" VARIABLE: tk_patchLevel
.TP
\fBtk_patchLevel\fR
.
@@ -52,6 +54,7 @@ it uniquely identifies an official version of Tk.
This value is normally the same as the result of
.QW "\fBpackage require\fR \fBtk\fR" .
.RE
+.\" VARIABLE: scalingPct
.TP
\fBtk::scalingPct\fR
.
@@ -87,6 +90,7 @@ additional step, Tk synchronizes the scaling factor used to convert
between physical units and pixels with the scaling percentage, with the
aid of the \fBtk scaling\fR command.
.RE
+.\" VARIABLE: tk_strictMotif
.TP
\fBtk_strictMotif\fR
.
@@ -96,6 +100,7 @@ closely as possible to Motif look-and-feel standards.
For example, active elements such as buttons and scrollbar
sliders will not change color when the pointer passes over them.
Modern applications should not normally set this variable.
+.\" VARIABLE: svgFmt
.TP
\fBtk::svgFmt\fR
.
@@ -119,6 +124,7 @@ read-only! Note also that whenever the scaling factor used to convert
between physical units and pixels is changed via \fBtk scaling\fR, the
value of the variable \fBtk::svgFmt\fR is automatically updated.
.RE
+.\" VARIABLE: tk_version
.TP
\fBtk_version\fR
.
@@ -134,6 +140,7 @@ major version number changes.
.SS "INTERNAL AND DEBUGGING VARIABLES"
.PP
These variables should not normally be set by user code.
+.\" VARIABLE: Priv
.TP
\fBtk::Priv\fR
.
@@ -141,6 +148,8 @@ This variable is an array containing several pieces of information
that are private to Tk. The elements of \fBtk::Priv\fR are used by
Tk library procedures and default bindings.
They should not be accessed by any code outside Tk.
+.\" VARIABLE: tk_textRedraw
+.\" VARIABLE: tk_textRelayout
.TP
\fBtk_textRedraw\fR
.TP
@@ -154,6 +163,7 @@ used by Tk's test suite.
The following variables are only guaranteed to exist in \fBwish\fR
executables; the Tk library does not define them itself but many Tk
environments do.
+.\" VARIABLE: geometry
.TP
\fBgeometry\fR
.
diff --git a/doc/tkwait.n b/doc/tkwait.n
index 82d51ba..958d4f3 100644
--- a/doc/tkwait.n
+++ b/doc/tkwait.n
@@ -12,26 +12,29 @@
.SH NAME
tkwait \- Wait for variable to change or window to be destroyed
.SH SYNOPSIS
+.nf
\fBtkwait variable \fIname\fR
-.sp
\fBtkwait visibility \fIname\fR
-.sp
\fBtkwait window \fIname\fR
+.fi
.BE
.SH DESCRIPTION
.PP
The \fBtkwait\fR command waits for one of several things to happen,
then it returns without taking any other actions.
The return value is always an empty string.
+.\" METHOD: variable
If the first argument is \fBvariable\fR (or any abbreviation of
it) then the second argument is the name of a global variable and the
command waits for that variable to be modified.
+.\" METHOD: visibility
If the first argument is \fBvisibility\fR (or any abbreviation
of it) then the second argument is the name of a window and the
\fBtkwait\fR command waits for a change in its
visibility state (as indicated by the arrival of a VisibilityNotify
event). This form is typically used to wait for a newly-created
window to appear on the screen before taking some action.
+.\" METHOD: window
If the first argument is \fBwindow\fR (or any abbreviation
of it) then the second argument is the name of a window and the
\fBtkwait\fR command waits for that window to be destroyed.
diff --git a/doc/toplevel.n b/doc/toplevel.n
index 6e5ec0e..701d383 100644
--- a/doc/toplevel.n
+++ b/doc/toplevel.n
@@ -12,7 +12,7 @@
.SH NAME
toplevel \- Create and manipulate 'toplevel' main and popup window widgets
.SH SYNOPSIS
-\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR?
+\fBtoplevel\fI pathName \fR?\fIoptions\fR?
.SO
\-borderwidth \-highlightcolor \-pady
\-cursor \-highlightthickness \-relief
@@ -148,6 +148,7 @@ operations on the widget. It has the following general form:
the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for toplevel widgets:
+.\" METHOD: cget
.TP
\fIpathName \fBcget \fIoption\fR
.
@@ -155,6 +156,7 @@ Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBtoplevel\fR
command.
+.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n
index d834ecb..1514944 100644
--- a/doc/ttk_panedwindow.n
+++ b/doc/ttk_panedwindow.n
@@ -146,7 +146,7 @@ are:
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
-\fB\-gripcount\fP \fIcount\fP
+\fB\-gripsize\fP \fIsize\fP (number of screen units)
.br
\fB\-handlepad\fP \fIamount\fP
.br
diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n
index 406d70d..321d101 100644
--- a/doc/ttk_scrollbar.n
+++ b/doc/ttk_scrollbar.n
@@ -177,7 +177,7 @@ Dynamic states: \fBactive\fP, \fBdisabled\fP.
.br
\fB\-foreground\fP \fIcolor\fP
.br
-\fB\-gripcount\fP \fIcount\fP (number of lines on the thumb)
+\fB\-gripsize\fP \fIsize\fP (number of screen units)
.br
\fB\-lightcolor\fP \fIcolor\fP (color of the light part of the 3D relief)
.br
diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n
index 2531772..404f95e 100644
--- a/doc/ttk_treeview.n
+++ b/doc/ttk_treeview.n
@@ -323,6 +323,8 @@ Use \fIpathname heading #0\fR to configure the tree column heading.
Returns a description of the specified \fIcomponent\fR
under the point given by \fIx\fR and \fIy\fR,
or the empty string if no such \fIcomponent\fR is present at that position.
+The values \fIx\fR and \fIy\fR may have any of the forms acceptable to
+\fBTk_GetPixels\fR.
The following subcommands are supported:
.RS
.TP
@@ -715,14 +717,20 @@ are:
.br
\fB\-indent\fP \fIamount\fP
.RS
-Specifies how many pixels items are indented from their parents. Defaults to 20.
+Specifies how far items are indented from their parents. Defaults to 20 pixels.
+The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
.RE
.br
-\fB\-columnseparatorwidth\fP \fIpixels\fP
+\fB\-columnseparatorwidth\fP \fIamount\fP
+.RS
+Specifies the width of column separators. Defaults to 1 pixel.
+The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
+.RE
.br
-\fB\-rowheight\fP \fIpixels\fP
+\fB\-rowheight\fP \fIamount\fP
.RS
-This is the standard height for an item.
+This is the standard height for an item. Defaults to 20 pixels.
+The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
If \fB\-rowheight\fP is not set by the style, it is set by measuring an
item and a cell layout with the style's settings.
This thus picks up the font and
diff --git a/doc/winfo.n b/doc/winfo.n
index 5651f2c..e37e0a7 100644
--- a/doc/winfo.n
+++ b/doc/winfo.n
@@ -12,23 +12,27 @@
.SH NAME
winfo \- Return window-related information
.SH SYNOPSIS
-\fBwinfo\fR \fIoption \fR?\fIarg ...\fR?
+\fBwinfo\fI option \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
The \fBwinfo\fR command is used to retrieve information about windows
managed by Tk. It can take any of a number of different forms,
depending on the \fIoption\fR argument. The legal forms are:
+.\" METHOD: atom
.TP
\fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR
+.
Returns a decimal string giving the integer identifier for the
atom whose name is \fIname\fR. If no atom exists with the name
\fIname\fR then a new one is created.
If the \fB\-displayof\fR option is given then the atom is looked
up on the display of \fIwindow\fR; otherwise it is looked up on
the display of the application's main window.
+.\" METHOD: atomname
.TP
\fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR
+.
Returns the textual name for the atom whose integer identifier is
\fIid\fR.
If the \fB\-displayof\fR option is given then the identifier is looked
@@ -36,23 +40,31 @@ up on the display of \fIwindow\fR; otherwise it is looked up on
the display of the application's main window.
This command is the inverse of the \fBwinfo atom\fR command.
It generates an error if no such atom exists.
+.\" METHOD: cells
.TP
\fBwinfo cells \fIwindow\fR
+.
Returns a decimal string giving the number of cells in the
color map for \fIwindow\fR.
+.\" METHOD: children
.TP
\fBwinfo children \fIwindow\fR
+.
Returns a list containing the path names of all the children
of \fIwindow\fR. Top-level windows are returned as children
of their logical parents. The list is in stacking order, with
the lowest window first, except for Top-level windows which
are not returned in stacking order. Use the \fBwm stackorder\fR
command to query the stacking order of Top-level windows.
+.\" METHOD: class
.TP
\fBwinfo class \fIwindow\fR
+.
Returns the class name for \fIwindow\fR.
+.\" METHOD: colormapfull
.TP
\fBwinfo colormapfull \fIwindow\fR
+.
Returns 1 if the colormap for \fIwindow\fR is known to be full, 0
otherwise. The colormap for a window is
.QW known
@@ -60,8 +72,10 @@ to be full if the last
attempt to allocate a new color on that window failed and this
application has not freed any colors in the colormap since the
failed allocation.
+.\" METHOD: containing
.TP
\fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR
+.
Returns the path name for the window containing the point given
by \fIrootX\fR and \fIrootY\fR.
\fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
@@ -79,16 +93,22 @@ or border of its highest containing toplevel in this application.
In selecting the containing window, children are given higher priority
than parents and among siblings the highest one in the stacking order is
chosen.
+.\" METHOD: depth
.TP
\fBwinfo depth \fIwindow\fR
+.
Returns a decimal string giving the depth of \fIwindow\fR (number
of bits per pixel).
+.\" METHOD: exists
.TP
\fBwinfo exists \fIwindow\fR
+.
Returns 1 if there exists a window named \fIwindow\fR, 0 if no such
window exists.
+.\" METHOD: fpixels
.TP
-\fBwinfo fpixels \fIwindow\fR \fInumber\fR
+\fBwinfo fpixels \fIwindow number\fR
+.
Returns a floating-point value giving the number of pixels
in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
\fINumber\fR may be specified in any of the forms acceptable
@@ -98,13 +118,17 @@ or
.QW 1i .
The return value may be fractional; for an integer value, use
\fBwinfo pixels\fR.
+.\" METHOD: geometry
.TP
\fBwinfo geometry \fIwindow\fR
+.
Returns the geometry for \fIwindow\fR, in the form
\fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are
in pixels.
+.\" METHOD: height
.TP
\fBwinfo height \fIwindow\fR
+.
Returns a decimal string giving \fIwindow\fR's height in pixels.
When a window is first created its height will be 1 pixel; the
height will eventually be changed by a geometry manager to fulfil
@@ -113,24 +137,32 @@ If you need the true height immediately after creating a widget,
invoke \fBupdate\fR to force the geometry manager to arrange it,
or use \fBwinfo reqheight\fR to get the window's requested height
instead of its actual height.
+.\" METHOD: id
.TP
\fBwinfo id \fIwindow\fR
+.
Returns a hexadecimal string giving a low-level platform-specific
identifier for \fIwindow\fR. On Unix platforms, this is the X
window identifier. Under Windows, this is the Windows
HWND. On the Macintosh the value has no meaning outside Tk.
+.\" METHOD: interps
.TP
\fBwinfo interps \fR?\fB\-displayof \fIwindow\fR?
+.
Returns a list whose members are the names of all Tcl interpreters
(e.g. all Tk-based applications) currently registered for a particular display.
If the \fB\-displayof\fR option is given then the return value refers
to the display of \fIwindow\fR; otherwise it refers to
the display of the application's main window.
+.\" METHOD: ismapped
.TP
\fBwinfo ismapped \fIwindow\fR
+.
Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
+.\" METHOD: manager
.TP
\fBwinfo manager \fIwindow\fR
+.
Returns the name of the geometry manager currently
responsible for \fIwindow\fR, or an empty string if \fIwindow\fR
is not managed by any geometry manager.
@@ -138,25 +170,33 @@ The name is usually the name of the Tcl command for the geometry
manager, such as \fBpack\fR or \fBplace\fR.
If the geometry manager is a widget, such as canvases or text, the
name is the widget's class command, such as \fBcanvas\fR.
+.\" METHOD: name
.TP
\fBwinfo name \fIwindow\fR
+.
Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed
to its full path name).
The command \fBwinfo name .\fR will return the name of the application.
+.\" METHOD: parent
.TP
\fBwinfo parent \fIwindow\fR
+.
Returns the path name of \fIwindow\fR's parent, or an empty string
if \fIwindow\fR is the main window of the application.
+.\" METHOD: pathname
.TP
\fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR
+.
Returns the path name of the window whose X identifier is \fIid\fR.
\fIId\fR must be a decimal, hexadecimal, or octal integer and must
correspond to a window in the invoking application.
If the \fB\-displayof\fR option is given then the identifier is looked
up on the display of \fIwindow\fR; otherwise it is looked up on
the display of the application's main window.
+.\" METHOD: pixels
.TP
-\fBwinfo pixels \fIwindow\fR \fInumber\fR
+\fBwinfo pixels \fIwindow number\fR
+.
Returns the number of pixels in \fIwindow\fR corresponding
to the distance given by \fInumber\fR.
\fINumber\fR may be specified in any of the forms acceptable
@@ -166,16 +206,20 @@ or
.QW 1i .
The result is rounded to the nearest integer value; for a
fractional result, use \fBwinfo fpixels\fR.
+.\" METHOD: pointerx
.TP
\fBwinfo pointerx \fIwindow\fR
+.
If the mouse pointer is on the same screen as \fIwindow\fR, returns the
pointer's x coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position is
measured in the virtual root.
If the mouse pointer is not on the same screen as \fIwindow\fR then
-1 is returned.
+.\" METHOD: pointerxy
.TP
\fBwinfo pointerxy \fIwindow\fR
+.
If the mouse pointer is on the same screen as \fIwindow\fR, returns a list
with two elements, which are the pointer's x and y coordinates measured
in pixels in the screen's root window.
@@ -183,80 +227,110 @@ If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer is not on the same screen as \fIwindow\fR then
both of the returned coordinates are \-1.
+.\" METHOD: pointery
.TP
\fBwinfo pointery \fIwindow\fR
+.
If the mouse pointer is on the same screen as \fIwindow\fR, returns the
pointer's y coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer is not on the same screen as \fIwindow\fR then
-1 is returned.
+.\" METHOD: reqheight
.TP
\fBwinfo reqheight \fIwindow\fR
+.
Returns a decimal string giving \fIwindow\fR's requested height,
in pixels. This is the value used by \fIwindow\fR's geometry
manager to compute its geometry.
+.\" METHOD: reqwidth
.TP
\fBwinfo reqwidth \fIwindow\fR
+.
Returns a decimal string giving \fIwindow\fR's requested width,
in pixels. This is the value used by \fIwindow\fR's geometry
manager to compute its geometry.
+.\" METHOD: rgb
.TP
\fBwinfo rgb \fIwindow color\fR
+.
Returns a list containing three decimal values in the range 0 to
65535, which are the
red, green, and blue intensities that correspond to \fIcolor\fR in
the window given by \fIwindow\fR. \fIColor\fR
may be specified in any of the forms acceptable for a color
option.
+.\" METHOD: rootx
.TP
\fBwinfo rootx \fIwindow\fR
+.
Returns a decimal string giving the x-coordinate, in the root
window of the screen, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
has no border).
+.\" METHOD: rooty
.TP
\fBwinfo rooty \fIwindow\fR
+.
Returns a decimal string giving the y-coordinate, in the root
window of the screen, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
has no border).
+.\" METHOD: screen
.TP
\fBwinfo screen \fIwindow\fR
+.
Returns the name of the screen associated with \fIwindow\fR, in
the form \fIdisplayName\fR.\fIscreenIndex\fR.
+.\" METHOD: screencells
.TP
\fBwinfo screencells \fIwindow\fR
+.
Returns a decimal string giving the number of cells in the default
color map for \fIwindow\fR's screen.
+.\" METHOD: screendepth
.TP
\fBwinfo screendepth \fIwindow\fR
+.
Returns a decimal string giving the depth of the root window
of \fIwindow\fR's screen (number of bits per pixel).
+.\" METHOD: screenheight
.TP
\fBwinfo screenheight \fIwindow\fR
+.
Returns a decimal string giving the height of \fIwindow\fR's screen,
in pixels.
+.\" METHOD: screenmmheight
.TP
\fBwinfo screenmmheight \fIwindow\fR
+.
Returns a decimal string giving the height of \fIwindow\fR's screen,
in millimeters.
+.\" METHOD: screenmmwidth
.TP
\fBwinfo screenmmwidth \fIwindow\fR
+.
Returns a decimal string giving the width of \fIwindow\fR's screen,
in millimeters.
+.\" METHOD: screenvisual
.TP
\fBwinfo screenvisual \fIwindow\fR
+.
Returns one of the following strings to indicate the default visual
class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR,
\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
\fBtruecolor\fR.
+.\" METHOD: screenwidth
.TP
\fBwinfo screenwidth \fIwindow\fR
+.
Returns a decimal string giving the width of \fIwindow\fR's screen,
in pixels.
+.\" METHOD: server
.TP
\fBwinfo server \fIwindow\fR
+.
Returns a string containing information about the server for
\fIwindow\fR's display. The exact format of this string may vary
from platform to platform. For X servers the string
@@ -266,27 +340,37 @@ where \fImajor\fR and \fIminor\fR are the version and revision
numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR
is the name of the vendor for the server, and \fIvendorRelease\fR
is an integer release number provided by the server.
+.\" METHOD: toplevel
.TP
\fBwinfo toplevel \fIwindow\fR
+.
Returns the path name of the top-of-hierarchy window containing \fIwindow\fR.
In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may
create other kinds of top-of-hierarchy widgets.
+.\" METHOD: viewable
.TP
\fBwinfo viewable \fIwindow\fR
+.
Returns 1 if \fIwindow\fR and all of its ancestors up through the
nearest toplevel window are mapped. Returns 0 if any of these
windows are not mapped.
+.\" METHOD: visual
.TP
\fBwinfo visual \fIwindow\fR
+.
Returns one of the following strings to indicate the visual
class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR,
\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
\fBtruecolor\fR.
+.\" METHOD: visualid
.TP
\fBwinfo visualid \fIwindow\fR
+.
Returns the X identifier for the visual for \fIwindow\fR.
+.\" METHOD: visualsavailable
.TP
\fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR?
+.
Returns a list whose elements describe the visuals available for
\fIwindow\fR's screen.
Each element consists of a visual class followed by an integer depth.
@@ -294,28 +378,38 @@ The class has the same form as returned by \fBwinfo visual\fR.
The depth gives the number of bits per pixel in the visual.
In addition, if the \fBincludeids\fR argument is provided, then the
depth is followed by the X identifier for the visual.
+.\" METHOD: vrootheight
.TP
\fBwinfo vrootheight \fIwindow\fR
+.
Returns the height of the virtual root window associated with \fIwindow\fR
if there is one; otherwise returns the height of \fIwindow\fR's screen.
+.\" METHOD: vrootwidth
.TP
\fBwinfo vrootwidth \fIwindow\fR
+.
Returns the width of the virtual root window associated with \fIwindow\fR
if there is one; otherwise returns the width of \fIwindow\fR's screen.
+.\" METHOD: vrootx
.TP
\fBwinfo vrootx \fIwindow\fR
+.
Returns the x-offset of the virtual root window associated with \fIwindow\fR,
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for \fIwindow\fR.
+.\" METHOD: vrooty
.TP
\fBwinfo vrooty \fIwindow\fR
+.
Returns the y-offset of the virtual root window associated with \fIwindow\fR,
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for \fIwindow\fR.
+.\" METHOD: width
.TP
\fBwinfo width \fIwindow\fR
+.
Returns a decimal string giving \fIwindow\fR's width in pixels.
When a window is first created its width will be 1 pixel; the
width will eventually be changed by a geometry manager to fulfil
@@ -324,14 +418,18 @@ If you need the true width immediately after creating a widget,
invoke \fBupdate\fR to force the geometry manager to arrange it,
or use \fBwinfo reqwidth\fR to get the window's requested width
instead of its actual width.
+.\" METHOD: x
.TP
\fBwinfo x \fIwindow\fR
+.
Returns a decimal string giving the x-coordinate, in \fIwindow\fR's
parent, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
has no border).
+.\" METHOD: y
.TP
\fBwinfo y \fIwindow\fR
+.
Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
parent, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
@@ -341,7 +439,7 @@ has no border).
Print where the mouse pointer is and what window it is currently over:
.CS
lassign [\fBwinfo pointerxy\fR .] x y
-puts \-nonewline "Mouse pointer at ($x,$y) which is "
+puts -nonewline "Mouse pointer at ($x,$y) which is "
set win [\fBwinfo containing\fR $x $y]
if {$win eq ""} {
puts "over no window"
diff --git a/doc/wish.1 b/doc/wish.1
index 115911e..468200a 100644
--- a/doc/wish.1
+++ b/doc/wish.1
@@ -14,25 +14,32 @@ wish \- Simple windowing shell
.SH SYNOPSIS
\fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR?
.SH OPTIONS
+.\" OPTION: -encoding
.IP "\fB\-encoding \fIname\fR" 20
Specifies the encoding of the text stored in \fIfileName\fR.
This option is only recognized prior to the \fIfileName\fR argument.
+.\" OPTION: -colormap
.IP "\fB\-colormap \fInew\fR" 20
Specifies that the window should have a new private colormap instead of
using the default colormap for the screen.
+.\" OPTION: -display
.IP "\fB\-display \fIdisplay\fR" 20
Display (and screen) on which to display window.
+.\" OPTION: -geometry
.IP "\fB\-geometry \fIgeometry\fR" 20
Initial geometry to use for window. If this option is specified, its
value is stored in the \fBgeometry\fR global variable of the application's
Tcl interpreter.
+.\" OPTION: -name
.IP "\fB\-name \fIname\fR" 20
Use \fIname\fR as the title to be displayed in the window, and
as the name of the interpreter for \fBsend\fR commands.
+.\" OPTION: -sync
.IP "\fB\-sync\fR" 20
Execute all X server commands synchronously, so that errors
are reported immediately. This will result in much slower
execution, but it is useful for debugging.
+.\" OPTION: -use
.IP "\fB\-use\fR \fIid\fR" 20
Specifies that the main window for the application is to be embedded in
the window whose identifier is \fIid\fR, instead of being created as an
@@ -44,10 +51,12 @@ Note that on some platforms this will only work correctly if \fIid\fR
refers to a Tk \fBframe\fR or \fBtoplevel\fR that has its
\fB\-container\fR option enabled.
.RE
+.\" OPTION: -visual
.IP "\fB\-visual \fIvisual\fR" 20
Specifies the visual to use for the window.
\fIVisual\fR may have any of the forms supported by the \fBTk_GetVisual\fR
procedure.
+.\" OPTION: --
.IP "\fB\-\|\-\fR" 20
Pass all remaining arguments through to the script's \fBargv\fR
variable without interpreting them.
@@ -117,30 +126,40 @@ file, is the same as its name except that the first letter is
capitalized.
.SH "VARIABLES"
.PP
-\fBWish\fR sets the following Tcl variables:
+\fBWish\fR sets the following global Tcl variables:
+.\" VARIABLE: argc
.TP 15
\fBargc\fR
+.
Contains a count of the number of \fIarg\fR arguments (0 if none),
not including the options described above.
+.\" VARIABLE: argv
.TP 15
\fBargv\fR
+.
Contains a Tcl list whose elements are the \fIarg\fR arguments
that follow a \fB\-\|\-\fR option or do not match any of the
options described in \fBOPTIONS\fR above, in order, or an empty string
if there are no such arguments.
+.\" VARIABLE: argv0
.TP 15
\fBargv0\fR
+.
Contains \fIfileName\fR if it was specified.
Otherwise, contains the name by which \fBwish\fR was invoked.
+.\" VARIABLE: geometry
.TP 15
\fBgeometry\fR
+.
If the \fB\-geometry\fR option is specified, \fBwish\fR copies its
value into this variable. If the variable still exists after
\fIfileName\fR has been evaluated, \fBwish\fR uses the value of
the variable in a \fBwm geometry\fR command to set the main
window's geometry.
+.\" VARIABLE: tcl_interactive
.TP 15
\fBtcl_interactive\fR
+.
Contains 1 if \fBwish\fR is reading commands interactively (\fIfileName\fR
was not specified and standard input is a terminal-like
device), 0 otherwise.
@@ -211,8 +230,24 @@ The variable \fBtcl_prompt2\fR is used in a similar way when
a newline is typed but the current command is not yet complete;
if \fBtcl_prompt2\fR is not set then no prompt is output for
incomplete commands.
+.SH ZIPVFS
+.PP
+When a zipfile is concatenated to the end of \fBwish\fR, on startup
+the contents of the zip archive will be mounted under the virtual file
+system \fB//zipfs:/\fR. If a top level directory \fBtk_library\fR is
+present in the zip archive, it will become the directory loaded as
+env(TK_LIBRARY). If a file named \fBmain.tcl\fR is present in the top
+level directory of the zip archive, it will be sourced instead of the
+shell's normal command line handing.
+.PP
+Only one zipfile can be concatenated to the end of executable image
+(tclsh, or wish). However, if multiple zipfiles are
+concatenated, only the last one is used.
+
+This filesystem is read-only. Files cannot be added or modified within
+this mounted file system. See zipfs(n) for complete details.
.SH "SEE ALSO"
-tclsh(1), toplevel(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3)
+tclsh(1), toplevel(n), zipfs(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3)
.SH KEYWORDS
application, argument, interpreter, prompt, script file, shell,
toolkit, toplevel
diff --git a/doc/wm.n b/doc/wm.n
index e53529c..5f76384 100644
--- a/doc/wm.n
+++ b/doc/wm.n
@@ -12,7 +12,7 @@
.SH NAME
wm \- Communicate with window manager
.SH SYNOPSIS
-\fBwm\fR \fIoption window \fR?\fIargs\fR?
+\fBwm\fI option window \fR?\fIargs\fR?
.BE
.SH DESCRIPTION
.PP
@@ -25,6 +25,7 @@ additional argument, \fIwindow\fR, which must be the path name of a
top-level window.
.PP
The legal forms for the \fBwm\fR command are:
+.\" METHOD: aspect
.TP
\fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR?
.
@@ -42,6 +43,7 @@ a Tcl list containing four elements, which are the current values
of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
(if no aspect restrictions are in effect, then an empty string is
returned).
+.\" METHOD: attributes
.TP
\fBwm attributes \fIwindow\fR
.TP
@@ -58,6 +60,7 @@ values are as follows:
.PP
All platforms support the following attributes (though X11 users
should see the notes below):
+.\" OPTION: -alpha
.TP
\fB\-alpha\fR
.
@@ -65,26 +68,31 @@ Specifies the alpha transparency level of the toplevel. It accepts a value
from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that
range will be constrained. Where not supported, the \fB\-alpha\fR value
remains at \fB1.0\fR.
+.\" OPTION: -fullscreen
.TP
\fB\-fullscreen\fR
.
Places the window in a mode that takes up the entire screen, has no
borders, and covers the general use area (i.e. Start menu and taskbar on
Windows, dock and menubar on OSX, general window decorations on X11).
+.\" OPTION: -topmost
.TP
\fB\-topmost\fR
.
Specifies whether this is a topmost window (displays above all other windows).
.PP
On Windows, the following attributes may be set.
+.\" OPTION: -disabled
.TP
\fB\-disabled\fR
.
Specifies whether the window is in a disabled state.
+.\" OPTION: -toolwindow
.TP
\fB\-toolwindow\fR
.
Specifies a toolwindow style window (as defined in the MSDN).
+.\" OPTION: -transparentcolor
.TP
\fB\-transparentcolor\fR
.
@@ -95,6 +103,7 @@ value accepted by \fBTk_GetColor\fR. If the empty string is specified
at \fB{}\fR.
.PP
On MacOS, the following attributes may be set.
+.\" OPTION: -appearance
.TP
\fB\-appearance\fR
.
@@ -102,6 +111,7 @@ Specifies whether the window is rendered in "dark mode". Allowed
values are \fBauto\fR, \fBaqua\fR and \fBdarkaqua\fR. If the setting
is auto then the appearance of the window is controlled by the
System Settings.
+.\" OPTION: -class
.TP
\fB\-class\fR
.
@@ -115,21 +125,25 @@ does not correspond to an existing window. Doing that causes the
class name to be cached for later use. When a toplevel with that
pathname is eventually created, the cached class name will determine which
class is used for the underlying Aqua window.
+.\" OPTION: -isdark
.TP
\fB\-isdark\fR
.
Returns a boolean value which is true if the window is currently in
dark mode.
+.\" OPTION: -modified
.TP
\fB\-modified\fR
.
Specifies the modification state of the window (determines whether the
window close widget contains the modification indicator and whether the
proxy icon is draggable).
+.\" OPTION: -notify
.TP
\fB\-notify\fR
.
Specifies process notification state (bouncing of the application dock icon).
+.\" OPTION: -stylemask
.TP
\fB\-stylemask\fR
.
@@ -143,6 +157,7 @@ bits will be set to 0. The allowed bitnames are: \fBtitled\fR,
\fBnonactivatingpanel\fR, and \fBHUDwindow\fR. Note that a side
effect of setting the fullsizecontentview bit is that the window title
bar becomes transparent.
+.\" OPTION: -tabbingid
.TP
\fB\-tabbingid\fR
.
@@ -156,6 +171,7 @@ a normal non-tabbed toplevel. It is allowed to set the tabbingid before the
toplevel is created. If the pathname provided in the command does not
correspond to a toplevel, the value will be cached and used later when
the toplevel is actually created.
+.\" OPTION: -tabbingmode
.TP
\fB\-tabbingmode\fR
.
@@ -169,11 +185,13 @@ Settings application. It is allowed to set the tabbingmode before the
toplevel is created. If the pathname provided in the command does not
correspond to a toplevel, the value will be cached and used later when
the toplevel is actually created.
+.\" OPTION: -titlepath
.TP
\fB\-titlepath\fR
.
Specifies the path of the file referenced as the window proxy icon
(which can be dragged and dropped in lieu of the file's finder icon).
+.\" OPTION: -transparent
.TP
\fB\-transparent\fR
.
@@ -185,6 +203,7 @@ color with some alpha, e.g.
On X11, the following attributes may be set. These are not supported by all
window managers, and will have no effect under older WMs.
.\" See https://www.freedesktop.org/wiki/Specifications/wm-spec/
+.\" OPTION: -type
.TP
\fB\-type\fR
.VS 8.6
@@ -195,76 +214,49 @@ entirely up to the window manager. A list of types may be used, in order of
preference. The following values are mapped to constants defined in the EWMH
specification (using others is possible, but not advised):
.RS
-.TP
-\fBdesktop\fR
-.
+.IP \fBdesktop\fR
indicates a desktop feature,
-.TP
-\fBdock\fR
-.
+.IP \fBdock\fR
indicates a dock/panel feature,
-.TP
-\fBtoolbar\fR
-.
+.IP \fBtoolbar\fR
indicates a toolbar window that should be acting on behalf of another window,
as indicated with \fBwm transient\fR,
-.TP
-\fBmenu\fR
-.
+.IP \fBmenu\fR
indicates a torn-off menu that should be acting on behalf of another window,
as indicated with \fBwm transient\fR,
-.TP
-\fButility\fR
-.
+.IP \fButility\fR
indicates a utility window (e.g., palette or toolbox) that should be acting on
behalf of another window, as indicated with \fBwm transient\fR,
-.TP
-\fBsplash\fR
-.
+.IP \fBsplash\fR
indicates a splash screen, displayed during application start up,
-.TP
-\fBdialog\fR
-.
+.IP \fBdialog\fR
indicates a general dialog window, that should be acting on behalf of another
window, as indicated with \fBwm transient\fR,
-.TP
-\fBdropdown_menu\fR
-.
+.IP \fBdropdown_menu\fR
indicates a menu summoned from a menu bar, which should usually also be set to
be override-redirected (with \fBwm overrideredirect\fR),
-.TP
-\fBpopup_menu\fR
-.
+.IP \fBpopup_menu\fR
indicates a popup menu, which should usually also be set to be
override-redirected (with \fBwm overrideredirect\fR),
-.TP
-\fBtooltip\fR
-.
+.IP \fBtooltip\fR
indicates a tooltip window, which should usually also be set to be
override-redirected (with \fBwm overrideredirect\fR),
-.TP
-\fBnotification\fR
-.
+.IP \fBnotification\fR
indicates a window that provides a background notification of some event,
which should usually also be set to be override-redirected (with \fBwm
overrideredirect\fR),
-.TP
-\fBcombo\fR
-.
+.IP \fBcombo\fR
indicates the drop-down list of a combobox widget, which should usually also
be set to be override-redirected (with \fBwm overrideredirect\fR),
-.TP
-\fBdnd\fR
-.
+.IP \fBdnd\fR
indicates a window that represents something being dragged, which should
usually also be set to be override-redirected (with
\fBwm overrideredirect\fR),
-.TP
-\fBnormal\fR
-.
+.IP \fBnormal\fR
indicates a window that has no special interpretation.
.RE
.VE 8.6
+.\" OPTION: -zoomed
.TP
\fB\-zoomed\fR
.
@@ -276,6 +268,7 @@ the value of an attribute returns the current state, which will not be the
same as the value most recently set if the window manager has not yet
processed the request or if it does not support the attribute.
.RE
+.\" METHOD: client
.TP
\fBwm client \fIwindow\fR ?\fIname\fR?
.
@@ -289,6 +282,7 @@ If \fIname\fR is not specified, the command returns the last name
set in a \fBwm client\fR command for \fIwindow\fR.
If \fIname\fR is specified as an empty string, the command deletes the
\fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR.
+.\" METHOD: colormapwindows
.TP
\fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR?
.
@@ -320,6 +314,7 @@ itself; the order of the internal windows is undefined.
See the ICCCM documentation for more information on the
\fBWM_COLORMAP_WINDOWS\fR property.
.RE
+.\" METHOD: command
.TP
\fBwm command \fIwindow\fR ?\fIvalue\fR?
.
@@ -332,6 +327,7 @@ If \fIvalue\fR is not specified then the command returns the last value
set in a \fBwm command\fR command for \fIwindow\fR.
If \fIvalue\fR is specified as an empty string, the command
deletes the \fBWM_COMMAND\fR property from \fIwindow\fR.
+.\" METHOD: deiconify
.TP
\fBwm deiconify \fIwindow\fR
.
@@ -342,6 +338,7 @@ that when the window is first mapped it will be displayed
in de-iconified form. On Windows, a deiconified window will also be
raised and be given the focus (made the active window).
Returns an empty string.
+.\" METHOD: focusmodel
.TP
\fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR?
.
@@ -362,6 +359,7 @@ the application may re-assign the focus among \fIwindow\fR's descendants.
The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command
assumes a passive model of focusing.
.RE
+.\" METHOD: forget
.TP
\fBwm forget \fIwindow\fR
.
@@ -370,6 +368,7 @@ be managed by \fBwm\fR. Windows created with the \fBtoplevel\fR
command will be treated like \fBframe\fR windows once they are no
longer managed by \fBwm\fR, however, the \fB\-menu\fR configuration will be
remembered and the menus will return once the widget is managed again.
+.\" METHOD: frame
.TP
\fBwm frame \fIwindow\fR
.
@@ -379,6 +378,7 @@ identifier for the outermost frame that contains \fIwindow\fR (the
window whose parent is the root or virtual root). If \fIwindow\fR
has not been reparented by the window manager then the command returns
the platform specific window identifier for \fIwindow\fR.
+.\" METHOD: geometry
.TP
\fBwm geometry \fIwindow\fR ?\fInewGeometry\fR?
.
@@ -423,6 +423,7 @@ reflect the addition of decorative elements to \fIwindow\fR such as title
bars, and window managers are not required to precisely follow the requests
made through this command.
.RE
+.\" METHOD: grid
.TP
\fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR?
.
@@ -455,10 +456,11 @@ four elements corresponding to the current \fIbaseWidth\fR,
\fIwindow\fR is not currently gridded, then an empty string
is returned.
.PP
-Note: this command should not be needed very often, since the
+Note that this command should not be needed very often, since the
\fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option
provide easier access to the same functionality.
.RE
+.\" METHOD: group
.TP
\fBwm group \fIwindow\fR ?\fIpathName\fR?
.
@@ -470,8 +472,9 @@ remove \fIwindow\fR from any group association. If \fIpathName\fR is
specified then the command returns an empty string; otherwise it
returns the path name of \fIwindow\fR's current group leader, or an empty
string if \fIwindow\fR is not part of any group.
+.\" METHOD: iconbadge
.TP
-\fBwm iconbadge \fIwindow\fR \fIbadge\fR
+\fBwm iconbadge \fIwindow badge\fR
.
Sets a badge for the icon of the \fIwindow\fR. The badge can be a positive
integer number, for instance the number of new or unread messages, or
@@ -482,9 +485,9 @@ of the developer.
.RS
.PP
On X11, for this command to work,
-the variable \fB::tk::icons::base_icon($window)\fR must be set to the image that is
-being used for the window icon of $window. On Windows and X11, the iconphoto
-images work best at 32x32 or a similar dimension, as
+the variable \fB::tk::icons::base_icon($window)\fR must be set to the image
+that is being used for the window icon of $window. On Windows and X11, the
+iconphoto images work best at 32x32 or a similar dimension, as
the badge images are provided by Tk and drawn to overlay the icon images
using native (Windows) API's or Tk rendering. On macOS, the icon badge is
rendered by a system API and is not provided by Tk. The icon image itself
@@ -495,12 +498,13 @@ The icon badge is intended for display in the Dock (macOS), taskbar
displayed in the Dock, regardless of how many different icon badges may be
assigned to different windows. On Windows, the taskbar display depends on
whether the taskbar buttons are combined or not (this is an OS setting
-available to the user): if combined the behavior is the same as on macOS,
+available to the user): if combined, the behavior is the same as on macOS,
otherwise each button in the taskbar shows the badge it was assigned.
Badge display on macOS is configured in the system preferences. App
panel display behavior on X11 will depend on the window manager and/or
desktop environment.
.RE
+.\" METHOD: iconbitmap
.TP
\fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR?
.
@@ -530,12 +534,14 @@ first test if the file contains an icon, then if it has an assigned
icon, and finally, if that fails, test for
a bitmap.
.RE
+.\" METHOD: iconify
.TP
\fBwm iconify \fIwindow\fR
.
Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR has not
yet been mapped for the first time, this command will arrange for
it to appear in the iconified state when it is eventually mapped.
+.\" METHOD: iconmask
.TP
\fBwm iconmask \fIwindow\fR ?\fIbitmap\fR?
.
@@ -551,6 +557,7 @@ a bitmap of all ones). If \fIbitmap\fR is specified
then the command returns an empty string. Otherwise it
returns the name of the current icon mask associated with
\fIwindow\fR, or an empty string if no mask is in effect.
+.\" METHOD: iconname
.TP
\fBwm iconname \fIwindow\fR ?\fInewName\fR?
.
@@ -562,6 +569,7 @@ then the command returns the current icon name for \fIwindow\fR,
or an empty string if no icon name has been specified (in this
case the window manager will normally display the window's title,
as specified with the \fBwm title\fR command).
+.\" METHOD: iconphoto
.TP
\fBwm iconphoto \fIwindow\fR ?\fB\-default\fR? \fIimage1\fR ?\fIimage2 ...\fR?
.
@@ -592,6 +600,7 @@ parameters as support for multiple sizes/resolutions on macOS is outside Tk's
scope. Developers should use the largest icon they can support
(preferably 512 pixels) to ensure smooth rendering on the Mac.
.RE
+.\" METHOD: iconposition
.TP
\fBwm iconposition \fIwindow\fR ?\fIx y\fR?
.
@@ -602,6 +611,7 @@ specified as empty strings then any existing icon position hint is cancelled.
If neither \fIx\fR nor \fIy\fR is specified, then the command returns
a Tcl list containing two values, which are the current icon position
hints (if no hints are in effect then an empty string is returned).
+.\" METHOD: iconwindow
.TP
\fBwm iconwindow \fIwindow\fR ?\fIpathName\fR?
.
@@ -619,7 +629,9 @@ Button press events are disabled for \fIwindow\fR as long as it is
an icon window; this is needed in order to allow window managers to
.QW own
those events.
-Note: not all window managers support the notion of an icon window.
+Note that not all window managers support the notion of an icon window, and
+the concept is entirely meaningless on non-X11 platforms.
+.\" METHOD: manage
.TP
\fBwm manage \fIwidget\fR
.
@@ -629,6 +641,7 @@ window will be decorated with the window managers title bar, etc. Only
with this command. Attempting to pass any other widget type will raise
an error. Attempting to manage a \fItoplevel\fR widget is benign and
achieves nothing. See also \fBGEOMETRY MANAGEMENT\fR.
+.\" METHOD: maxsize
.TP
\fBwm maxsize \fIwindow\fR ?\fIwidth height\fR?
.
@@ -644,6 +657,7 @@ it returns a Tcl list with two elements, which are the
maximum width and height currently in effect.
The maximum size defaults to the size of the screen.
See the sections on geometry management below for more information.
+.\" METHOD: minsize
.TP
\fBwm minsize \fIwindow\fR ?\fIwidth height\fR?
.
@@ -659,6 +673,7 @@ it returns a Tcl list with two elements, which are the
minimum width and height currently in effect.
The minimum size defaults to one pixel in each dimension.
See the sections on geometry management below for more information.
+.\" METHOD: overrideredirect
.TP
\fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR?
.
@@ -679,6 +694,7 @@ when the window is first mapped or when mapped after the state is changed from
withdrawn to normal. Some, but not all, platforms will take notice at
additional times.
.RE
+.\" METHOD: positionfrom
.TP
\fBwm positionfrom \fIwindow\fR ?\fIwho\fR?
.
@@ -700,6 +716,7 @@ as equivalent to \fBprogram\fR.
Tk will automatically set the position source to \fBuser\fR
when a \fBwm geometry\fR command is invoked, unless the source has
been set explicitly to \fBprogram\fR.
+.\" METHOD: protocol
.TP
\fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR?
.
@@ -747,6 +764,7 @@ Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the
\fBwm protocol\fR command returns a list of all of the protocols for which
handlers are currently defined for \fIwindow\fR.
.RE
+.\" METHOD: resizable
.TP
\fBwm resizable \fIwindow\fR ?\fIwidth height\fR?
.
@@ -763,6 +781,7 @@ If resizing is disabled, then the window's size will be the size
from the most recent interactive resize or \fBwm geometry\fR
command. If there has been no such operation then
the window's natural size will be used.
+.\" METHOD: sizefrom
.TP
\fBwm sizefrom \fIwindow\fR ?\fIwho\fR?
.
@@ -781,6 +800,7 @@ source of the window's current size, or an empty string if
no source has been specified yet. Most window managers interpret
.QW "no source"
as equivalent to \fBprogram\fR.
+.\" METHOD: stackorder
.TP
\fBwm stackorder \fIwindow\fR ?\fBisabove\fR|\fBisbelow \fIwindow\fR?
.
@@ -795,6 +815,7 @@ When two window arguments separated by either \fBisabove\fR or
\fBisbelow\fR are passed, a boolean result indicates whether
or not the first window is currently above or below the second
window in the stacking order.
+.\" METHOD: state
.TP
\fBwm state \fIwindow\fR ?newstate?
.
@@ -807,6 +828,7 @@ The difference between \fBiconic\fR and \fBicon\fR is that
\fBwm iconify\fR command) while \fBicon\fR refers to a window whose only
purpose is to serve as the icon for some other window (via the \fBwm
iconwindow\fR command). The \fBicon\fR state cannot be set.
+.\" METHOD: title
.TP
\fBwm title \fIwindow\fR ?\fIstring\fR?
.
@@ -816,6 +838,7 @@ should display this string in \fIwindow\fR's title bar). In this
case the command returns an empty string. If \fIstring\fR is not
specified then the command returns the current title for the
\fIwindow\fR. The title for a window defaults to its name.
+.\" METHOD: transient
.TP
\fBwm transient \fIwindow\fR ?\fIcontainer\fR?
.
@@ -834,6 +857,7 @@ transient of itself. The window manager may also decorate a transient
window differently, removing some features normally present (e.g.,
minimize and maximize buttons) though this is entirely at the
discretion of the window manager.
+.\" METHOD: widthdraw
.TP
\fBwm withdraw \fIwindow\fR
.
@@ -844,7 +868,7 @@ has never been mapped, then this command
causes the window to be mapped in the withdrawn state. Not all
window managers appear to know how to handle windows that are
mapped in the withdrawn state.
-Note: it sometimes seems to be necessary to withdraw a
+Note that it sometimes seems to be necessary to withdraw a
window and then re-map it (e.g. with \fBwm deiconify\fR) to get some
window managers to pay attention to changes in window attributes
such as group.
@@ -942,10 +966,10 @@ A simple dialog-like window, centred on the screen:
.CS
# Create and arrange the dialog contents.
toplevel .msg
-label .msg.l \-text "This is a very simple dialog demo."
-button .msg.ok \-text OK \-default active \-command {destroy .msg}
-pack .msg.ok \-side bottom \-fill x
-pack .msg.l \-expand 1 \-fill both
+label .msg.l -text "This is a very simple dialog demo."
+button .msg.ok -text OK -default active -command {destroy .msg}
+pack .msg.ok -side bottom -fill x
+pack .msg.l -expand 1 -fill both
# Now set the widget up as a centred dialog.
@@ -954,8 +978,8 @@ pack .msg.l \-expand 1 \-fill both
# event loop with the widget hidden completely...
\fBwm withdraw\fR .msg
update
-set x [expr {([winfo screenwidth .]\-[winfo width .msg])/2}]
-set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}]
+set x [expr {([winfo screenwidth .] - [winfo width .msg]) / 2}]
+set y [expr {([winfo screenheight .] - [winfo height .msg]) / 2}]
\fBwm geometry\fR .msg +$x+$y
\fBwm transient\fR .msg .
\fBwm title\fR .msg "Dialog demo"
@@ -964,7 +988,8 @@ set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}]
.SH "SEE ALSO"
toplevel(n), winfo(n)
.SH KEYWORDS
-aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
+aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify,
+increments, position, size, title, top-level window, units, window manager
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/generic/tk.decls b/generic/tk.decls
index 3c94054..d1b5ffb 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -146,7 +146,7 @@ declare 28 {
declare 29 {
int Tk_ConfigureWidget(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- Tcl_Size argc, const char **argv, void *widgRec,
+ Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec,
int flags)
}
declare 30 {
@@ -326,9 +326,6 @@ declare 75 {
declare 76 {
void Tk_FreeTextLayout(Tk_TextLayout textLayout)
}
-declare 77 {deprecated {function does nothing, call can be removed}} {
- void Tk_FreeXId(Display *display, XID xid)
-}
declare 78 {
GC Tk_GCForColor(XColor *colorPtr, Drawable drawable)
}
@@ -475,9 +472,6 @@ declare 117 {
void Tk_ImageChanged(Tk_ImageModel model, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
-declare 118 {
- int Tk_Init(Tcl_Interp *interp)
-}
declare 119 {
Atom Tk_InternAtom(Tk_Window tkwin, const char *name)
}
@@ -564,32 +558,15 @@ declare 143 {
Tk_Window tkwin, int *argcPtr, const char **argv,
const Tk_ArgvInfo *argTable, int flags)
}
-declare 144 {deprecated {function signature changed}} {
- void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height)
-}
-declare 145 {deprecated {function signature changed}} {
- void Tk_PhotoPutZoomedBlock_NoComposite(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY)
-}
declare 146 {
int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)
}
declare 147 {
void Tk_PhotoBlank(Tk_PhotoHandle handle)
}
-declare 148 {deprecated {function signature changed}} {
- void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height )
-}
declare 149 {
void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)
}
-declare 150 {deprecated {function signature changed}} {
- void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height)
-}
declare 151 {
int Tk_PointToChar(Tk_TextLayout layout, int x, int y)
}
@@ -617,9 +594,6 @@ declare 158 {
Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc,
void *arg, void **prevArgPtr)
}
-declare 159 {
- int Tk_SafeInit(Tcl_Interp *interp)
-}
declare 160 {
const char *Tk_SetAppName(Tk_Window tkwin, const char *name)
}
@@ -805,10 +779,6 @@ declare 211 {
int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin)
}
-declare 212 {nostub {Don't use this function in a stub-enabled extension}} {
- TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc,
- Tcl_Interp *interp)
-}
declare 213 {
void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr)
}
@@ -821,9 +791,6 @@ declare 214 {
declare 215 {
void Tk_InitConsoleChannels(Tcl_Interp *interp)
}
-declare 216 {
- int Tk_CreateConsoleWindow(Tcl_Interp *interp)
-}
declare 217 {
void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method)
}
@@ -943,17 +910,6 @@ declare 244 {
declare 245 {
void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
}
-declare 246 {deprecated {function signature changed}} {
- void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int compRule)
-}
-declare 247 {deprecated {function signature changed}} {
- void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY, int compRule)
-}
declare 248 {
int Tk_CollapseMotionEvents(Display *display, int collapse)
}
@@ -989,12 +945,6 @@ declare 256 {
declare 257 {
Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
}
-declare 258 {
- Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr)
-}
-declare 259 {
- void Tk_FreeStyleFromObj(Tcl_Obj *objPtr)
-}
declare 260 {
Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId,
Tk_OptionTable optionTable)
@@ -1052,23 +1002,6 @@ declare 271 {
Tcl_Interp *Tk_Interp(Tk_Window tkwin)
}
-# Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional
-# means to continue support for extensions using the USE_OLD_IMAGE to
-# continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats.
-#
-# Note that this restores the usual rules for stub compatibility. Stub-enabled
-# extensions compiled against 8.5 headers and linked to the 8.5 stub library
-# will produce a file [load]able into an interp with Tk 8.X, for X >= 5.
-# It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!).
-# Developers who need to produce a file [load]able into legacy interps must
-# build against legacy sources.
-declare 272 {
- void Tk_CreateOldImageType(const Tk_ImageType *typePtr)
-}
-declare 273 {
- void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr)
-}
-
# TIP#580
declare 274 {
int Tk_AlwaysShowSelection(Tk_Window tkwin)
@@ -1155,27 +1088,12 @@ declare 2 win {
declare 3 win {
Tk_Window Tk_HWNDToWindow(HWND hwnd)
}
-declare 4 win {
- void Tk_PointerEvent(HWND hwnd, int x, int y)
-}
-declare 5 win {
- int Tk_TranslateWinEvent(HWND hwnd,
- UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
-}
################################
# Aqua specific functions
-# Stub removed because the function no longer exists.
-#declare 3 aqua {
-# void TkMacOSXInitMenus(Tcl_Interp *interp)
-#}
declare 4 aqua {
void TkMacOSXInitAppleEvents(Tcl_Interp *interp)
}
-declare 5 aqua {
- void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width,
- int height, int flags)
-}
declare 6 aqua {
void TkMacOSXInvalClipRgns(Tk_Window tkwin)
}
@@ -1216,11 +1134,11 @@ export {
int exact)
}
export {
- TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc,
+ void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp)
}
export {
- TCL_NORETURN1 void Tk_MainExW(Tcl_Size argc, wchar_t **argv,
+ void Tk_MainExW(Tcl_Size argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
}
diff --git a/generic/tk.h b/generic/tk.h
index 8401d14..016ea26 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -17,8 +17,8 @@
#define _TK
#include <tcl.h>
-#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
-# error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better
+#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7)
+# error Tk 9.0 must be compiled with tcl.h from Tcl 8.7 or better
#endif
#ifndef EXTERN
@@ -66,17 +66,16 @@ extern "C" {
*/
#ifndef TK_MAJOR_VERSION
-# define TK_MAJOR_VERSION 8
+# define TK_MAJOR_VERSION 9
#endif
-#if TK_MAJOR_VERSION != 8
-# error "This header-file is for Tk 8 only"
-#endif
-#define TK_MINOR_VERSION 7
-#define TK_RELEASE_LEVEL TCL_BETA_RELEASE
-#define TK_RELEASE_SERIAL 1
-
-#define TK_VERSION "8.7"
-#define TK_PATCH_LEVEL "8.7b1"
+#if TK_MAJOR_VERSION == 9
+# define TK_MINOR_VERSION 0
+# define TK_RELEASE_LEVEL TCL_BETA_RELEASE
+# define TK_RELEASE_SERIAL 3
+
+# define TK_VERSION "9.0"
+# define TK_PATCH_LEVEL "9.0b3"
+#endif /* TK_MAJOR_VERSION */
/*
* A special definition used to allow this header file to be included from
@@ -146,15 +145,6 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement;
*/
typedef const char *Tk_Uid;
-
-#if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
-# ifndef Tcl_Size
-# define Tcl_Size int
-# endif
-# define TCL_SIZE_MAX INT_MAX
-# define TCL_SIZE_MODIFIER ""
-# define TCL_ENCODING_PROFILE_TCL8 0x01000000
-#endif
/*
*----------------------------------------------------------------------
@@ -282,15 +272,6 @@ typedef struct Tk_ObjCustomOption {
} Tk_ObjCustomOption;
/*
- * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
- * Computes number of bytes from beginning of structure to a given field.
- */
-
-#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) && !defined(BUILD_tk)
-# define Tk_Offset(type, field) ((int) offsetof(type, field))
-#endif
-
-/*
* The following two structures are used for error handling. When config
* options are being modified, the old values are saved in a Tk_SavedOptions
* structure. If an error occurs, then the contents of the structure can be
@@ -305,8 +286,8 @@ typedef struct Tk_SavedOption {
Tcl_Obj *valuePtr; /* The old value of the option, in the form of
* a Tcl object; may be NULL if the value was
* not saved as an object. */
-#if TCL_MAJOR_VERSION < 9
- double internalForm; /* The old value of the option, in some
+#if TCL_MAJOR_VERSION > 8
+ long double internalForm; /* The old value of the option, in some
* internal representation such as an int or
* (XColor *). Valid only if the field
* optionPtr->specPtr->objOffset is -1. The
@@ -317,7 +298,7 @@ typedef struct Tk_SavedOption {
* guarantees that the field is properly aligned
* for storing large values. */
#else
- long double internalForm;
+ double internalForm;
#endif
} Tk_SavedOption;
@@ -435,9 +416,6 @@ typedef enum {
#define TK_CONFIG_COLOR_ONLY (1 << 1)
#define TK_CONFIG_MONO_ONLY (1 << 2)
#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3)
-#ifndef TK_NO_DEPRECATED
-# define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
-#endif /* !TK_NO_DEPRECATED */
#if TCL_MAJOR_VERSION > 8
# define TK_CONFIG_NULL_OK TCL_NULL_OK
#else
@@ -779,10 +757,6 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
(((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE)
#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
-#ifndef TK_NO_DEPRECATED
-#define Tk_InternalBorderWidth(tkwin) \
- (((Tk_FakeWin *) (tkwin))->internalBorderLeft)
-#endif /* !TK_NO_DEPRECATED */
#define Tk_InternalBorderLeft(tkwin) \
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
#define Tk_InternalBorderRight(tkwin) \
@@ -1035,18 +1009,6 @@ typedef struct Tk_Item {
* lines, circles, etc.) that can form part of a canvas widget.
*/
-#if defined(USE_OLD_CANVAS) && TCL_MAJOR_VERSION < 9
-typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, Tcl_Size argc, char **argv);
-typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, Tcl_Size argc, char **argv, int flags);
-typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, Tcl_Size argc, char **argv);
-typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
- int beforeThis, char *string);
-typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, char *indexString, int *indexPtr);
-#else
typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]);
typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
@@ -1058,7 +1020,6 @@ typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
Tcl_Size beforeThis, Tcl_Obj *string);
typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr);
-#endif /* USE_OLD_CANVAS */
typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
Display *display);
typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
@@ -1107,9 +1068,7 @@ typedef struct Tk_ItemType {
* type. */
Tk_ItemDisplayProc *displayProc;
/* Procedure to display items of this type. */
- int alwaysRedraw; /* Non-zero means displayProc should be called
- * even when the item has been moved
- * off-screen. */
+ int flags; /* Combination of TK_ALWAYS_REDRAW/TK_MOVABLE_POINTS */
Tk_ItemPointProc *pointProc;/* Computes distance from item to a given
* point. */
Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside,
@@ -1146,8 +1105,7 @@ typedef struct Tk_ItemType {
} Tk_ItemType;
/*
- * Flag (used in the alwaysRedraw field) to say whether an item supports
- * point-level manipulation like the line and polygon items.
+ * Possible flags for 'flags' field.
*/
#define TK_ALWAYS_REDRAW 1 /* item should be redrawn always*/
@@ -1262,15 +1220,9 @@ typedef struct Tk_Outline {
*/
typedef struct Tk_ImageType Tk_ImageType;
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE)
-typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, Tcl_Size argc,
- char **argv, Tk_ImageType *typePtr, Tk_ImageModel model,
- void **clientDataPtr);
-#else
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc,
Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model,
void **clientDataPtr);
-#endif /* USE_OLD_IMAGE */
typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData);
typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display,
Drawable drawable, int imageX, int imageY, int width, int height,
@@ -1365,22 +1317,6 @@ typedef struct Tk_PhotoImageBlock {
*/
typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
-#ifdef USE_OLD_IMAGE
-typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName,
- char *formatString, int *widthPtr, int *heightPtr);
-typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString,
- int *widthPtr, int *heightPtr);
-typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan,
- char *fileName, char *formatString, Tk_PhotoHandle imageHandle,
- int destX, int destY, int width, int height, int srcX, int srcY);
-typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string,
- char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY,
- int width, int height, int srcX, int srcY);
-typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName,
- char *formatString, Tk_PhotoImageBlock *blockPtr);
-typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp,
- Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr);
-#else
typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName,
Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp);
typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format,
@@ -1395,7 +1331,6 @@ typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName,
Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format,
Tk_PhotoImageBlock *blockPtr);
-#endif /* USE_OLD_IMAGE */
/*
* The following alternate definitions are used with the Tk8.7 file format
@@ -1569,46 +1504,6 @@ typedef struct Tk_ElementSpec {
*----------------------------------------------------------------------
*/
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-#define TK_READABLE TCL_READABLE
-#define TK_WRITABLE TCL_WRITABLE
-#define TK_EXCEPTION TCL_EXCEPTION
-
-#define TK_DONT_WAIT TCL_DONT_WAIT
-#define TK_X_EVENTS TCL_WINDOW_EVENTS
-#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS
-#define TK_FILE_EVENTS TCL_FILE_EVENTS
-#define TK_TIMER_EVENTS TCL_TIMER_EVENTS
-#define TK_IDLE_EVENTS TCL_IDLE_EVENTS
-#define TK_ALL_EVENTS TCL_ALL_EVENTS
-
-#define Tk_IdleProc Tcl_IdleProc
-#define Tk_FileProc Tcl_FileProc
-#define Tk_TimerProc Tcl_TimerProc
-#define Tk_TimerToken Tcl_TimerToken
-
-#define Tk_BackgroundError Tcl_BackgroundError
-#define Tk_CancelIdleCall Tcl_CancelIdleCall
-#define Tk_CreateFileHandler Tcl_CreateFileHandler
-#define Tk_CreateTimerHandler Tcl_CreateTimerHandler
-#define Tk_DeleteFileHandler Tcl_DeleteFileHandler
-#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler
-#define Tk_DoOneEvent Tcl_DoOneEvent
-#define Tk_DoWhenIdle Tcl_DoWhenIdle
-#define Tk_Sleep Tcl_Sleep
-
-/* Additional stuff that has moved to Tcl: */
-
-#define Tk_EventuallyFree Tcl_EventuallyFree
-#define Tk_FreeProc Tcl_FreeProc
-#define Tk_Preserve Tcl_Preserve
-#define Tk_Release Tcl_Release
-
-/* Related to USE_OLD_IMAGE: */
-
-#define Tk_InitImageArgs(interp, argc, argv) /**/
-#endif
-
/* Removed Tk_Main, use macro instead */
#if defined(_WIN32) || defined(__CYGWIN__)
#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
@@ -1657,58 +1552,6 @@ typedef Tcl_Size (Tk_SelectionProc) (void *clientData, Tcl_Size offset,
#include "tkDecls.h"
-#ifdef USE_OLD_IMAGE
-#undef Tk_CreateImageType
-#define Tk_CreateImageType Tk_CreateOldImageType
-#undef Tk_CreatePhotoImageFormat
-#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
-#endif /* USE_OLD_IMAGE */
-
-/*
- *----------------------------------------------------------------------
- *
- * Allow users to say that they don't want to alter their source to add extra
- * arguments to Tk_PhotoPutBlock() et al.
- *
- * This goes after the inclusion of the stubbed-decls so that the declarations
- * of what is actually there can be correct.
- */
-
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
-# ifdef Tk_PhotoPutBlock
-# undef Tk_PhotoPutBlock
-# endif
-# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite
-# ifdef Tk_PhotoPutZoomedBlock
-# undef Tk_PhotoPutZoomedBlock
-# endif
-# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite
-# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE
-#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
-# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
-# ifdef Tk_PhotoPutBlock
-# undef Tk_PhotoPutBlock
-# endif
-# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic
-# ifdef Tk_PhotoPutZoomedBlock
-# undef Tk_PhotoPutZoomedBlock
-# endif
-# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic
-# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
-#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
-#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
-# ifdef Tk_PhotoExpand
-# undef Tk_PhotoExpand
-# endif
-# define Tk_PhotoExpand Tk_PhotoExpand_Panic
-# ifdef Tk_PhotoSetSize
-# undef Tk_PhotoSetSize
-# endif
-# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic
-#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
-#endif /* !TK_NO_DEPRECATED */
-
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkBind.c b/generic/tkBind.c
index cc97fde..207ceae 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -5287,7 +5287,7 @@ TkStringToKeysym(
#endif /* REDO_KEYSYM_LOOKUP */
int keysym;
- size_t len = TkUtfToUniChar(name, &keysym);
+ size_t len = Tcl_UtfToUniChar(name, &keysym);
if (name[len] == '\0') {
if (!Tcl_UniCharIsPrint(keysym)) {
/* This form not supported */
@@ -5371,7 +5371,7 @@ TkKeysymToString(
&& ((unsigned)(keysym - 0x100007F) > 0x20)) {
char buf[10];
if (Tcl_UniCharIsPrint(keysym-0x1000000)) {
- buf[TkUniCharToUtf(keysym - 0x1000000, buf)] = '\0';
+ buf[Tcl_UniCharToUtf(keysym - 0x1000000, buf)] = '\0';
} else if (keysym >= 0x1010000) {
snprintf(buf, sizeof(buf), "U%08X", (int)(keysym - 0x1000000));
} else {
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index c197ff8..03a3b99 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -234,7 +234,7 @@ Tk_ItemType tkArcType = {
ArcCoords, /* coordProc */
DeleteArc, /* deleteProc */
DisplayArc, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
ArcToPoint, /* pointProc */
ArcToArea, /* areaProc */
ArcToPostscript, /* postscriptProc */
@@ -452,7 +452,7 @@ ConfigureArc(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
+ objv, arcPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 1bbf566..6915282 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -128,7 +128,7 @@ Tk_ItemType tkBitmapType = {
BitmapCoords, /* coordProc */
DeleteBitmap, /* deleteProc */
DisplayBitmap, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
BitmapToPoint, /* pointProc */
BitmapToArea, /* areaProc */
BitmapToPostscript, /* postscriptProc */
@@ -324,7 +324,7 @@ ConfigureBitmap(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
+ objv, bmapPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 46fc288..38f758f 100644
--- a/generic/tkCanvImg.c
+++ b/generic/tkCanvImg.c
@@ -116,7 +116,7 @@ Tk_ItemType tkImageType = {
ImageCoords, /* coordProc */
DeleteImage, /* deleteProc */
DisplayImage, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
ImageToPoint, /* pointProc */
ImageToArea, /* areaProc */
ImageToPostscript, /* postscriptProc */
@@ -302,7 +302,7 @@ ConfigureImage(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
+ objv, imgPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index 7897705..4a8c419 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -234,7 +234,7 @@ Tk_ItemType tkLineType = {
LineCoords, /* coordProc */
DeleteLine, /* deleteProc */
DisplayLine, /* displayProc */
- TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
+ TK_MOVABLE_POINTS, /* flags */
LineToPoint, /* pointProc */
LineToArea, /* areaProc */
LineToPostscript, /* postscriptProc */
@@ -485,7 +485,7 @@ ConfigureLine(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
+ objv, linePtr, flags)) {
return TCL_ERROR;
}
@@ -704,10 +704,10 @@ ComputeLineBbox(
width = 1.0;
}
if (linePtr->arrow != ARROWS_NONE) {
- if (linePtr->arrow != ARROWS_LAST) {
+ if (linePtr->arrow != ARROWS_LAST && linePtr->firstArrowPtr) {
TkIncludePoint((Tk_Item *) linePtr, linePtr->firstArrowPtr);
}
- if (linePtr->arrow != ARROWS_FIRST) {
+ if (linePtr->arrow != ARROWS_FIRST && linePtr->lastArrowPtr) {
TkIncludePoint((Tk_Item *) linePtr, linePtr->lastArrowPtr);
}
}
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 400e4c5..f40a922 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -199,7 +199,7 @@ Tk_ItemType tkPolygonType = {
PolygonCoords, /* coordProc */
DeletePolygon, /* deleteProc */
DisplayPolygon, /* displayProc */
- TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
+ TK_MOVABLE_POINTS, /* flags */
PolygonToPoint, /* pointProc */
PolygonToArea, /* areaProc */
PolygonToPostscript, /* postscriptProc */
@@ -446,7 +446,7 @@ ConfigurePolygon(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
+ objv, polyPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index af2718b..856bb4e 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -236,8 +236,8 @@ TkCanvPostscriptObjCmd(
psInfo.prolog = 1;
psInfo.tkwin = tkwin;
Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS);
- result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, (const char **)objv+2,
- (char *) &psInfo, TK_CONFIG_ARGV_ONLY|TK_CONFIG_OBJS);
+ result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, objv+2,
+ &psInfo, TK_CONFIG_ARGV_ONLY);
if (result != TCL_OK) {
goto cleanup;
}
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 6ab7911..285adcd 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -150,11 +150,7 @@ UnderlinePrintProc(
char *p;
if (underline == INT_MIN) {
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- p = (char *)"-1";
-#else
p = (char *)"";
-#endif
*freeProcPtr = TCL_STATIC;
return p;
} else if (underline == INT_MAX) {
@@ -276,7 +272,7 @@ Tk_ItemType tkTextType = {
TextCoords, /* coordProc */
DeleteText, /* deleteProc */
DisplayCanvText, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
TextToPoint, /* pointProc */
TextToArea, /* areaProc */
TextToPostscript, /* postscriptProc */
@@ -498,7 +494,7 @@ ConfigureText(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
+ objv, textPtr, flags)) {
return TCL_ERROR;
}
@@ -594,7 +590,7 @@ ConfigureText(
*/
textPtr->numBytes = strlen(textPtr->text);
- textPtr->numChars = TkNumUtfChars(textPtr->text, textPtr->numBytes);
+ textPtr->numChars = Tcl_NumUtfChars(textPtr->text, textPtr->numBytes);
if (textInfoPtr->selItemPtr == itemPtr) {
if (textInfoPtr->selectFirst >= textPtr->numChars) {
@@ -1119,7 +1115,7 @@ TextInsert(
ckfree(text);
textPtr->text = newStr;
- charsAdded = TkNumUtfChars(string, byteCount);
+ charsAdded = Tcl_NumUtfChars(string, byteCount);
textPtr->numChars += charsAdded;
textPtr->numBytes += byteCount;
@@ -1189,8 +1185,8 @@ TextDeleteChars(
}
charsRemoved = last + 1 - first;
- byteIndex = TkUtfAtIndex(text, first) - text;
- byteCount = TkUtfAtIndex(text + byteIndex, charsRemoved)
+ byteIndex = Tcl_UtfAtIndex(text, first) - text;
+ byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved)
- (text + byteIndex);
newStr = (char *)ckalloc(textPtr->numBytes + 1 - byteCount);
@@ -1612,8 +1608,8 @@ GetSelText(
return 0;
}
text = textPtr->text;
- selStart = TkUtfAtIndex(text, textInfoPtr->selectFirst);
- selEnd = TkUtfAtIndex(selStart,
+ selStart = Tcl_UtfAtIndex(text, textInfoPtr->selectFirst);
+ selEnd = Tcl_UtfAtIndex(selStart,
textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst);
if (selEnd <= selStart + offset) {
return 0;
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index 38754d8..1187613 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.c
@@ -120,7 +120,7 @@ Tk_ItemType tkWindowType = {
WinItemCoords, /* coordProc */
DeleteWinItem, /* deleteProc */
DisplayWinItem, /* displayProc */
- TK_ALWAYS_REDRAW|TK_CONFIG_OBJS, /* flags */
+ TK_ALWAYS_REDRAW, /* flags */
WinItemToPoint, /* pointProc */
WinItemToArea, /* areaProc */
WinItemToPostscript, /* postscriptProc */
@@ -316,7 +316,7 @@ ConfigureWinItem(
oldWindow = winItemPtr->tkwin;
canvasTkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc,
- (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
+ objv, winItemPtr, flags)) {
return TCL_ERROR;
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 38a297d..879cf27 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -260,9 +260,6 @@ static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr,
Tcl_Obj *const *objv, Tk_Uid uid, int enclosed);
static double GridAlign(double coord, double spacing);
-#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9)
-static const char** TkGetStringsFromObjs(Tcl_Size objc, Tcl_Obj *const *objv);
-#endif
static void InitCanvas(void);
static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr);
static Tcl_Obj * ScrollFractions(int screen1,
@@ -328,7 +325,7 @@ static inline int
AlwaysRedraw(
Tk_Item *itemPtr)
{
- return itemPtr->typePtr->alwaysRedraw & 1;
+ return itemPtr->typePtr->flags & TK_ALWAYS_REDRAW;
}
static inline int
@@ -339,25 +336,9 @@ ItemConfigure(
Tcl_Obj *const objv[])
{
Tcl_Interp *interp = canvasPtr->interp;
- int result;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc, objv);
-
- result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
- }
- return result;
+ return itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY);
}
static inline int
@@ -394,21 +375,9 @@ ItemCoords(
if (itemPtr->typePtr->coordProc == NULL) {
result = TCL_OK;
- } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, objv);
} else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc, objv);
-
result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc, (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
+ itemPtr, objc, objv);
}
return result;
}
@@ -422,25 +391,9 @@ ItemCreate(
Tcl_Obj *const objv[])
{
Tcl_Interp *interp = canvasPtr->interp;
- int result;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
+ return itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
itemPtr, objc-3, objv+3);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- const char **args = TkGetStringsFromObjs(objc-3, objv+3);
-
- result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc-3, (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree(args);
- }
-#endif
- }
- return result;
}
static inline void
@@ -494,18 +447,9 @@ ItemIndex(
if (itemPtr->typePtr->indexProc == NULL) {
return TCL_OK;
- } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objPtr, indexPtr);
- } else {
-#if defined(TK_NO_DEPRECATED)
- Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (char *)NULL);
- return TCL_ERROR;
-#else
- return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr);
-#endif
}
+ return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objPtr, indexPtr);
}
static inline void
@@ -515,17 +459,8 @@ ItemInsert(
int beforeThis,
Tcl_Obj *toInsert)
{
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
- beforeThis, toInsert);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
- beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert));
-#endif
- }
+ itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
+ beforeThis, toInsert);
}
static inline int
@@ -1232,7 +1167,7 @@ CanvasWidgetCmd(
*/
if (itemPtr == NULL ||
- !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) {
+ !(itemPtr->typePtr->flags & TK_MOVABLE_POINTS)) {
continue;
}
@@ -2326,8 +2261,8 @@ ConfigureCanvas(
Tk_State old_canvas_state=canvasPtr->canvas_state;
if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
- objc, (const char **) objv, (char *) canvasPtr,
- flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objc, objv, canvasPtr,
+ flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -3365,8 +3300,8 @@ CanvasEventProc(
/*
* Special hack: if the canvas is unmapped, then must notify all items
- * with "alwaysRedraw" set, so that they know that they are no longer
- * displayed.
+ * with flag TK_ALWAYS_REDRAW set, so that they know that they are no
+ * longer displayed.
*/
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
@@ -6103,43 +6038,7 @@ CanvasSetOrigin(
canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin),
canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin));
}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkGetStringsFromObjs --
- *
- * Results:
- * Converts object list into string list.
- *
- * Side effects:
- * Memory is allocated for the objv array, which must be freed using
- * ckfree() when no longer needed.
- *
- *----------------------------------------------------------------------
- */
-
-#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9)
-static const char **
-TkGetStringsFromObjs(
- Tcl_Size objc,
- Tcl_Obj *const objv[])
-{
- Tcl_Size i;
- const char **argv;
- if (objc <= 0) {
- return NULL;
- }
- argv = (const char **)ckalloc((objc+1) * sizeof(char *));
- for (i = 0; i < objc; i++) {
- argv[i] = Tcl_GetString(objv[i]);
- }
- argv[objc] = 0;
- return argv;
-}
-#endif
-
/*
*--------------------------------------------------------------
*
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index aaa6be4..00f8a09 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -100,7 +100,7 @@ Tk_BellObjCmd(
};
enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE };
Tk_Window tkwin = (Tk_Window)clientData;
- int i;
+ Tcl_Size i;
int index, nice = 0;
Tk_ErrorHandler handler;
@@ -456,7 +456,7 @@ TkFreeBindingTags(
* have to be freed.
*/
- ckfree((char *)p);
+ ckfree((void *)p);
}
}
ckfree(winPtr->tagPtr);
@@ -490,7 +490,7 @@ Tk_DestroyObjCmd(
{
Tk_Window window;
Tk_Window tkwin = (Tk_Window)clientData;
- int i;
+ Tcl_Size i;
for (i = 1; i < objc; i++) {
window = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin);
@@ -1302,7 +1302,7 @@ Tk_WinfoObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int index, x, y, width, height, useX, useY, c_class;
- int skip;
+ Tcl_Size skip;
const char *string;
TkWindow *winPtr;
Tk_Window tkwin = (Tk_Window)clientData;
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 106b79a..9b8ddf6 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -222,7 +222,7 @@ Tk_InitConsoleChannels(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return;
}
@@ -441,7 +441,7 @@ Tk_CreateConsoleWindow(
}
Tcl_Preserve(consoleInterp);
- result = Tcl_EvalEx(consoleInterp, "source -encoding utf-8 $tk_library/console.tcl",
+ result = Tcl_EvalEx(consoleInterp, "source $tk_library/console.tcl",
TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
if (result == TCL_ERROR) {
Tcl_SetReturnOptions(interp,
diff --git a/generic/tkDList.h b/generic/tkDList.h
index f6c70d9..1cd5977 100644
--- a/generic/tkDList.h
+++ b/generic/tkDList.h
@@ -440,7 +440,7 @@ static void \
LT##_Free(struct ElemType *elem) \
{ \
LT##_Remove(elem); \
- ckfree((void *) elem); \
+ ckfree((void *)elem); \
} \
\
__TK_DLIST_UNUSED \
@@ -508,7 +508,7 @@ LT##_Clear(LT *head) \
assert(head); \
for (p = head->first; p; p = next) { \
next = LT##_Next(p); \
- ckfree((void *) p); \
+ ckfree((void *)p); \
} \
LT##_Init(head); \
} \
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index bdad3d1..8695993 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -142,7 +142,7 @@ EXTERN int Tk_ConfigureValue(Tcl_Interp *interp,
/* 29 */
EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp,
Tk_Window tkwin, const Tk_ConfigSpec *specs,
- Tcl_Size argc, const char **argv,
+ Tcl_Size objc, Tcl_Obj *const *objv,
void *widgRec, int flags);
/* 30 */
EXTERN void Tk_ConfigureWindow(Tk_Window tkwin,
@@ -288,9 +288,7 @@ EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs,
EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap);
/* 76 */
EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout);
-/* 77 */
-TK_DEPRECATED("function does nothing, call can be removed")
-void Tk_FreeXId(Display *display, XID xid);
+/* Slot 77 is reserved */
/* 78 */
EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable);
/* 79 */
@@ -413,8 +411,7 @@ EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window);
EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y,
int width, int height, int imageWidth,
int imageHeight);
-/* 118 */
-EXTERN int Tk_Init(Tcl_Interp *interp);
+/* Slot 118 is reserved */
/* 119 */
EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name);
/* 120 */
@@ -476,34 +473,18 @@ EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection,
EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin,
int *argcPtr, const char **argv,
const Tk_ArgvInfo *argTable, int flags);
-/* 144 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height);
-/* 145 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoPutZoomedBlock_NoComposite(
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY);
+/* Slot 144 is reserved */
+/* Slot 145 is reserved */
/* 146 */
EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr);
/* 147 */
EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle);
-/* 148 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle,
- int width, int height);
+/* Slot 148 is reserved */
/* 149 */
EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr,
int *heightPtr);
-/* 150 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle,
- int width, int height);
+/* Slot 150 is reserved */
/* 151 */
EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y);
/* 152 */
@@ -529,8 +510,7 @@ EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow,
/* 158 */
EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg,
void **prevArgPtr);
-/* 159 */
-EXTERN int Tk_SafeInit(Tcl_Interp *interp);
+/* Slot 159 is reserved */
/* 160 */
EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name);
/* 161 */
@@ -679,10 +659,7 @@ EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp,
/* 211 */
EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin);
-/* 212 */
-EXTERN TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv,
- Tcl_AppInitProc *appInitProc,
- Tcl_Interp *interp);
+/* Slot 212 is reserved */
/* 213 */
EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr);
/* 214 */
@@ -692,8 +669,7 @@ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr,
Tk_SavedOptions *savePtr, int *maskPtr);
/* 215 */
EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp);
-/* 216 */
-EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
+/* Slot 216 is reserved */
/* 217 */
EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp,
const Tk_SmoothMethod *method);
@@ -785,17 +761,8 @@ EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin,
/* 245 */
EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y,
int height);
-/* 246 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int compRule);
-/* 247 */
-TK_DEPRECATED("function signature changed")
-void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY, int compRule);
+/* Slot 246 is reserved */
+/* Slot 247 is reserved */
/* 248 */
EXTERN int Tk_CollapseMotionEvents(Display *display,
int collapse);
@@ -821,10 +788,8 @@ EXTERN const char * Tk_NameOfStyle(Tk_Style style);
/* 257 */
EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
-/* 258 */
-EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr);
-/* 259 */
-EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr);
+/* Slot 258 is reserved */
+/* Slot 259 is reserved */
/* 260 */
EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style,
Tcl_Size elementId,
@@ -872,11 +837,8 @@ EXTERN long Tk_GetUserInactiveTime(Display *dpy);
EXTERN void Tk_ResetUserInactiveTime(Display *dpy);
/* 271 */
EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin);
-/* 272 */
-EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr);
-/* 273 */
-EXTERN void Tk_CreateOldPhotoImageFormat(
- const Tk_PhotoImageFormat *formatPtr);
+/* Slot 272 is reserved */
+/* Slot 273 is reserved */
/* 274 */
EXTERN int Tk_AlwaysShowSelection(Tk_Window tkwin);
/* 275 */
@@ -966,7 +928,7 @@ typedef struct TkStubs {
int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */
int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 27 */
int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 28 */
- int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, void *widgRec, int flags); /* 29 */
+ int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec, int flags); /* 29 */
void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */
Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */
Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */
@@ -1014,7 +976,7 @@ typedef struct TkStubs {
void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 74 */
void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */
void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */
- TCL_DEPRECATED_API("function does nothing, call can be removed") void (*tk_FreeXId) (Display *display, XID xid); /* 77 */
+ void (*reserved77)(void);
GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */
void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */
Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */
@@ -1055,7 +1017,7 @@ typedef struct TkStubs {
void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */
Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */
void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
- int (*tk_Init) (Tcl_Interp *interp); /* 118 */
+ void (*reserved118)(void);
Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */
int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */
void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */
@@ -1081,13 +1043,13 @@ typedef struct TkStubs {
Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */
void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */
int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */
+ void (*reserved144)(void);
+ void (*reserved145)(void);
int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */
void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */
+ void (*reserved148)(void);
void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */
+ void (*reserved150)(void);
int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */
int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */
void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */
@@ -1096,7 +1058,7 @@ typedef struct TkStubs {
void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */
int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */
Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 158 */
- int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */
+ void (*reserved159)(void);
const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */
void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */
void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */
@@ -1149,11 +1111,11 @@ typedef struct TkStubs {
int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */
int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */
int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */
- TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") TCL_NORETURN1 void (*tk_MainEx) (Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */
+ void (*reserved212)(void);
void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */
int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */
void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */
- int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */
+ void (*reserved216)(void);
void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */
void (*reserved218)(void);
void (*reserved219)(void);
@@ -1183,8 +1145,8 @@ typedef struct TkStubs {
void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */
void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */
void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */
- TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 247 */
+ void (*reserved246)(void);
+ void (*reserved247)(void);
int (*tk_CollapseMotionEvents) (Display *display, int collapse); /* 248 */
Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */
Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */
@@ -1195,8 +1157,8 @@ typedef struct TkStubs {
void (*tk_FreeStyle) (Tk_Style style); /* 255 */
const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */
Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */
- Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */
- void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */
+ void (*reserved258)(void);
+ void (*reserved259)(void);
Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 260 */
void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */
void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */
@@ -1209,8 +1171,8 @@ typedef struct TkStubs {
long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */
void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */
Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */
- void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */
- void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */
+ void (*reserved272)(void);
+ void (*reserved273)(void);
int (*tk_AlwaysShowSelection) (Tk_Window tkwin); /* 274 */
unsigned (*tk_GetButtonMask) (unsigned button); /* 275 */
int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */
@@ -1396,8 +1358,7 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_FreePixmap) /* 75 */
#define Tk_FreeTextLayout \
(tkStubsPtr->tk_FreeTextLayout) /* 76 */
-#define Tk_FreeXId \
- (tkStubsPtr->tk_FreeXId) /* 77 */
+/* Slot 77 is reserved */
#define Tk_GCForColor \
(tkStubsPtr->tk_GCForColor) /* 78 */
#define Tk_GeometryRequest \
@@ -1478,8 +1439,7 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_IdToWindow) /* 116 */
#define Tk_ImageChanged \
(tkStubsPtr->tk_ImageChanged) /* 117 */
-#define Tk_Init \
- (tkStubsPtr->tk_Init) /* 118 */
+/* Slot 118 is reserved */
#define Tk_InternAtom \
(tkStubsPtr->tk_InternAtom) /* 119 */
#define Tk_IntersectTextLayout \
@@ -1530,20 +1490,16 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_OwnSelection) /* 142 */
#define Tk_ParseArgv \
(tkStubsPtr->tk_ParseArgv) /* 143 */
-#define Tk_PhotoPutBlock_NoComposite \
- (tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */
-#define Tk_PhotoPutZoomedBlock_NoComposite \
- (tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */
+/* Slot 144 is reserved */
+/* Slot 145 is reserved */
#define Tk_PhotoGetImage \
(tkStubsPtr->tk_PhotoGetImage) /* 146 */
#define Tk_PhotoBlank \
(tkStubsPtr->tk_PhotoBlank) /* 147 */
-#define Tk_PhotoExpand_Panic \
- (tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */
+/* Slot 148 is reserved */
#define Tk_PhotoGetSize \
(tkStubsPtr->tk_PhotoGetSize) /* 149 */
-#define Tk_PhotoSetSize_Panic \
- (tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */
+/* Slot 150 is reserved */
#define Tk_PointToChar \
(tkStubsPtr->tk_PointToChar) /* 151 */
#define Tk_PostscriptFontName \
@@ -1560,8 +1516,7 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_RestackWindow) /* 157 */
#define Tk_RestrictEvents \
(tkStubsPtr->tk_RestrictEvents) /* 158 */
-#define Tk_SafeInit \
- (tkStubsPtr->tk_SafeInit) /* 159 */
+/* Slot 159 is reserved */
#define Tk_SetAppName \
(tkStubsPtr->tk_SetAppName) /* 160 */
#define Tk_SetBackgroundFromBorder \
@@ -1666,16 +1621,14 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_GetScrollInfoObj) /* 210 */
#define Tk_InitOptions \
(tkStubsPtr->tk_InitOptions) /* 211 */
-#define Tk_MainEx \
- (tkStubsPtr->tk_MainEx) /* 212 */
+/* Slot 212 is reserved */
#define Tk_RestoreSavedOptions \
(tkStubsPtr->tk_RestoreSavedOptions) /* 213 */
#define Tk_SetOptions \
(tkStubsPtr->tk_SetOptions) /* 214 */
#define Tk_InitConsoleChannels \
(tkStubsPtr->tk_InitConsoleChannels) /* 215 */
-#define Tk_CreateConsoleWindow \
- (tkStubsPtr->tk_CreateConsoleWindow) /* 216 */
+/* Slot 216 is reserved */
#define Tk_CreateSmoothMethod \
(tkStubsPtr->tk_CreateSmoothMethod) /* 217 */
/* Slot 218 is reserved */
@@ -1732,10 +1685,8 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */
#define Tk_SetCaretPos \
(tkStubsPtr->tk_SetCaretPos) /* 245 */
-#define Tk_PhotoPutBlock_Panic \
- (tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */
-#define Tk_PhotoPutZoomedBlock_Panic \
- (tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */
+/* Slot 246 is reserved */
+/* Slot 247 is reserved */
#define Tk_CollapseMotionEvents \
(tkStubsPtr->tk_CollapseMotionEvents) /* 248 */
#define Tk_RegisterStyleEngine \
@@ -1756,10 +1707,8 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_NameOfStyle) /* 256 */
#define Tk_AllocStyleFromObj \
(tkStubsPtr->tk_AllocStyleFromObj) /* 257 */
-#define Tk_GetStyleFromObj \
- (tkStubsPtr->tk_GetStyleFromObj) /* 258 */
-#define Tk_FreeStyleFromObj \
- (tkStubsPtr->tk_FreeStyleFromObj) /* 259 */
+/* Slot 258 is reserved */
+/* Slot 259 is reserved */
#define Tk_GetStyledElement \
(tkStubsPtr->tk_GetStyledElement) /* 260 */
#define Tk_GetElementSize \
@@ -1784,10 +1733,8 @@ extern const TkStubs *tkStubsPtr;
(tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */
#define Tk_Interp \
(tkStubsPtr->tk_Interp) /* 271 */
-#define Tk_CreateOldImageType \
- (tkStubsPtr->tk_CreateOldImageType) /* 272 */
-#define Tk_CreateOldPhotoImageFormat \
- (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */
+/* Slot 272 is reserved */
+/* Slot 273 is reserved */
#define Tk_AlwaysShowSelection \
(tkStubsPtr->tk_AlwaysShowSelection) /* 274 */
#define Tk_GetButtonMask \
@@ -1827,44 +1774,34 @@ extern const TkStubs *tkStubsPtr;
/* !END!: Do not edit above this line. */
-/* Functions that don't belong in the stub table */
-#undef Tk_MainEx
-#undef Tk_Init
-#undef Tk_SafeInit
-#undef Tk_CreateConsoleWindow
-
-#undef Tk_FreeXId
-#define Tk_FreeXId(display,xid)
-#undef Tk_GetStyleFromObj
-#undef Tk_FreeStyleFromObj
-#define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj)
-#define Tk_FreeStyleFromObj(obj) /* no-op */
#define Tk_GetImageMasterData Tk_GetImageModelData
#ifndef MAC_OSX_TK
# undef Tk_ClipDrawableToRect
#endif
+EXTERN void Tk_MainEx(Tcl_Size argc, char **argv,
+ Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#if defined(_WIN32) && defined(UNICODE)
# define Tk_MainEx Tk_MainExW
EXTERN void Tk_MainExW(Tcl_Size argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#endif
+EXTERN int Tk_Init(Tcl_Interp *interp);
+EXTERN int Tk_SafeInit(Tcl_Interp *interp);
+EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
-
-#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
-#undef Tk_PhotoPutBlock_NoComposite
-#undef Tk_PhotoPutZoomedBlock_NoComposite
-#undef Tk_PhotoExpand_Panic
-#undef Tk_PhotoPutBlock_Panic
-#undef Tk_PhotoPutZoomedBlock_Panic
-#undef Tk_PhotoSetSize_Panic
-#undef Tk_CreateOldPhotoImageFormat
-#endif /* TK_NO_DEPRECATED */
+#if TK_MAJOR_VERSION < 9
+/* Restore 8.x signature of Tk_ConfigureWidget, but panic if TK_CONFIG_OBJS flag is not set */
+#undef Tk_ConfigureWidget
+#define Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags) \
+ ((int (*)(Tcl_Interp *, Tk_Window, const Tk_ConfigSpec *, \
+ int, const char **, char *, int))(void *)(tkStubsPtr->tk_ConfigureWidget)) \
+ (((flags & TK_CONFIG_OBJS) ? interp : (Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory in Tk_ConfigureWidget"), \
+ NULL)), tkwin, specs, argc, argv, widgRec, flags)
+#endif
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#undef TkUnusedStubEntry
-
#endif /* _TKDECLS */
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 7ee455e..3b9b00f 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1998,8 +1998,8 @@ EntryComputeGeometry(
* resulting string.
*/
- TkUtfToUniChar(entryPtr->showChar, &ch);
- size = TkUniCharToUtf(ch, buf);
+ Tcl_UtfToUniChar(entryPtr->showChar, &ch);
+ size = Tcl_UniCharToUtf(ch, buf);
entryPtr->numDisplayBytes = entryPtr->numChars * size;
p = (char *)ckalloc(entryPtr->numDisplayBytes + 1);
@@ -2164,7 +2164,7 @@ InsertChars(
char *newStr;
string = entryPtr->string;
- byteIndex = TkUtfAtIndex(string, index) - string;
+ byteIndex = Tcl_UtfAtIndex(string, index) - string;
byteCount = strlen(value);
if (byteCount == 0) {
return TCL_OK;
@@ -2197,7 +2197,7 @@ InsertChars(
*/
oldChars = entryPtr->numChars;
- entryPtr->numChars = TkNumUtfChars(newStr, TCL_INDEX_NONE);
+ entryPtr->numChars = Tcl_NumUtfChars(newStr, TCL_INDEX_NONE);
charsAdded = entryPtr->numChars - oldChars;
entryPtr->numBytes += byteCount;
@@ -2268,8 +2268,8 @@ DeleteChars(
}
string = entryPtr->string;
- byteIndex = TkUtfAtIndex(string, index) - string;
- byteCount = TkUtfAtIndex(string + byteIndex, count) - (string+byteIndex);
+ byteIndex = Tcl_UtfAtIndex(string, index) - string;
+ byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string+byteIndex);
newByteCount = entryPtr->numBytes + 1 - byteCount;
newStr = (char *)ckalloc(newByteCount);
@@ -2497,7 +2497,7 @@ EntrySetValue(
entryPtr->string = tmp;
}
entryPtr->numBytes = valueLen;
- entryPtr->numChars = TkNumUtfChars(value, valueLen);
+ entryPtr->numChars = Tcl_NumUtfChars(value, valueLen);
if (entryPtr->displayString == oldSource) {
entryPtr->displayString = entryPtr->string;
@@ -2927,8 +2927,8 @@ EntryFetchSelection(
return -1;
}
string = entryPtr->displayString;
- selStart = TkUtfAtIndex(string, entryPtr->selectFirst);
- selEnd = TkUtfAtIndex(selStart,
+ selStart = Tcl_UtfAtIndex(string, entryPtr->selectFirst);
+ selEnd = Tcl_UtfAtIndex(selStart,
entryPtr->selectLast - entryPtr->selectFirst);
if (selEnd <= selStart + offset) {
return 0;
@@ -3580,7 +3580,7 @@ ExpandPercents(
before++; /* skip over % */
if (*before != '\0') {
- before += TkUtfToUniChar(before, &ch);
+ before += Tcl_UtfToUniChar(before, &ch);
} else {
ch = '%';
}
@@ -3600,7 +3600,7 @@ ExpandPercents(
string = Tk_PathName(entryPtr->tkwin);
break;
default:
- length = TkUniCharToUtf(ch, numStorage);
+ length = Tcl_UniCharToUtf(ch, numStorage);
numStorage[length] = '\0';
string = numStorage;
break;
@@ -3660,7 +3660,7 @@ ExpandPercents(
string = Tk_PathName(entryPtr->tkwin);
break;
default:
- length = TkUniCharToUtf(ch, numStorage);
+ length = Tcl_UniCharToUtf(ch, numStorage);
numStorage[length] = '\0';
string = numStorage;
break;
diff --git a/generic/tkFont.c b/generic/tkFont.c
index bb0b34f..6a90add 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -576,7 +576,7 @@ Tk_FontObjCmd(
if (charPtr != NULL) {
const char *string = Tcl_GetString(charPtr);
- size_t len = TkUtfToUniChar(string, &uniChar);
+ size_t len = Tcl_UtfToUniChar(string, &uniChar);
if (len != (size_t)charPtr->length) {
resultPtr = Tcl_NewStringObj(
@@ -887,17 +887,6 @@ TheWorldHasChanged(
{
TkFontInfo *fiPtr = (TkFontInfo *)clientData;
- /*
- * On macOS it is catastrophic to recompute all widgets while the
- * [NSView drawRect] method is drawing. The best that we can do in
- * that situation is to abort the recomputation and hope for the best.
- * This is ignored on other platforms.
- */
-
- if (TkpWillDrawWidget(NULL)) {
- return;
- }
-
fiPtr->updatePending = 0;
RecomputeWidgets(fiPtr->mainPtr->winPtr);
}
@@ -1744,14 +1733,14 @@ Tk_PostscriptFontName(
src++;
upper = 1;
}
- src += TkUtfToUniChar(src, &ch);
+ src += Tcl_UtfToUniChar(src, &ch);
if (upper) {
ch = Tcl_UniCharToUpper(ch);
upper = 0;
} else {
ch = Tcl_UniCharToLower(ch);
}
- dest += TkUniCharToUtf(ch, dest);
+ dest += Tcl_UniCharToUtf(ch, dest);
}
*dest = '\0';
Tcl_DStringSetLength(dsPtr, dest - Tcl_DStringValue(dsPtr));
@@ -2012,7 +2001,7 @@ Tk_ComputeTextLayout(
height = fmPtr->ascent + fmPtr->descent;
if (numChars < 0) {
- numChars = TkNumUtfChars(string, TCL_INDEX_NONE);
+ numChars = Tcl_NumUtfChars(string, TCL_INDEX_NONE);
}
if (wrapLength == 0) {
wrapLength = -1;
@@ -2035,7 +2024,7 @@ Tk_ComputeTextLayout(
curX = 0;
- endp = TkUtfAtIndex(string, numChars);
+ endp = Tcl_UtfAtIndex(string, numChars);
special = string;
flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES;
@@ -2152,7 +2141,7 @@ Tk_ComputeTextLayout(
bytesThisChunk = Tk_MeasureChars(tkfont, end, bytesThisChunk,
-1, 0, &chunkPtr->totalWidth);
chunkPtr->numBytes += bytesThisChunk;
- chunkPtr->numChars += TkNumUtfChars(end, bytesThisChunk);
+ chunkPtr->numChars += Tcl_NumUtfChars(end, bytesThisChunk);
chunkPtr->totalWidth += curX;
}
}
@@ -2344,14 +2333,14 @@ Tk_DrawTextLayout(
firstChar = 0;
firstByte = chunkPtr->start;
} else {
- firstByte = TkUtfAtIndex(chunkPtr->start, firstChar);
+ firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar);
Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start,
firstByte - chunkPtr->start, -1, 0, &drawX);
}
if (lastChar < numDisplayChars) {
numDisplayChars = lastChar;
}
- lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars);
+ lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars);
#ifdef TK_DRAW_IN_CONTEXT
TkpDrawCharsInContext(display, drawable, gc, layoutPtr->tkfont,
chunkPtr->start, chunkPtr->numBytes,
@@ -2414,14 +2403,14 @@ TkDrawAngledTextLayout(
firstChar = 0;
firstByte = chunkPtr->start;
} else {
- firstByte = TkUtfAtIndex(chunkPtr->start, firstChar);
+ firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar);
Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start,
firstByte - chunkPtr->start, -1, 0, &drawX);
}
if (lastChar < numDisplayChars) {
numDisplayChars = lastChar;
}
- lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars);
+ lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars);
#ifdef TK_DRAW_IN_CONTEXT
dx = cosA * (chunkPtr->x) + sinA * (chunkPtr->y);
dy = -sinA * (chunkPtr->x) + cosA * (chunkPtr->y);
@@ -2674,7 +2663,7 @@ Tk_PointToChar(
}
n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start,
chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy);
- return numChars + TkNumUtfChars(chunkPtr->start, n);
+ return numChars + Tcl_NumUtfChars(chunkPtr->start, n);
}
numChars += chunkPtr->numChars;
lastPtr = chunkPtr;
@@ -2783,7 +2772,7 @@ Tk_CharBbox(
goto check;
}
} else if (index < chunkPtr->numChars) {
- end = TkUtfAtIndex(chunkPtr->start, index);
+ end = Tcl_UtfAtIndex(chunkPtr->start, index);
if (xPtr != NULL) {
Tk_MeasureChars(tkfont, chunkPtr->start,
end - chunkPtr->start, -1, 0, &x);
@@ -2791,7 +2780,7 @@ Tk_CharBbox(
}
if (widthPtr != NULL) {
int ch;
- Tk_MeasureChars(tkfont, end, TkUtfToUniChar(end, &ch), -1, 0, &w);
+ Tk_MeasureChars(tkfont, end, Tcl_UtfToUniChar(end, &ch), -1, 0, &w);
}
goto check;
}
@@ -3337,7 +3326,7 @@ Tk_TextLayoutToPostscript(
* international postscript fonts.
*/
- p += TkUtfToUniChar(p, &ch);
+ p += Tcl_UtfToUniChar(p, &ch);
if ((ch == '(') || (ch == ')') || (ch == '\\') || (ch < 0x20)) {
/*
* Tricky point: the "03" is necessary in the snprintf below,
@@ -3858,7 +3847,7 @@ NewChunk(
*layoutPtrPtr = layoutPtr;
*maxPtr = maxChunks;
}
- numChars = TkNumUtfChars(start, numBytes);
+ numChars = Tcl_NumUtfChars(start, numBytes);
chunkPtr = &layoutPtr->chunks[layoutPtr->numChunks];
chunkPtr->start = start;
chunkPtr->numBytes = numBytes;
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 1d93976..d49292b 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -43,7 +43,7 @@ typedef struct {
* available for this widget. */
char *className; /* Class name for widget (from configuration
* option). Malloc-ed. */
- enum FrameType type; /* Type of widget, such as TYPE_FRAME. */
+ int type; /* Type of widget, such as TYPE_FRAME. */
char *screenName; /* Screen on which widget is created. Non-null
* only for top-levels. Malloc-ed, may be
* NULL. */
@@ -329,9 +329,6 @@ static const Tk_OptionSpec *const optionSpecs[] = {
static void ComputeFrameGeometry(Frame *framePtr);
static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr,
Tcl_Size objc, Tcl_Obj *const objv[]);
-static int CreateFrame(void *clientData, Tcl_Interp *interp,
- Tcl_Size objc, Tcl_Obj *const objv[],
- enum FrameType type, const char *appName);
static Tcl_FreeProc DestroyFrame;
static void DestroyFramePartly(Frame *framePtr);
static void DisplayFrame(void *clientData);
@@ -403,7 +400,7 @@ Tk_FrameObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL);
+ return TkCreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL);
}
int
@@ -413,7 +410,7 @@ Tk_ToplevelObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL);
+ return TkCreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL);
}
int
@@ -423,7 +420,7 @@ Tk_LabelframeObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL);
+ return TkCreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL);
}
/*
@@ -444,68 +441,13 @@ Tk_LabelframeObjCmd(
*
*--------------------------------------------------------------
*/
-
int
TkCreateFrame(
- void *clientData, /* Either NULL or pointer to option table. */
- Tcl_Interp *interp, /* Current interpreter. */
- Tcl_Size argc, /* Number of arguments. */
- const char *const *argv, /* Argument strings. */
- int toplevel, /* Non-zero means create a toplevel window,
- * zero means create a frame. */
- const char *appName) /* Should only be non-NULL if there is no main
- * window associated with the interpreter.
- * Gives the base name to use for the new
- * application. */
-{
- int result;
- Tcl_Size i;
- Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **));
-
- for (i=0; i<argc; i++) {
- objv[i] = Tcl_NewStringObj(argv[i], TCL_INDEX_NONE);
- Tcl_IncrRefCount(objv[i]);
- }
- objv[argc] = NULL;
- result = CreateFrame(clientData, interp, argc, objv,
- toplevel ? TYPE_TOPLEVEL : TYPE_FRAME, appName);
- for (i=0; i<argc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- ckfree(objv);
- return result;
-}
-
-int
-TkListCreateFrame(
- void *clientData, /* Either NULL or pointer to option table. */
- Tcl_Interp *interp, /* Current interpreter. */
- Tcl_Obj *listObj, /* List of arguments. */
- int toplevel, /* Non-zero means create a toplevel window,
- * zero means create a frame. */
- Tcl_Obj *nameObj) /* Should only be non-NULL if there is no main
- * window associated with the interpreter.
- * Gives the base name to use for the new
- * application. */
-{
- Tcl_Size objc;
- Tcl_Obj **objv;
-
- if (TCL_OK != Tcl_ListObjGetElements(interp, listObj, &objc, &objv)) {
- return TCL_ERROR;
- }
- return CreateFrame(clientData, interp, objc, objv,
- toplevel ? TYPE_TOPLEVEL : TYPE_FRAME,
- nameObj ? Tcl_GetString(nameObj) : NULL);
-}
-
-static int
-CreateFrame(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
- enum FrameType type, /* What widget type to create. */
+ int type, /* What widget type to create. */
const char *appName) /* Should only be non-NULL if there are no
* Main window associated with the
* interpreter. Gives the base name to use for
@@ -1536,6 +1478,8 @@ DisplayFrame(
Tk_Depth(tkwin));
#else
pixmap = Tk_WindowId(tkwin);
+ Tk_ClipDrawableToRect(Tk_Display(tkwin), pixmap, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin));
#endif /* TK_NO_DOUBLE_BUFFERING */
if (framePtr->type != TYPE_LABELFRAME) {
diff --git a/generic/tkIcu.c b/generic/tkIcu.c
index 503c98d..84c78d5 100644
--- a/generic/tkIcu.c
+++ b/generic/tkIcu.c
@@ -92,7 +92,7 @@ startEndOfCmd(
str = Tcl_GetStringFromObj(objv[1], &len);
Tcl_UtfToChar16DString(str, len, &ds);
len = Tcl_DStringLength(&ds)/2;
- Tcl_Size ulen = TkGetCharLength(objv[1]);
+ Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
if (TkGetIntForIndex(objv[2], ulen-1, 0, &idx) != TCL_OK) {
Tcl_DStringFree(&ds);
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2])));
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 701c765..43b5123 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -131,7 +131,7 @@ ImageTypeThreadExitProc(
/*
*----------------------------------------------------------------------
*
- * Tk_CreateOldImageType, Tk_CreateImageType --
+ * Tk_CreateImageType --
*
* This function is invoked by an image manager to tell Tk about a new
* kind of image and the functions that manage the new type. The function
@@ -148,27 +148,6 @@ ImageTypeThreadExitProc(
*/
void
-Tk_CreateOldImageType(
- const Tk_ImageType *typePtr)
- /* Structure describing the type. All of the
- * fields except "nextPtr" must be filled in
- * by caller. */
-{
- Tk_ImageType *copyPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- if (!tsdPtr->initialized) {
- tsdPtr->initialized = 1;
- Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL);
- }
- copyPtr = (Tk_ImageType *)ckalloc(sizeof(Tk_ImageType));
- *copyPtr = *typePtr;
- copyPtr->nextPtr = tsdPtr->oldImageTypeList;
- tsdPtr->oldImageTypeList = copyPtr;
-}
-
-void
Tk_CreateImageType(
const Tk_ImageType *typePtr)
/* Structure describing the type. All of the
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 49de20a..116ef41 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -240,7 +240,7 @@ ImgBmapConfigureModel(
int maskWidth, maskHeight, dummy1, dummy2;
if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp),
- configSpecs, objc, (const char **) objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ configSpecs, objc, objv, modelPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 0138e68..27ffbed 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -139,11 +139,6 @@ typedef struct {
Tk_PhotoImageFormat *formatList;
/* Pointer to the first in the list of known
* photo image formats.*/
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- Tk_PhotoImageFormat *oldFormatList;
- /* Pointer to the first in the list of known
- * photo image formats.*/
-#endif
Tk_PhotoImageFormatVersion3 *formatListVersion3;
/* Pointer to the first in the list of known
* photo image formats in Version3 format.*/
@@ -247,13 +242,6 @@ PhotoFormatThreadExitProc(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- while (tsdPtr->oldFormatList != NULL) {
- freePtr = tsdPtr->oldFormatList;
- tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
- ckfree(freePtr);
- }
-#endif
while (tsdPtr->formatList != NULL) {
freePtr = tsdPtr->formatList;
tsdPtr->formatList = tsdPtr->formatList->nextPtr;
@@ -271,7 +259,7 @@ PhotoFormatThreadExitProc(
/*
*----------------------------------------------------------------------
*
- * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat,
+ * Tk_CreatePhotoImageFormat,
* Tk_CreatePhotoImageFormatVersion3 --
*
* This function is invoked by an image file handler to register a new
@@ -288,29 +276,6 @@ PhotoFormatThreadExitProc(
*----------------------------------------------------------------------
*/
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-void
-Tk_CreateOldPhotoImageFormat(
- const Tk_PhotoImageFormat *formatPtr)
- /* Structure describing the format. All of the
- * fields except "nextPtr" must be filled in
- * by caller. */
-{
- Tk_PhotoImageFormat *copyPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- if (!tsdPtr->initialized) {
- tsdPtr->initialized = 1;
- Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL);
- }
- copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat));
- *copyPtr = *formatPtr;
- copyPtr->nextPtr = tsdPtr->oldFormatList;
- tsdPtr->oldFormatList = copyPtr;
-}
-#endif
-
void
Tk_CreatePhotoImageFormat(
const Tk_PhotoImageFormat *formatPtr)
@@ -328,12 +293,6 @@ Tk_CreatePhotoImageFormat(
}
copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- if (isupper((unsigned char) *formatPtr->name)) {
- copyPtr->nextPtr = tsdPtr->oldFormatList;
- tsdPtr->oldFormatList = copyPtr;
- } else
-#endif
{
/* for compatibility with aMSN: make a copy of formatPtr->name */
char *name = (char *)ckalloc(strlen(formatPtr->name) + 1);
@@ -836,23 +795,6 @@ ImgPhotoCmd(
}
}
}
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- if (stringWriteProc == NULL) {
- oldformat = 1;
- for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
- imageFormat = imageFormat->nextPtr) {
- if ((strncasecmp(Tcl_GetString(options.format),
- imageFormat->name,
- strlen(imageFormat->name)) == 0)) {
- matched = 1;
- if (imageFormat->stringWriteProc != NULL) {
- stringWriteProc = imageFormat->stringWriteProc;
- break;
- }
- }
- }
- }
-#endif
if (stringWriteProc == NULL) {
oldformat = 0;
for (imageFormatVersion3 = tsdPtr->formatListVersion3;
@@ -1507,22 +1449,6 @@ readCleanup:
}
}
}
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- if (imageFormat == NULL) {
- oldformat = 1;
- for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
- imageFormat = imageFormat->nextPtr) {
- if ((fmtString == NULL)
- || (strncasecmp(fmtString, imageFormat->name,
- strlen(imageFormat->name)) == 0)) {
- matched = 1;
- if (imageFormat->fileWriteProc != NULL) {
- break;
- }
- }
- }
- }
-#endif
if (imageFormat == NULL) {
oldformat = 0;
for (imageFormatVersion3 = tsdPtr->formatListVersion3;
@@ -2042,7 +1968,7 @@ ImgPhotoConfigureModel(
*/
if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs,
- objc, (const char **)objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objc, objv, modelPtr, flags) != TCL_OK) {
goto errorExit;
}
@@ -2769,42 +2695,6 @@ MatchFileFormat(
}
}
}
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-if (formatPtr == NULL) {
- useoldformat = 1;
- for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
- formatPtr = formatPtr->nextPtr) {
- if (formatString != NULL) {
- if (strncasecmp(formatString,
- formatPtr->name, strlen(formatPtr->name)) != 0) {
- continue;
- }
- matched = 1;
- if (formatPtr->fileMatchProc == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "-file option isn't supported for %s images",
- formatString));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "NOT_FILE_FORMAT", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (formatPtr->fileMatchProc != NULL) {
- (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
- if (formatPtr->fileMatchProc(chan, fileName, (Tcl_Obj *)
- formatString, widthPtr, heightPtr, interp)) {
- if (*widthPtr < 1) {
- *widthPtr = 1;
- }
- if (*heightPtr < 1) {
- *heightPtr = 1;
- }
- break;
- }
- }
- }
- }
-#endif
/*
* For old and not version 3 format, exit now with success
@@ -3002,38 +2892,6 @@ MatchStringFormat(
}
}
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- if (formatPtr == NULL) {
- useoldformat = 1;
- for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
- formatPtr = formatPtr->nextPtr) {
- if (formatObj != NULL) {
- if (strncasecmp(formatString,
- formatPtr->name, strlen(formatPtr->name)) != 0) {
- continue;
- }
- matched = 1;
- if (formatPtr->stringMatchProc == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "-data option isn't supported for %s images",
- formatString));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "NOT_DATA_FORMAT", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((formatPtr->stringMatchProc != NULL)
- && (formatPtr->stringReadProc != NULL)
- && formatPtr->stringMatchProc(
- (Tcl_Obj *) Tcl_GetString(data),
- (Tcl_Obj *) formatString,
- widthPtr, heightPtr, interp)) {
- break;
- }
- }
- }
-#endif
-
if (formatPtr == NULL) {
useoldformat = 0;
for (formatVersion3Ptr = tsdPtr->formatListVersion3;
@@ -4522,107 +4380,6 @@ ImgPhotoPostscript(
}
/*
- *----------------------------------------------------------------------
- *
- * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite --
- *
- * These backward-compatibility functions just exist to fill slots in stubs
- * table. For the behaviour of *_NoComposite, refer to the corresponding
- * function without the extra suffix, except that the compositing rule is
- * always "overlay" and the function always panics on memory-allocation
- * failure.
- *
- *----------------------------------------------------------------------
- */
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-void
-Tk_PhotoPutBlock_NoComposite(
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr,
- int x, int y, int width, int height)
-{
- if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height,
- TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-
-void
-Tk_PhotoPutZoomedBlock_NoComposite(
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr,
- int x, int y, int width, int height,
- int zoomX, int zoomY, int subsampleX, int subsampleY)
-{
- if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height,
- zoomX, zoomY, subsampleX, subsampleY,
- TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic,
- * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic
- *
- * Backward compatibility functions for preserving the old behaviour (i.e.
- * panic on memory allocation failure) so that extensions do not need to be
- * significantly updated to take account of TIP #116. These call the new
- * interface (i.e. the interface without the extra suffix), but panic if an
- * error condition is returned.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tk_PhotoExpand_Panic(
- Tk_PhotoHandle handle,
- int width, int height)
-{
- if (Tk_PhotoExpand(NULL, handle, width, height) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-
-void
-Tk_PhotoPutBlock_Panic(
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock *blockPtr,
- int x, int y, int width, int height, int compRule)
-{
- if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height,
- compRule) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-
-void
-Tk_PhotoPutZoomedBlock_Panic(
- Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr,
- int x, int y, int width, int height,
- int zoomX, int zoomY, int subsampleX, int subsampleY,
- int compRule)
-{
- if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height,
- zoomX, zoomY, subsampleX, subsampleY, compRule) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-
-void
-Tk_PhotoSetSize_Panic(
- Tk_PhotoHandle handle,
- int width, int height)
-{
- if (Tk_PhotoSetSize(NULL, handle, width, height) != TCL_OK) {
- Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
- }
-}
-#endif /* TK_NO_DEPRECATED */
-
-/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 7d75a42..c1ffd10 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -68,7 +68,7 @@ declare 12 {
}
declare 13 {
int TkCreateFrame(void *clientData, Tcl_Interp *interp,
- Tcl_Size argc, const char *const *argv, int toplevel, const char *appName)
+ Tcl_Size objc, Tcl_Obj *const objv[], int type, const char *appName)
}
declare 14 {
Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
@@ -226,9 +226,6 @@ declare 58 {
declare 59 {
void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name)
}
-declare 60 {deprecated {renamed to Tk_GetOtherWindow}} {
- TkWindow *TkpGetOtherWindow(TkWindow *winPtr)
-}
declare 61 {
TkWindow *TkpGetWrapperWindow(TkWindow *winPtr)
}
@@ -239,15 +236,9 @@ declare 63 {
void TkpInitializeMenuBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable)
}
-declare 64 {deprecated {renamed to Tk_MakeContainer}} {
- void TkpMakeContainer(Tk_Window tkwin)
-}
declare 65 {
void TkpMakeMenuWindow(Tk_Window tkwin, int transient)
}
-declare 66 {deprecated {renamed to Tk_MakeWindow}} {
- Window TkpMakeWindow(TkWindow *winPtr, Window parent)
-}
declare 67 {
void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName)
}
@@ -269,15 +260,6 @@ declare 72 {
declare 73 {
void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 74 {deprecated {renamed to Tk_SetMainMenubar}} {
- void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName)
-}
-declare 75 {deprecated {renamed to Tk_UseWindow}} {
- int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string)
-}
-#
-# Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted)
-#
declare 77 {
void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr)
}
@@ -302,16 +284,6 @@ declare 82 {
declare 83 {
void TkSelPropProc(XEvent *eventPtr)
}
-
-# Exported publically as Tk_SetClassProcs in 8.4a2
-#declare 84 {
-# void TkSetClassProcs(Tk_Window tkwin,
-# TkClassProcs *procs, void *instanceData)
-#}
-declare 85 {deprecated {renamed to Tk_SetWindowMenubar}} {
- void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin,
- const char *oldMenuName, const char *menuName)
-}
declare 86 {
KeySym TkStringToKeysym(const char *name)
}
@@ -394,10 +366,6 @@ declare 109 {
declare 110 {
void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont)
}
-declare 111 {deprecated {renamed to Tk_GetSystemDefault}} {
- Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin,
- const char *dbName, const char *className)
-}
declare 112 {
void TkpMenuThreadInit(void)
}
@@ -424,20 +392,16 @@ declare 119 {
int XUnionRectWithRegion(XRectangle *rect,
Region src, Region dr_return)
}
-declare 121 aqua {
+declare 121 {
Pixmap TkpCreateNativeBitmap(Display *display, const void *source)
}
-declare 122 aqua {
+declare 122 {
void TkpDefineNativeBitmaps(void)
}
-declare 124 aqua {
+declare 124 {
Pixmap TkpGetNativeAppBitmap(Display *display,
const char *name, int *width, int *height)
}
-declare 135 {deprecated {renamed to Tk_DrawHighlightBorder}} {
- void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC,
- int highlightWidth, Drawable drawable)
-}
declare 136 {
void TkSetFocusWin(TkWindow *winPtr, int force)
}
@@ -666,58 +630,33 @@ declare 0 x11 {
declare 2 x11 {
void TkGenerateActivateEvents(TkWindow *winPtr, int active)
}
-declare 3 x11 {
- int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
-}
-declare 4 x11 {
- void TkpSync(Display *display)
-}
-declare 5 x11 {
- Window TkUnixContainerId(TkWindow *winPtr)
-}
declare 6 x11 {
- int TkUnixDoOneXEvent(Tcl_Time *timePtr)
-}
-declare 7 x11 {
- void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar)
-}
-declare 8 x11 {
int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr)
}
declare 9 x11 {
- void TkWmCleanup(TkDisplay *dispPtr)
-}
-declare 10 x11 {
- void TkSendCleanup(TkDisplay *dispPtr)
-}
-declare 12 x11 {
int TkpWmSetState(TkWindow *winPtr, int state)
}
# only needed by tktest:
-declare 13 x11 {
- int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, Tcl_Size objc,
- Tcl_Obj *const objv[])
-}
declare 38 x11 {
- int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap)
+ int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
}
declare 39 x11 {
- void TkpSync_(Display *display)
+ void TkpSync(Display *display)
}
declare 40 x11 {
- Window TkUnixContainerId_(TkWindow *winPtr)
+ Window TkUnixContainerId(TkWindow *winPtr)
}
declare 41 x11 {
- int TkUnixDoOneXEvent_(Tcl_Time *timePtr)
+ int TkUnixDoOneXEvent(Tcl_Time *timePtr)
}
declare 42 x11 {
- void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar)
+ void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar)
}
declare 43 x11 {
- void TkWmCleanup_(TkDisplay *dispPtr)
+ void TkWmCleanup(TkDisplay *dispPtr)
}
declare 44 x11 {
- void TkSendCleanup_(TkDisplay *dispPtr)
+ void TkSendCleanup(TkDisplay *dispPtr)
}
# only needed by tktest:
declare 45 x11 {
@@ -729,7 +668,7 @@ declare 45 x11 {
# Windows specific functions
declare 0 win {
- char *TkAlignImageData(XImage *image, int alignment, int bitOrder)
+ void TkCreateXEventSource(void)
}
declare 2 win {
void TkGenerateActivateEvents(TkWindow *winPtr, int active)
@@ -832,7 +771,7 @@ declare 32 win {
const char *dbName, const char *className)
}
declare 33 win {
- int TkWinGetPlatformId(void)
+ char *TkAlignImageData(XImage *image, int alignment, int bitOrder)
}
# new for 8.4.1
@@ -851,10 +790,6 @@ declare 36 win {
UINT message, WPARAM wParam, LPARAM lParam)
}
-# new for 8.4.20+/8.5.12+, Cygwin only
-declare 37 win {
- void TkCreateXEventSource(void)
-}
declare 38 win {
int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
}
@@ -888,26 +823,26 @@ declare 47 win {
################################
# Aqua specific functions
-declare 0 aqua {
- void TkGenerateActivateEvents(TkWindow *winPtr, int active)
+declare 1 aqua {
+ void TkAboutDlg(void)
}
declare 2 aqua {
- void TkGenerateActivateEvents_(TkWindow *winPtr, int active)
+ void TkGenerateActivateEvents(TkWindow *winPtr, int active)
}
declare 3 aqua {
- void TkPointerDeadWindow(TkWindow *winPtr)
+ unsigned long TkpGetMS(void)
}
declare 4 aqua {
- void TkpSetCapture(TkWindow *winPtr)
+ void TkPointerDeadWindow(TkWindow *winPtr)
}
declare 5 aqua {
void TkpSetCursor(TkpCursor cursor)
}
declare 6 aqua {
- void TkpWmSetState(TkWindow *winPtr, int state)
+ int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr)
}
declare 7 aqua {
- void TkAboutDlg(void)
+ int TkpWmSetState(TkWindow *winPtr, int state)
}
declare 8 aqua {
unsigned int TkMacOSXButtonKeyState(void)
@@ -918,10 +853,9 @@ declare 9 aqua {
declare 10 aqua {
int TkMacOSXDispatchMenuEvent(int menuID, int index)
}
-# Now a static function
-# declare 11 aqua {
-# void TkMacOSXInstallCursor(int resizeOverride)
-# }
+declare 11 aqua {
+ void TkpSetCapture(TkWindow *winPtr)
+}
declare 12 aqua {
void TkMacOSXHandleTearoffMenu(void)
}
@@ -938,22 +872,9 @@ declare 18 aqua {
void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem,
int optionKeyPressed)
}
-
-# removed duplicates from tkPlat table(tk.decls)
-#declare 19 aqua {
-# void TkMacOSXInitAppleEvents(Tcl_Interp *interp)
-#}
-#
-#declare 20 aqua {
-# void TkMacOSXInitMenus(Tcl_Interp *interp)
-#}
-
declare 21 aqua {
void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag)
}
-declare 22 aqua {
- int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar)
-}
declare 23 aqua {
void TkMacOSXMakeRealWindowExist(TkWindow *winPtr)
}
@@ -963,10 +884,6 @@ declare 24 aqua {
declare 25 aqua {
void TkMacOSXMenuClick(void)
}
-# The corresponding Unregister was not a stub, and this should be static.
-#declare 26 aqua {
-# void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr)
-#}
declare 27 aqua {
int TkMacOSXResizable(TkWindow *winPtr)
}
@@ -976,19 +893,12 @@ declare 28 aqua {
declare 29 aqua {
void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag)
}
-declare 30 aqua {
- void TkMacOSXSetUpClippingRgn(Drawable drawable)
-}
declare 31 aqua {
void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort)
}
declare 32 aqua {
void TkMacOSXUpdateClipRgn(TkWindow *winPtr)
}
-# This was not implemented. Perhaps meant to be OffScreen ?
-#declare 33 aqua {
-# void TkMacOSXUnregisterMacWindow(void *portPtr)
-#}
declare 34 aqua {
int TkMacOSXUseMenuID(short macID)
}
@@ -1041,16 +951,10 @@ declare 51 aqua {
declare 52 aqua {
void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag)
}
-declare 53 aqua {
- unsigned long TkpGetMS(void)
-}
-# For Canvas3d, requested by Sean Woods
-declare 54 aqua {
- void *TkMacOSXDrawable(Drawable drawable)
-}
-declare 55 aqua {
- int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr)
-}
+# Made public as Tk_MacOSXGetNSWindowForDrawable
+#declare 54 aqua {
+# void *TkMacOSXDrawable(Drawable drawable)
+#}
##############################################################################
@@ -1594,348 +1498,350 @@ declare 6 macosx {
Colormap XCreateColormap(Display *d, Window w, Visual *v, int i)
}
declare 7 macosx {
- GContext XGContextFromGC(GC g)
+ Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
+ XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)
}
-# second parameter was of type KeyCode
declare 8 macosx {
- KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i)
+ Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
+ unsigned int ui1, unsigned int ui2, XColor _Xconst *x1,
+ XColor _Xconst *x2)
}
declare 9 macosx {
- KeySym XStringToKeysym(_Xconst char *c)
+ GContext XGContextFromGC(GC g)
}
declare 10 macosx {
- Window XRootWindow(Display *d, int i)
+ XHostAddress *XListHosts(Display *d, int *i, Bool *b)
}
+# second parameter was of type KeyCode
declare 11 macosx {
- XErrorHandler XSetErrorHandler(XErrorHandler x)
+ KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i)
}
declare 12 macosx {
- Status XAllocColor(Display *d, Colormap c, XColor *xp)
+ KeySym XStringToKeysym(_Xconst char *c)
}
declare 13 macosx {
- int XBell(Display *d, int i)
+ Window XRootWindow(Display *d, int i)
}
declare 14 macosx {
- int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
- int i2, _Xconst unsigned char *c, int i3)
+ XErrorHandler XSetErrorHandler(XErrorHandler x)
}
declare 15 macosx {
- int XChangeWindowAttributes(Display *d, Window w, unsigned long ul,
- XSetWindowAttributes *x)
+ Status XIconifyWindow(Display *d, Window w, int i)
}
declare 16 macosx {
- int XConfigureWindow(Display *d, Window w, unsigned int i,
- XWindowChanges *x)
+ Status XWithdrawWindow(Display *d, Window w, int i)
}
declare 17 macosx {
- int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
- int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)
+ Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip)
}
declare 18 macosx {
- int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
- int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4, unsigned long ul)
+ Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
declare 19 macosx {
- Pixmap XCreateBitmapFromData(Display *display, Drawable d,
- _Xconst char *data, unsigned int width, unsigned int height)
+ int XBell(Display *d, int i)
}
declare 20 macosx {
- int XDefineCursor(Display *d, Window w, Cursor c)
+ int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
+ int i2, _Xconst unsigned char *c, int i3)
}
declare 21 macosx {
- int XDestroyWindow(Display *d, Window w)
+ int XChangeWindowAttributes(Display *d, Window w, unsigned long ul,
+ XSetWindowAttributes *x)
}
declare 22 macosx {
- int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3, int i4)
+ int XClearWindow(Display *d, Window w)
}
declare 23 macosx {
- int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
+ int XConfigureWindow(Display *d, Window w, unsigned int i,
+ XWindowChanges *x)
}
declare 24 macosx {
- int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2)
+ int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)
}
declare 25 macosx {
- int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3, int i4)
+ int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1, unsigned int ui2,
+ int i3, int i4, unsigned long ul)
}
declare 26 macosx {
- int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x,
- int i1, int i2, int i3)
+ Pixmap XCreateBitmapFromData(Display *display, Drawable d,
+ _Xconst char *data, unsigned int width, unsigned int height)
}
declare 27 macosx {
- int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
+ int XDefineCursor(Display *d, Window w, Cursor c)
}
declare 28 macosx {
- int XFreeColormap(Display *d, Colormap c)
+ int XDeleteProperty(Display *d, Window w, Atom a)
}
declare 29 macosx {
- int XFreeColors(Display *d, Colormap c,
- unsigned long *ulp, int i, unsigned long ul)
+ int XDestroyWindow(Display *d, Window w)
}
declare 30 macosx {
- int XFreeModifiermap(XModifierKeymap *x)
+ int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2,
+ unsigned int ui1, unsigned int ui2, int i3, int i4)
}
declare 31 macosx {
- Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
- int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3,
- unsigned int *ui4)
+ int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
}
declare 32 macosx {
- int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2,
- Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1,
- unsigned long *ulp2, unsigned char **cpp)
+ int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
+ unsigned int ui1, unsigned int ui2)
}
declare 33 macosx {
- int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t)
+ int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2,
+ unsigned int ui1, unsigned int ui2, int i3, int i4)
}
declare 34 macosx {
- int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui,
- int i1, int i2, Window w2, Cursor c, Time t)
+ int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x,
+ int i1, int i2, int i3)
}
declare 35 macosx {
- KeyCode XKeysymToKeycode(Display *d, KeySym k)
+ int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
declare 36 macosx {
- int XMapWindow(Display *d, Window w)
+ int XForceScreenSaver(Display *d, int i)
}
declare 37 macosx {
- int XMoveResizeWindow(Display *d, Window w, int i1, int i2,
- unsigned int ui1, unsigned int ui2)
+ int XFreeColormap(Display *d, Colormap c)
}
declare 38 macosx {
- int XMoveWindow(Display *d, Window w, int i1, int i2)
+ int XFreeColors(Display *d, Colormap c,
+ unsigned long *ulp, int i, unsigned long ul)
}
declare 39 macosx {
- Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3,
- int *i1, int *i2, int *i3, int *i4, unsigned int *ui)
+ int XFreeCursor(Display *d, Cursor c)
}
declare 40 macosx {
- int XRaiseWindow(Display *d, Window w)
+ int XFreeModifiermap(XModifierKeymap *x)
}
declare 41 macosx {
- int XRefreshKeyboardMapping(XMappingEvent *x)
+ Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
+ int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3,
+ unsigned int *ui4)
}
declare 42 macosx {
- int XResizeWindow(Display *d, Window w, unsigned int ui1,
- unsigned int ui2)
+ int XGetInputFocus(Display *d, Window *w, int *i)
}
declare 43 macosx {
- int XSelectInput(Display *d, Window w, long l)
+ int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2,
+ Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1,
+ unsigned long *ulp2, unsigned char **cpp)
}
declare 44 macosx {
- Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
+ Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x)
}
declare 45 macosx {
- int XSetIconName(Display *d, Window w, _Xconst char *c)
+ int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t)
}
declare 46 macosx {
- int XSetInputFocus(Display *d, Window w, int i, Time t)
+ int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui,
+ int i1, int i2, Window w2, Cursor c, Time t)
}
declare 47 macosx {
- int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
+ KeyCode XKeysymToKeycode(Display *d, KeySym k)
}
declare 48 macosx {
- int XSetWindowBackground(Display *d, Window w, unsigned long ul)
+ Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2,
+ XColor *x1, XColor *x2)
}
declare 49 macosx {
- int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p)
+ int XMapWindow(Display *d, Window w)
}
declare 50 macosx {
- int XSetWindowBorder(Display *d, Window w, unsigned long ul)
+ int XMoveResizeWindow(Display *d, Window w, int i1, int i2,
+ unsigned int ui1, unsigned int ui2)
}
declare 51 macosx {
- int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p)
+ int XMoveWindow(Display *d, Window w, int i1, int i2)
}
declare 52 macosx {
- int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui)
+ int XNextEvent(Display *d, XEvent *x)
}
declare 53 macosx {
- int XSetWindowColormap(Display *d, Window w, Colormap c)
+ int XPutBackEvent(Display *d, XEvent *x)
}
declare 54 macosx {
- int XUngrabKeyboard(Display *d, Time t)
+ int XQueryColors(Display *d, Colormap c, XColor *x, int i)
}
declare 55 macosx {
- int XUngrabPointer(Display *d, Time t)
+ Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3,
+ int *i1, int *i2, int *i3, int *i4, unsigned int *ui)
}
declare 56 macosx {
- int XUnmapWindow(Display *d, Window w)
+ Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3,
+ Window **w4, unsigned int *ui)
}
declare 57 macosx {
- int TkPutImage(unsigned long *colors, int ncolors, Display *display,
- Drawable d, GC gc, XImage *image, int src_x, int src_y,
- int dest_x, int dest_y, unsigned int width, unsigned int height)
+ int XRaiseWindow(Display *d, Window w)
}
declare 58 macosx {
- Status XParseColor(Display *display, Colormap map,
- _Xconst char *spec, XColor *colorPtr)
+ int XRefreshKeyboardMapping(XMappingEvent *x)
}
declare 59 macosx {
- GC XCreateGC(Display *display, Drawable d,
- unsigned long valuemask, XGCValues *values)
+ int XResizeWindow(Display *d, Window w, unsigned int ui1,
+ unsigned int ui2)
}
declare 60 macosx {
- int XFreeGC(Display *display, GC gc)
+ int XSelectInput(Display *d, Window w, long l)
}
declare 61 macosx {
- Atom XInternAtom(Display *display, _Xconst char *atom_name,
- Bool only_if_exists)
+ Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
}
declare 62 macosx {
- int XSetBackground(Display *display, GC gc, unsigned long foreground)
+ int XSetCommand(Display *d, Window w, char **c, int i)
}
declare 63 macosx {
- int XSetForeground(Display *display, GC gc, unsigned long foreground)
+ int XSetIconName(Display *d, Window w, _Xconst char *c)
}
declare 64 macosx {
- int XSetClipMask(Display *display, GC gc, Pixmap pixmap)
+ int XSetInputFocus(Display *d, Window w, int i, Time t)
}
declare 65 macosx {
- int XSetClipOrigin(Display *display, GC gc,
- int clip_x_origin, int clip_y_origin)
+ int XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
declare 66 macosx {
- int XSetTSOrigin(Display *display, GC gc,
- int ts_x_origin, int ts_y_origin)
+ int XSetWindowBackground(Display *d, Window w, unsigned long ul)
}
declare 67 macosx {
- int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values)
+ int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p)
}
declare 68 macosx {
- int XSetFont(Display *display, GC gc, Font font)
+ int XSetWindowBorder(Display *d, Window w, unsigned long ul)
}
declare 69 macosx {
- int XSetArcMode(Display *display, GC gc, int arc_mode)
+ int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p)
}
declare 70 macosx {
- int XSetStipple(Display *display, GC gc, Pixmap stipple)
+ int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui)
}
declare 71 macosx {
- int XSetFillRule(Display *display, GC gc, int fill_rule)
+ int XSetWindowColormap(Display *d, Window w, Colormap c)
}
declare 72 macosx {
- int XSetFillStyle(Display *display, GC gc, int fill_style)
+ Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1,
+ int i2, int *i3, int *i4, Window *w3)
}
declare 73 macosx {
- int XSetFunction(Display *display, GC gc, int function)
+ int XUngrabKeyboard(Display *d, Time t)
}
declare 74 macosx {
- int XSetLineAttributes(Display *display, GC gc, unsigned int line_width,
- int line_style, int cap_style, int join_style)
+ int XUngrabPointer(Display *d, Time t)
}
declare 75 macosx {
- int _XInitImageFuncPtrs(XImage *image)
+ int XUnmapWindow(Display *d, Window w)
}
declare 76 macosx {
- XIC XCreateIC(XIM xim, ...)
+ int XWindowEvent(Display *d, Window w, long l, XEvent *x)
}
declare 77 macosx {
- XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
- XVisualInfo *vinfo_template, int *nitems_return)
+ void XDestroyIC(XIC x)
}
declare 78 macosx {
- void XSetWMClientMachine(Display *display, Window w,
- XTextProperty *text_prop)
+ Bool XFilterEvent(XEvent *x, Window w)
}
declare 79 macosx {
- Status XStringListToTextProperty(char **list, int count,
- XTextProperty *text_prop_return)
+ int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i,
+ KeySym *k, Status *s)
}
declare 80 macosx {
- int XDrawSegments(Display *display, Drawable d, GC gc,
- XSegment *segments, int nsegments)
+ int TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ Drawable d, GC gc, XImage *image, int src_x, int src_y,
+ int dest_x, int dest_y, unsigned int width, unsigned int height)
}
declare 81 macosx {
- int XForceScreenSaver(Display *display, int mode)
+ int XSetClipRectangles(Display *display, GC gc, int clip_x_origin,
+ int clip_y_origin, XRectangle rectangles[], int n, int ordering)
}
declare 82 macosx {
- int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
- int x2, int y2)
+ Status XParseColor(Display *display, Colormap map,
+ _Xconst char *spec, XColor *colorPtr)
}
declare 83 macosx {
- int XFillRectangle(Display *display, Drawable d, GC gc,
- int x, int y, unsigned int width, unsigned int height)
+ GC XCreateGC(Display *display, Drawable d,
+ unsigned long valuemask, XGCValues *values)
}
declare 84 macosx {
- int XClearWindow(Display *d, Window w)
+ int XFreeGC(Display *display, GC gc)
}
declare 85 macosx {
- int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y)
+ Atom XInternAtom(Display *display, _Xconst char *atom_name,
+ Bool only_if_exists)
}
declare 86 macosx {
- int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points,
- int npoints, int mode)
+ int XSetBackground(Display *display, GC gc, unsigned long foreground)
}
declare 87 macosx {
- int XWarpPointer(Display *display, Window src_w, Window dest_w,
- int src_x, int src_y, unsigned int src_width,
- unsigned int src_height, int dest_x, int dest_y)
+ int XSetForeground(Display *display, GC gc, unsigned long foreground)
}
declare 88 macosx {
- int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out)
+ int XSetClipMask(Display *display, GC gc, Pixmap pixmap)
}
declare 89 macosx {
- int XQueryColors(Display *display, Colormap colormap,
- XColor *defs_in_out, int ncolors)
+ int XSetClipOrigin(Display *display, GC gc,
+ int clip_x_origin, int clip_y_origin)
}
declare 90 macosx {
- Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3,
- Window **w4, unsigned int *ui)
+ int XSetTSOrigin(Display *display, GC gc,
+ int ts_x_origin, int ts_y_origin)
}
declare 91 macosx {
- int XSync(Display *display, Bool discard)
+ int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values)
}
declare 92 macosx {
- Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1,
- int i2, int *i3, int *i4, Window *w3)
+ int XSetFont(Display *display, GC gc, Font font)
}
declare 93 macosx {
- int XDeleteProperty(Display *d, Window w, Atom a)
+ int XSetArcMode(Display *display, GC gc, int arc_mode)
}
declare 94 macosx {
- int XFreeCursor(Display *d, Cursor c)
+ int XSetStipple(Display *display, GC gc, Pixmap stipple)
}
declare 95 macosx {
- int XGetInputFocus(Display *d, Window *w, int *i)
+ int XSetFillRule(Display *display, GC gc, int fill_rule)
}
declare 96 macosx {
- int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i,
- KeySym *k, Status *s)
+ int XSetFillStyle(Display *display, GC gc, int fill_style)
}
declare 97 macosx {
- int XNextEvent(Display *d, XEvent *x)
+ int XSetFunction(Display *display, GC gc, int function)
}
declare 98 macosx {
- int XPutBackEvent(Display *d, XEvent *x)
+ int XSetLineAttributes(Display *display, GC gc, unsigned int line_width,
+ int line_style, int cap_style, int join_style)
}
declare 99 macosx {
- int XSetCommand(Display *d, Window w, char **c, int i)
+ int _XInitImageFuncPtrs(XImage *image)
}
declare 100 macosx {
- int XWindowEvent(Display *d, Window w, long l, XEvent *x)
+ XIC XCreateIC(XIM xim, ...)
}
declare 101 macosx {
- Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x)
+ XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
+ XVisualInfo *vinfo_template, int *nitems_return)
}
declare 102 macosx {
- Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip)
+ void XSetWMClientMachine(Display *display, Window w,
+ XTextProperty *text_prop)
}
declare 103 macosx {
- Status XIconifyWindow(Display *d, Window w, int i)
+ Status XStringListToTextProperty(char **list, int count,
+ XTextProperty *text_prop_return)
}
declare 104 macosx {
- Status XWithdrawWindow(Display *d, Window w, int i)
+ int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
+ int x2, int y2)
}
declare 105 macosx {
- XHostAddress *XListHosts(Display *d, int *i, Bool *b)
+ int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
+ unsigned int sw, unsigned int sh, int dx, int dy)
}
declare 106 macosx {
- int XSetClipRectangles(Display *display, GC gc, int clip_x_origin,
- int clip_y_origin, XRectangle rectangles[], int n, int ordering)
+ int XFillRectangle(Display *display, Drawable d, GC gc,
+ int x, int y, unsigned int width, unsigned int height)
}
+
+# New in Tk 8.6
declare 107 macosx {
int XFlush(Display *display)
}
@@ -1955,18 +1861,21 @@ declare 112 macosx {
XAfterFunction XSynchronize(Display *display, Bool onoff)
}
declare 113 macosx {
- Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2,
- XColor *x1, XColor *x2)
+ int XSync(Display *display, Bool discard)
}
declare 114 macosx {
VisualID XVisualIDFromVisual(Visual *visual)
}
+
+# For tktreectrl
declare 120 macosx {
int XOffsetRegion(Region rgn, int dx, int dy)
}
declare 121 macosx {
int XUnionRegion(Region srca, Region srcb, Region dr_return)
}
+
+# For 3dcanvas
declare 122 macosx {
Window XCreateWindow(Display *display, Window parent, int x, int y,
unsigned int width, unsigned int height,
@@ -1974,6 +1883,8 @@ declare 122 macosx {
Visual *visual, unsigned long value_mask,
XSetWindowAttributes *attributes)
}
+
+# Various, e.g. for stub-enabled BLT
declare 129 macosx {
int XLowerWindow(Display *d, Window w)
}
@@ -1986,6 +1897,15 @@ declare 131 macosx {
declare 132 macosx {
int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n)
}
+declare 133 macosx {
+ int XDrawSegments(Display *d, Drawable dr, GC gc, XSegment *s, int n)
+}
+declare 134 macosx {
+ int XDrawPoint(Display *d, Drawable dr, GC gc, int x, int y)
+}
+declare 135 macosx {
+ int XDrawPoints(Display *d, Drawable dr, GC gc, XPoint *p, int n, int m)
+}
declare 136 macosx {
int XReparentWindow(Display *d, Window w, Window p, int x, int y)
}
@@ -2000,6 +1920,7 @@ declare 138 macosx {
declare 139 macosx {
int XPointInRegion(Region rgn, int x, int y)
}
+# For XIM
declare 140 macosx {
XVaNestedList XVaCreateNestedList(int dummy, ...)
}
@@ -2012,18 +1933,6 @@ declare 142 macosx {
declare 143 macosx {
void XSetICFocus(XIC xic)
}
-declare 144 macosx {
- void XDestroyIC(XIC xic)
-}
-declare 145 macosx {
- Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
- XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)
-}
-declare 146 macosx {
- Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
- unsigned int ui1, unsigned int ui2, XColor _Xconst *x1,
- XColor _Xconst *x2)
-}
declare 147 macosx {
void XFreeFontSet(Display *display, XFontSet fontset)
}
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 5ee4791..6448c92 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -75,41 +75,6 @@
# endif
#endif
-#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7)
-# define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int, Tcl_DString *))Tcl_UniCharToUtfDString)
-# define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int, Tcl_DString *))Tcl_UtfToUniCharDString)
-# define Tcl_Char16ToUtfDString Tcl_UniCharToUtfDString
-# define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString
-# define TCL_COMBINE 0
-#endif
-
-/* Make available UTF-32 versions of the API, even though we compile with TCL_UTF_MAX=3 */
-#if TCL_MAJOR_VERSION > 8
-# define TkUtfToUniChar (tclStubsPtr->tcl_UtfToUniChar) /* 646 */
-# define TkUniCharToUtf (tclStubsPtr->tcl_UniCharToUtf) /* 324 (without TCL_COMBINE) */
-# define TkNumUtfChars (tclStubsPtr->tcl_NumUtfChars) /* 669 */
-# define TkGetCharLength (tclStubsPtr->tcl_GetCharLength) /* 670 */
-# define TkUtfAtIndex (tclStubsPtr->tcl_UtfAtIndex) /* 671 */
-#else
- MODULE_SCOPE Tcl_Size TkUtfToUniChar(const char *, int *);
- MODULE_SCOPE Tcl_Size TkUniCharToUtf(int, char *);
-# ifdef USE_TCL_STUBS
-# define TkNumUtfChars (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \
- ((Tcl_Size (*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[669])) \
- : (tclStubsPtr->tcl_NumUtfChars) /* 312 */)
-# define TkGetCharLength (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \
- ((Tcl_Size (*)(Tcl_Obj *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[670])) \
- : (tclStubsPtr->tcl_GetCharLength) /* 380 */)
-# define TkUtfAtIndex (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \
- ((const char *(*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[671])) \
- : (tclStubsPtr->tcl_UtfAtIndex) /* 325 */)
-# else
-# define TkNumUtfChars TclNumUtfChars
-# define TkGetCharLength TclGetCharLength
-# define TkUtfAtIndex TclUtfAtIndex
-# endif
-#endif
-
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define TKFLEXARRAY
#elif defined(__GNUC__) && (__GNUC__ > 2)
@@ -118,10 +83,6 @@
# define TKFLEXARRAY 1
#endif
-#if !defined(Tcl_GetParent) && (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
-# define Tcl_GetParent Tcl_GetMaster
-#endif
-
/*
* Macros used to cast between pointers and integers (e.g. when storing an int
* in ClientData), on 64-bit architectures they avoid gcc warning about "cast
@@ -584,21 +545,6 @@ typedef struct TkDisplay {
* the display when we no longer have any Tk
* applications using it. */
- /*
- * The following field were all added for Tk8.3
- */
-
-#if TCL_MAJOR_VERSION < 9
-#if !defined(TK_NO_DEPRECATED)
- int mouseButtonState; /* Current mouse button state for this
- * display. NOT USED as of 8.6.10 */
- Window mouseButtonWindow; /* Window the button state was set in, added
- * in Tk 8.4. */
-#else
- int notused1;
- XID notused2;
-#endif /* !TK_NO_DEPRECATED */
-#endif
Tk_Window warpWindow;
Tk_Window warpMainwin; /* For finding the root window for warping
* purposes. */
@@ -994,18 +940,6 @@ typedef struct {
#define TK_MAKE_MENU_POPUP 1
#define TK_MAKE_MENU_DROPDOWN 2
-/* See TIP #494 */
-#ifndef TCL_IO_FAILURE
-# define TCL_IO_FAILURE (-1)
-#endif
-/* See TIP #537 */
-#ifndef TCL_INDEX_NONE
-# define TCL_INDEX_NONE (-1)
-#endif
-#ifndef TCL_INDEX_END
-# define TCL_INDEX_END ((Tcl_Size)-2)
-#endif
-
/*
* The following structure is used with TkMakeEnsemble to create ensemble
* commands and optionally to create sub-ensembles.
@@ -1135,13 +1069,6 @@ typedef struct {
size_t version;
} TkObjType;
-#ifndef TCL_OBJTYPE_V0
-# define TCL_OBJTYPE_V0 /* just empty */
-#endif
-#ifndef TCL_OBJTYPE_V1
-# define TCL_OBJTYPE_V1(lengthProc) /* just empty */
-#endif
-
MODULE_SCOPE const TkObjType tkBorderObjType;
MODULE_SCOPE const TkObjType tkBitmapObjType;
MODULE_SCOPE const TkObjType tkColorObjType;
@@ -1353,21 +1280,13 @@ MODULE_SCOPE void TkInitEmbeddedConfigurationInformation(
Tcl_Interp *interp);
MODULE_SCOPE void TkDoWarpWrtWin(TkDisplay *dispPtr);
MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr);
-MODULE_SCOPE int TkListCreateFrame(void *clientData,
- Tcl_Interp *interp, Tcl_Obj *listObj,
- int toplevel, Tcl_Obj *nameObj);
MODULE_SCOPE void TkRotatePoint(double originX, double originY,
double sine, double cosine, double *xPtr,
double *yPtr);
MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*);
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
-# define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1)
-# define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL
-#else
-# define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value)))
-# define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL
-#endif
+#define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value)))
+#define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL
#ifdef _WIN32
@@ -1425,7 +1344,6 @@ MODULE_SCOPE Tcl_ObjCmdProc TkUnsupported1ObjCmd;
* For Tktest.
*/
MODULE_SCOPE Tcl_ObjCmdProc SquareObjCmd;
-MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
#if !(defined(_WIN32) || defined(MAC_OSX_TK))
#define TkplatformtestInit(x) TCL_OK
#else
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index d71885b..c1dc2eb 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -80,8 +80,8 @@ EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin,
XColor fg, XColor bg);
/* 13 */
EXTERN int TkCreateFrame(void *clientData, Tcl_Interp *interp,
- Tcl_Size argc, const char *const *argv,
- int toplevel, const char *appName);
+ Tcl_Size objc, Tcl_Obj *const objv[],
+ int type, const char *appName);
/* 14 */
EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
const char *screenName, const char *baseName);
@@ -202,9 +202,7 @@ EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force);
EXTERN void TkpDisplayWarning(const char *msg, const char *title);
/* 59 */
EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name);
-/* 60 */
-TK_DEPRECATED("renamed to Tk_GetOtherWindow")
-TkWindow * TkpGetOtherWindow(TkWindow *winPtr);
+/* Slot 60 is reserved */
/* 61 */
EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr);
/* 62 */
@@ -212,14 +210,10 @@ EXTERN int TkpInit(Tcl_Interp *interp);
/* 63 */
EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable);
-/* 64 */
-TK_DEPRECATED("renamed to Tk_MakeContainer")
-void TkpMakeContainer(Tk_Window tkwin);
+/* Slot 64 is reserved */
/* 65 */
EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient);
-/* 66 */
-TK_DEPRECATED("renamed to Tk_MakeWindow")
-Window TkpMakeWindow(TkWindow *winPtr, Window parent);
+/* Slot 66 is reserved */
/* 67 */
EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp,
const char *menuName);
@@ -238,14 +232,8 @@ EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr);
/* 73 */
EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr,
XEvent *eventPtr);
-/* 74 */
-TK_DEPRECATED("renamed to Tk_SetMainMenubar")
-void TkpSetMainMenubar(Tcl_Interp *interp,
- Tk_Window tkwin, const char *menuName);
-/* 75 */
-TK_DEPRECATED("renamed to Tk_UseWindow")
-int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin,
- const char *string);
+/* Slot 74 is reserved */
+/* Slot 75 is reserved */
/* Slot 76 is reserved */
/* 77 */
EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr,
@@ -270,11 +258,7 @@ EXTERN void TkSelInit(Tk_Window tkwin);
/* 83 */
EXTERN void TkSelPropProc(XEvent *eventPtr);
/* Slot 84 is reserved */
-/* 85 */
-TK_DEPRECATED("renamed to Tk_SetWindowMenubar")
-void TkSetWindowMenuBar(Tcl_Interp *interp,
- Tk_Window tkwin, const char *oldMenuName,
- const char *menuName);
+/* Slot 85 is reserved */
/* 86 */
EXTERN KeySym TkStringToKeysym(const char *name);
/* 87 */
@@ -335,10 +319,7 @@ EXTERN const char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr,
Tcl_DString *dsPtr);
/* 110 */
EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
-/* 111 */
-TK_DEPRECATED("renamed to Tk_GetSystemDefault")
-Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin,
- const char *dbName, const char *className);
+/* Slot 111 is reserved */
/* 112 */
EXTERN void TkpMenuThreadInit(void);
/* 113 */
@@ -359,21 +340,15 @@ EXTERN int XSetRegion(Display *display, GC gc, Region rgn);
EXTERN int XUnionRectWithRegion(XRectangle *rect, Region src,
Region dr_return);
/* Slot 120 is reserved */
-#ifdef MAC_OSX_TK /* AQUA */
/* 121 */
EXTERN Pixmap TkpCreateNativeBitmap(Display *display,
const void *source);
-#endif /* AQUA */
-#ifdef MAC_OSX_TK /* AQUA */
/* 122 */
EXTERN void TkpDefineNativeBitmaps(void);
-#endif /* AQUA */
/* Slot 123 is reserved */
-#ifdef MAC_OSX_TK /* AQUA */
/* 124 */
EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
const char *name, int *width, int *height);
-#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
/* Slot 127 is reserved */
@@ -384,11 +359,7 @@ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
-/* 135 */
-TK_DEPRECATED("renamed to Tk_DrawHighlightBorder")
-void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC,
- GC bgGC, int highlightWidth,
- Drawable drawable);
+/* Slot 135 is reserved */
/* 136 */
EXTERN void TkSetFocusWin(TkWindow *winPtr, int force);
/* 137 */
@@ -592,7 +563,7 @@ typedef struct TkIntStubs {
void (*reserved10)(void);
void (*reserved11)(void);
TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */
- int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char *const *argv, int toplevel, const char *appName); /* 13 */
+ int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int type, const char *appName); /* 13 */
Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */
Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */
void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */
@@ -639,13 +610,13 @@ typedef struct TkIntStubs {
void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */
void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */
void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */
- TCL_DEPRECATED_API("renamed to Tk_GetOtherWindow") TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */
+ void (*reserved60)(void);
TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */
int (*tkpInit) (Tcl_Interp *interp); /* 62 */
void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */
- TCL_DEPRECATED_API("renamed to Tk_MakeContainer") void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */
+ void (*reserved64)(void);
void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */
- TCL_DEPRECATED_API("renamed to Tk_MakeWindow") Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */
+ void (*reserved66)(void);
void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */
TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */
int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */
@@ -653,8 +624,8 @@ typedef struct TkIntStubs {
double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */
int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */
void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */
- TCL_DEPRECATED_API("renamed to Tk_SetMainMenubar") void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */
- TCL_DEPRECATED_API("renamed to Tk_UseWindow") int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */
+ void (*reserved74)(void);
+ void (*reserved75)(void);
void (*reserved76)(void);
void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */
int (*tkReadBitmapFile) (Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return); /* 78 */
@@ -664,7 +635,7 @@ typedef struct TkIntStubs {
void (*tkSelInit) (Tk_Window tkwin); /* 82 */
void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */
void (*reserved84)(void);
- TCL_DEPRECATED_API("renamed to Tk_SetWindowMenubar") void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */
+ void (*reserved85)(void);
KeySym (*tkStringToKeysym) (const char *name); /* 86 */
int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */
void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */
@@ -690,7 +661,7 @@ typedef struct TkIntStubs {
int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */
const char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
- TCL_DEPRECATED_API("renamed to Tk_GetSystemDefault") Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */
+ void (*reserved111)(void);
void (*tkpMenuThreadInit) (void); /* 112 */
int (*xClipBox) (Region rgn, XRectangle *rect_return); /* 113 */
Region (*xCreateRegion) (void); /* 114 */
@@ -700,43 +671,10 @@ typedef struct TkIntStubs {
int (*xSetRegion) (Display *display, GC gc, Region rgn); /* 118 */
int (*xUnionRectWithRegion) (XRectangle *rect, Region src, Region dr_return); /* 119 */
void (*reserved120)(void);
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- void (*reserved121)(void);
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- void (*reserved121)(void);
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */
-#endif /* AQUA */
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- void (*reserved122)(void);
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- void (*reserved122)(void);
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
void (*tkpDefineNativeBitmaps) (void); /* 122 */
-#endif /* AQUA */
void (*reserved123)(void);
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- void (*reserved124)(void);
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- void (*reserved124)(void);
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */
-#endif /* AQUA */
void (*reserved125)(void);
void (*reserved126)(void);
void (*reserved127)(void);
@@ -747,7 +685,7 @@ typedef struct TkIntStubs {
void (*reserved132)(void);
void (*reserved133)(void);
void (*reserved134)(void);
- TCL_DEPRECATED_API("renamed to Tk_DrawHighlightBorder") void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */
+ void (*reserved135)(void);
void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */
void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */
KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */
@@ -931,20 +869,17 @@ extern const TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkpDisplayWarning) /* 58 */
#define TkpGetAppName \
(tkIntStubsPtr->tkpGetAppName) /* 59 */
-#define TkpGetOtherWindow \
- (tkIntStubsPtr->tkpGetOtherWindow) /* 60 */
+/* Slot 60 is reserved */
#define TkpGetWrapperWindow \
(tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */
#define TkpInit \
(tkIntStubsPtr->tkpInit) /* 62 */
#define TkpInitializeMenuBindings \
(tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */
-#define TkpMakeContainer \
- (tkIntStubsPtr->tkpMakeContainer) /* 64 */
+/* Slot 64 is reserved */
#define TkpMakeMenuWindow \
(tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */
-#define TkpMakeWindow \
- (tkIntStubsPtr->tkpMakeWindow) /* 66 */
+/* Slot 66 is reserved */
#define TkpMenuNotifyToplevelCreate \
(tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */
#define TkpOpenDisplay \
@@ -959,10 +894,8 @@ extern const TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkPositionInTree) /* 72 */
#define TkpRedirectKeyEvent \
(tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */
-#define TkpSetMainMenubar \
- (tkIntStubsPtr->tkpSetMainMenubar) /* 74 */
-#define TkpUseWindow \
- (tkIntStubsPtr->tkpUseWindow) /* 75 */
+/* Slot 74 is reserved */
+/* Slot 75 is reserved */
/* Slot 76 is reserved */
#define TkQueueEventForAllChildren \
(tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */
@@ -979,8 +912,7 @@ extern const TkIntStubs *tkIntStubsPtr;
#define TkSelPropProc \
(tkIntStubsPtr->tkSelPropProc) /* 83 */
/* Slot 84 is reserved */
-#define TkSetWindowMenuBar \
- (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
+/* Slot 85 is reserved */
#define TkStringToKeysym \
(tkIntStubsPtr->tkStringToKeysym) /* 86 */
#define TkThickPolyLineToArea \
@@ -1031,8 +963,7 @@ extern const TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkpGetString) /* 109 */
#define TkpGetSubFonts \
(tkIntStubsPtr->tkpGetSubFonts) /* 110 */
-#define TkpGetSystemDefault \
- (tkIntStubsPtr->tkpGetSystemDefault) /* 111 */
+/* Slot 111 is reserved */
#define TkpMenuThreadInit \
(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
#define XClipBox \
@@ -1050,19 +981,13 @@ extern const TkIntStubs *tkIntStubsPtr;
#define XUnionRectWithRegion \
(tkIntStubsPtr->xUnionRectWithRegion) /* 119 */
/* Slot 120 is reserved */
-#ifdef MAC_OSX_TK /* AQUA */
#define TkpCreateNativeBitmap \
(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
-#endif /* AQUA */
-#ifdef MAC_OSX_TK /* AQUA */
#define TkpDefineNativeBitmaps \
(tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
-#endif /* AQUA */
/* Slot 123 is reserved */
-#ifdef MAC_OSX_TK /* AQUA */
#define TkpGetNativeAppBitmap \
(tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
-#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
/* Slot 127 is reserved */
@@ -1073,8 +998,7 @@ extern const TkIntStubs *tkIntStubsPtr;
/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
-#define TkpDrawHighlightBorder \
- (tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */
+/* Slot 135 is reserved */
#define TkSetFocusWin \
(tkIntStubsPtr->tkSetFocusWin) /* 136 */
#define TkpSetKeycodeAndState \
@@ -1186,39 +1110,17 @@ extern const TkIntStubs *tkIntStubsPtr;
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#undef TkpCmapStressed_
-#undef TkpSync_
-#undef TkUnixContainerId_
-#undef TkUnixDoOneXEvent_
-#undef TkUnixSetMenubar_
-#undef TkWmCleanup_
-#undef TkSendCleanup_
-#undef TkpTestsendCmd_
-#undef TkSetWindowMenuBar
-#undef TkpDrawHighlightBorder
-#undef TkpUseWindow
-#undef TkpSetMainMenubar
-#undef TkpGetOtherWindow
-#undef TkpGetSystemDefault
-#undef TkpMakeContainer
-#undef TkpMakeWindow
-
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION == 8)
-# define TkSetWindowMenuBar Tk_SetWindowMenubar
-# define TkpDrawHighlightBorder Tk_DrawHighlightBorder
-# define TkpUseWindow Tk_UseWindow
-# define TkpSetMainMenubar Tk_SetMainMenubar
-# define TkpGetOtherWindow ((TkWindow *(*)(TkWindow *))(void *)Tk_GetOtherWindow)
-# define TkpGetSystemDefault Tk_GetSystemDefault
-# define TkpMakeContainer Tk_MakeContainer
-# define TkpMakeWindow ((Window (*)(TkWindow *, Window))(void *)Tk_MakeWindow)
-#endif
-
#if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS)
# undef TkpWillDrawWidget
# undef TkpRedrawWidget
+# undef TkpDefineNativeBitmaps
+# undef TkpCreateNativeBitmap
+# undef TkpGetNativeAppBitmap
# define TkpWillDrawWidget(w) 0
# define TkpRedrawWidget(w)
+# define TkpDefineNativeBitmaps()
+# define TkpCreateNativeBitmap(display, source) None
+# define TkpGetNativeAppBitmap(display, name, w, h) None
#endif
#endif /* _TKINTDECLS */
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index e87272e..4b93ab9 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -36,8 +36,7 @@ extern "C" {
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
/* 0 */
-EXTERN char * TkAlignImageData(XImage *image, int alignment,
- int bitOrder);
+EXTERN void TkCreateXEventSource(void);
/* Slot 1 is reserved */
/* 2 */
EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
@@ -114,7 +113,8 @@ EXTERN void TkWinDialogDebug(int debug);
EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin,
const char *dbName, const char *className);
/* 33 */
-EXTERN int TkWinGetPlatformId(void);
+EXTERN char * TkAlignImageData(XImage *image, int alignment,
+ int bitOrder);
/* 34 */
EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance);
/* 35 */
@@ -122,8 +122,7 @@ EXTERN int TkWinGetPlatformTheme(void);
/* 36 */
EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);
-/* 37 */
-EXTERN void TkCreateXEventSource(void);
+/* Slot 37 is reserved */
/* 38 */
EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap);
/* 39 */
@@ -146,30 +145,31 @@ EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp,
EXTERN Tk_Window TkpGetCapture(void);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-/* 0 */
-EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
- int active);
-/* Slot 1 is reserved */
+/* Slot 0 is reserved */
+/* 1 */
+EXTERN void TkAboutDlg(void);
/* 2 */
-EXTERN void TkGenerateActivateEvents_(TkWindow *winPtr,
+EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
int active);
/* 3 */
-EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
+EXTERN unsigned long TkpGetMS(void);
/* 4 */
-EXTERN void TkpSetCapture(TkWindow *winPtr);
+EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
/* 5 */
EXTERN void TkpSetCursor(TkpCursor cursor);
/* 6 */
-EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
+EXTERN int TkpScanWindowId(Tcl_Interp *interp,
+ const char *string, Window *idPtr);
/* 7 */
-EXTERN void TkAboutDlg(void);
+EXTERN int TkpWmSetState(TkWindow *winPtr, int state);
/* 8 */
EXTERN unsigned int TkMacOSXButtonKeyState(void);
/* 9 */
EXTERN void TkMacOSXClearMenubarActive(void);
/* 10 */
EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index);
-/* Slot 11 is reserved */
+/* 11 */
+EXTERN void TkpSetCapture(TkWindow *winPtr);
/* 12 */
EXTERN void TkMacOSXHandleTearoffMenu(void);
/* Slot 13 is reserved */
@@ -188,9 +188,7 @@ EXTERN void TkMacOSXHandleMenuSelect(short theMenu,
/* 21 */
EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin,
int flag);
-/* 22 */
-EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont,
- unsigned int searchChar);
+/* Slot 22 is reserved */
/* 23 */
EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr);
/* 24 */
@@ -204,8 +202,7 @@ EXTERN int TkMacOSXResizable(TkWindow *winPtr);
EXTERN void TkMacOSXSetHelpMenuItemCount(void);
/* 29 */
EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag);
-/* 30 */
-EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable);
+/* Slot 30 is reserved */
/* 31 */
EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort);
/* 32 */
@@ -251,13 +248,6 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window,
EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
/* 52 */
EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
-/* 53 */
-EXTERN unsigned long TkpGetMS(void);
-/* 54 */
-EXTERN void * TkMacOSXDrawable(Drawable drawable);
-/* 55 */
-EXTERN int TkpScanWindowId(Tcl_Interp *interp,
- const char *string, Window *idPtr);
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
/* 0 */
@@ -266,29 +256,20 @@ EXTERN void TkCreateXEventSource(void);
/* 2 */
EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
int active);
-/* 3 */
-EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap);
-/* 4 */
-EXTERN void TkpSync(Display *display);
-/* 5 */
-EXTERN Window TkUnixContainerId(TkWindow *winPtr);
+/* Slot 3 is reserved */
+/* Slot 4 is reserved */
+/* Slot 5 is reserved */
/* 6 */
-EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr);
-/* 7 */
-EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar);
-/* 8 */
EXTERN int TkpScanWindowId(Tcl_Interp *interp,
const char *string, Window *idPtr);
+/* Slot 7 is reserved */
+/* Slot 8 is reserved */
/* 9 */
-EXTERN void TkWmCleanup(TkDisplay *dispPtr);
-/* 10 */
-EXTERN void TkSendCleanup(TkDisplay *dispPtr);
-/* Slot 11 is reserved */
-/* 12 */
EXTERN int TkpWmSetState(TkWindow *winPtr, int state);
-/* 13 */
-EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp,
- Tcl_Size objc, Tcl_Obj *const objv[]);
+/* Slot 10 is reserved */
+/* Slot 11 is reserved */
+/* Slot 12 is reserved */
+/* Slot 13 is reserved */
/* Slot 14 is reserved */
/* Slot 15 is reserved */
/* Slot 16 is reserved */
@@ -314,19 +295,19 @@ EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp,
/* Slot 36 is reserved */
/* Slot 37 is reserved */
/* 38 */
-EXTERN int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap);
+EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap);
/* 39 */
-EXTERN void TkpSync_(Display *display);
+EXTERN void TkpSync(Display *display);
/* 40 */
-EXTERN Window TkUnixContainerId_(TkWindow *winPtr);
+EXTERN Window TkUnixContainerId(TkWindow *winPtr);
/* 41 */
-EXTERN int TkUnixDoOneXEvent_(Tcl_Time *timePtr);
+EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr);
/* 42 */
-EXTERN void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar);
+EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar);
/* 43 */
-EXTERN void TkWmCleanup_(TkDisplay *dispPtr);
+EXTERN void TkWmCleanup(TkDisplay *dispPtr);
/* 44 */
-EXTERN void TkSendCleanup_(TkDisplay *dispPtr);
+EXTERN void TkSendCleanup(TkDisplay *dispPtr);
/* 45 */
EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp,
Tcl_Size objc, Tcl_Obj *const objv[]);
@@ -337,7 +318,7 @@ typedef struct TkIntPlatStubs {
void *hooks;
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
- char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */
+ void (*tkCreateXEventSource) (void); /* 0 */
void (*reserved1)(void);
void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */
unsigned long (*tkpGetMS) (void); /* 3 */
@@ -370,11 +351,11 @@ typedef struct TkIntPlatStubs {
void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */
void (*tkWinDialogDebug) (int debug); /* 31 */
Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */
- int (*tkWinGetPlatformId) (void); /* 33 */
+ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 33 */
void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */
int (*tkWinGetPlatformTheme) (void); /* 35 */
LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */
- void (*tkCreateXEventSource) (void); /* 37 */
+ void (*reserved37)(void);
int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */
void (*tkpSync) (Display *display); /* 39 */
Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */
@@ -387,18 +368,18 @@ typedef struct TkIntPlatStubs {
Tk_Window (*tkpGetCapture) (void); /* 47 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */
- void (*reserved1)(void);
- void (*tkGenerateActivateEvents_) (TkWindow *winPtr, int active); /* 2 */
- void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */
- void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */
+ void (*reserved0)(void);
+ void (*tkAboutDlg) (void); /* 1 */
+ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */
+ unsigned long (*tkpGetMS) (void); /* 3 */
+ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */
void (*tkpSetCursor) (TkpCursor cursor); /* 5 */
- void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */
- void (*tkAboutDlg) (void); /* 7 */
+ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */
+ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */
unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */
void (*tkMacOSXClearMenubarActive) (void); /* 9 */
int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */
- void (*reserved11)(void);
+ void (*tkpSetCapture) (TkWindow *winPtr); /* 11 */
void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */
void (*reserved13)(void);
int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */
@@ -409,7 +390,7 @@ typedef struct TkIntPlatStubs {
void (*reserved19)(void);
void (*reserved20)(void);
void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */
- int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */
+ void (*reserved22)(void);
void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */
void * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */
void (*tkMacOSXMenuClick) (void); /* 25 */
@@ -417,7 +398,7 @@ typedef struct TkIntPlatStubs {
int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */
void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */
void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */
- void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */
+ void (*reserved30)(void);
void (*tkMacOSXSetUpGraphicsPort) (GC gc, void *destPort); /* 31 */
void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */
void (*reserved33)(void);
@@ -440,25 +421,22 @@ typedef struct TkIntPlatStubs {
int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */
void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */
void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */
- unsigned long (*tkpGetMS) (void); /* 53 */
- void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */
- int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
void (*tkCreateXEventSource) (void); /* 0 */
void (*reserved1)(void);
void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */
- int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */
- void (*tkpSync) (Display *display); /* 4 */
- Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */
- int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */
- void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */
- int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */
- void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */
- void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */
+ void (*reserved3)(void);
+ void (*reserved4)(void);
+ void (*reserved5)(void);
+ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */
+ void (*reserved7)(void);
+ void (*reserved8)(void);
+ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */
+ void (*reserved10)(void);
void (*reserved11)(void);
- int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */
- int (*tkpTestsendCmd_) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 13 */
+ void (*reserved12)(void);
+ void (*reserved13)(void);
void (*reserved14)(void);
void (*reserved15)(void);
void (*reserved16)(void);
@@ -483,13 +461,13 @@ typedef struct TkIntPlatStubs {
void (*reserved35)(void);
void (*reserved36)(void);
void (*reserved37)(void);
- int (*tkpCmapStressed_) (Tk_Window tkwin, Colormap colormap); /* 38 */
- void (*tkpSync_) (Display *display); /* 39 */
- Window (*tkUnixContainerId_) (TkWindow *winPtr); /* 40 */
- int (*tkUnixDoOneXEvent_) (Tcl_Time *timePtr); /* 41 */
- void (*tkUnixSetMenubar_) (Tk_Window tkwin, Tk_Window menubar); /* 42 */
- void (*tkWmCleanup_) (TkDisplay *dispPtr); /* 43 */
- void (*tkSendCleanup_) (TkDisplay *dispPtr); /* 44 */
+ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */
+ void (*tkpSync) (Display *display); /* 39 */
+ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */
+ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */
+ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */
+ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */
+ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */
int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */
#endif /* X11 */
} TkIntPlatStubs;
@@ -507,8 +485,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
*/
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
-#define TkAlignImageData \
- (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */
+#define TkCreateXEventSource \
+ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */
/* Slot 1 is reserved */
#define TkGenerateActivateEvents \
(tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */
@@ -572,16 +550,15 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
(tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */
#define TkWinGetMenuSystemDefault \
(tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */
-#define TkWinGetPlatformId \
- (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */
+#define TkAlignImageData \
+ (tkIntPlatStubsPtr->tkAlignImageData) /* 33 */
#define TkWinSetHINSTANCE \
(tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */
#define TkWinGetPlatformTheme \
(tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */
#define TkWinChildProc \
(tkIntPlatStubsPtr->tkWinChildProc) /* 36 */
-#define TkCreateXEventSource \
- (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */
+/* Slot 37 is reserved */
#define TkpCmapStressed \
(tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */
#define TkpSync \
@@ -603,28 +580,29 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
(tkIntPlatStubsPtr->tkpGetCapture) /* 47 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
+/* Slot 0 is reserved */
+#define TkAboutDlg \
+ (tkIntPlatStubsPtr->tkAboutDlg) /* 1 */
#define TkGenerateActivateEvents \
- (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */
-/* Slot 1 is reserved */
-#define TkGenerateActivateEvents_ \
- (tkIntPlatStubsPtr->tkGenerateActivateEvents_) /* 2 */
+ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */
+#define TkpGetMS \
+ (tkIntPlatStubsPtr->tkpGetMS) /* 3 */
#define TkPointerDeadWindow \
- (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */
-#define TkpSetCapture \
- (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */
+ (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */
#define TkpSetCursor \
(tkIntPlatStubsPtr->tkpSetCursor) /* 5 */
+#define TkpScanWindowId \
+ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */
#define TkpWmSetState \
- (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */
-#define TkAboutDlg \
- (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */
+ (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */
#define TkMacOSXButtonKeyState \
(tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */
#define TkMacOSXClearMenubarActive \
(tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */
#define TkMacOSXDispatchMenuEvent \
(tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */
-/* Slot 11 is reserved */
+#define TkpSetCapture \
+ (tkIntPlatStubsPtr->tkpSetCapture) /* 11 */
#define TkMacOSXHandleTearoffMenu \
(tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */
/* Slot 13 is reserved */
@@ -641,8 +619,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
/* Slot 20 is reserved */
#define TkMacOSXInvalidateWindow \
(tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */
-#define TkMacOSXIsCharacterMissing \
- (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */
+/* Slot 22 is reserved */
#define TkMacOSXMakeRealWindowExist \
(tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */
#define TkMacOSXMakeStippleMap \
@@ -656,8 +633,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
(tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */
#define TkMacOSXSetScrollbarGrow \
(tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */
-#define TkMacOSXSetUpClippingRgn \
- (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */
+/* Slot 30 is reserved */
#define TkMacOSXSetUpGraphicsPort \
(tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */
#define TkMacOSXUpdateClipRgn \
@@ -699,12 +675,6 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
(tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */
#define TkMacOSXSetDrawingEnabled \
(tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */
-#define TkpGetMS \
- (tkIntPlatStubsPtr->tkpGetMS) /* 53 */
-#define TkMacOSXDrawable \
- (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */
-#define TkpScanWindowId \
- (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
#define TkCreateXEventSource \
@@ -712,27 +682,19 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
/* Slot 1 is reserved */
#define TkGenerateActivateEvents \
(tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */
-#define TkpCmapStressed \
- (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */
-#define TkpSync \
- (tkIntPlatStubsPtr->tkpSync) /* 4 */
-#define TkUnixContainerId \
- (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */
-#define TkUnixDoOneXEvent \
- (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */
-#define TkUnixSetMenubar \
- (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */
+/* Slot 3 is reserved */
+/* Slot 4 is reserved */
+/* Slot 5 is reserved */
#define TkpScanWindowId \
- (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */
-#define TkWmCleanup \
- (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */
-#define TkSendCleanup \
- (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */
-/* Slot 11 is reserved */
+ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */
+/* Slot 7 is reserved */
+/* Slot 8 is reserved */
#define TkpWmSetState \
- (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */
-#define TkpTestsendCmd_ \
- (tkIntPlatStubsPtr->tkpTestsendCmd_) /* 13 */
+ (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */
+/* Slot 10 is reserved */
+/* Slot 11 is reserved */
+/* Slot 12 is reserved */
+/* Slot 13 is reserved */
/* Slot 14 is reserved */
/* Slot 15 is reserved */
/* Slot 16 is reserved */
@@ -757,20 +719,20 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
/* Slot 35 is reserved */
/* Slot 36 is reserved */
/* Slot 37 is reserved */
-#define TkpCmapStressed_ \
- (tkIntPlatStubsPtr->tkpCmapStressed_) /* 38 */
-#define TkpSync_ \
- (tkIntPlatStubsPtr->tkpSync_) /* 39 */
-#define TkUnixContainerId_ \
- (tkIntPlatStubsPtr->tkUnixContainerId_) /* 40 */
-#define TkUnixDoOneXEvent_ \
- (tkIntPlatStubsPtr->tkUnixDoOneXEvent_) /* 41 */
-#define TkUnixSetMenubar_ \
- (tkIntPlatStubsPtr->tkUnixSetMenubar_) /* 42 */
-#define TkWmCleanup_ \
- (tkIntPlatStubsPtr->tkWmCleanup_) /* 43 */
-#define TkSendCleanup_ \
- (tkIntPlatStubsPtr->tkSendCleanup_) /* 44 */
+#define TkpCmapStressed \
+ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */
+#define TkpSync \
+ (tkIntPlatStubsPtr->tkpSync) /* 39 */
+#define TkUnixContainerId \
+ (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */
+#define TkUnixDoOneXEvent \
+ (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */
+#define TkUnixSetMenubar \
+ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */
+#define TkWmCleanup \
+ (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */
+#define TkSendCleanup \
+ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */
#define TkpTestsendCmd \
(tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */
#endif /* X11 */
@@ -779,23 +741,11 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr;
/* !END!: Do not edit above this line. */
-#undef TkpCmapStressed_
-#undef TkpSync_
-#undef TkUnixContainerId_
-#undef TkUnixDoOneXEvent_
-#undef TkUnixSetMenubar_
-#undef TkWmCleanup_
-#undef TkSendCleanup_
-#undef TkpTestsendCmd_
-#undef TkGenerateActivateEvents_
-#undef TkMacOSXSetUpClippingRgn
-#undef TkMacOSXIsCharacterMissing
-#define TkMacOSXIsCharacterMissing(tkfont) ((void)tkfont, 0)
+#ifndef TK_NO_DEPRECATED
+# define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable
+#endif
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#undef TkWinGetPlatformId
-#define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */
-
#endif /* _TKINTPLATDECLS */
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index b935f0a..39258ba 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -498,284 +498,283 @@ EXTERN char * XKeysymToString(KeySym k);
EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v,
int i);
/* 7 */
-EXTERN GContext XGContextFromGC(GC g);
+EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
+ XColor *x1, XColor *x2, unsigned int ui1,
+ unsigned int ui2);
/* 8 */
-EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i);
+EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
+ unsigned int ui1, unsigned int ui2,
+ XColor _Xconst *x1, XColor _Xconst *x2);
/* 9 */
-EXTERN KeySym XStringToKeysym(_Xconst char *c);
+EXTERN GContext XGContextFromGC(GC g);
/* 10 */
-EXTERN Window XRootWindow(Display *d, int i);
+EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b);
/* 11 */
-EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
+EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i);
/* 12 */
-EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
+EXTERN KeySym XStringToKeysym(_Xconst char *c);
/* 13 */
-EXTERN int XBell(Display *d, int i);
+EXTERN Window XRootWindow(Display *d, int i);
/* 14 */
+EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
+/* 15 */
+EXTERN Status XIconifyWindow(Display *d, Window w, int i);
+/* 16 */
+EXTERN Status XWithdrawWindow(Display *d, Window w, int i);
+/* 17 */
+EXTERN Status XGetWMColormapWindows(Display *d, Window w,
+ Window **wpp, int *ip);
+/* 18 */
+EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
+/* 19 */
+EXTERN int XBell(Display *d, int i);
+/* 20 */
EXTERN int XChangeProperty(Display *d, Window w, Atom a1,
Atom a2, int i1, int i2,
_Xconst unsigned char *c, int i3);
-/* 15 */
+/* 21 */
EXTERN int XChangeWindowAttributes(Display *d, Window w,
unsigned long ul, XSetWindowAttributes *x);
-/* 16 */
+/* 22 */
+EXTERN int XClearWindow(Display *d, Window w);
+/* 23 */
EXTERN int XConfigureWindow(Display *d, Window w,
unsigned int i, XWindowChanges *x);
-/* 17 */
+/* 24 */
EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4);
-/* 18 */
+/* 25 */
EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4,
unsigned long ul);
-/* 19 */
+/* 26 */
EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d,
_Xconst char *data, unsigned int width,
unsigned int height);
-/* 20 */
+/* 27 */
EXTERN int XDefineCursor(Display *d, Window w, Cursor c);
-/* 21 */
+/* 28 */
+EXTERN int XDeleteProperty(Display *d, Window w, Atom a);
+/* 29 */
EXTERN int XDestroyWindow(Display *d, Window w);
-/* 22 */
+/* 30 */
EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-/* 23 */
+/* 31 */
EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2);
-/* 24 */
+/* 32 */
EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-/* 25 */
+/* 33 */
EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-/* 26 */
+/* 34 */
EXTERN int XFillPolygon(Display *d, Drawable dr, GC g,
XPoint *x, int i1, int i2, int i3);
-/* 27 */
+/* 35 */
EXTERN int XFillRectangles(Display *d, Drawable dr, GC g,
XRectangle *x, int i);
-/* 28 */
+/* 36 */
+EXTERN int XForceScreenSaver(Display *d, int i);
+/* 37 */
EXTERN int XFreeColormap(Display *d, Colormap c);
-/* 29 */
+/* 38 */
EXTERN int XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul);
-/* 30 */
+/* 39 */
+EXTERN int XFreeCursor(Display *d, Cursor c);
+/* 40 */
EXTERN int XFreeModifiermap(XModifierKeymap *x);
-/* 31 */
+/* 41 */
EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w,
int *i1, int *i2, unsigned int *ui1,
unsigned int *ui2, unsigned int *ui3,
unsigned int *ui4);
-/* 32 */
+/* 42 */
+EXTERN int XGetInputFocus(Display *d, Window *w, int *i);
+/* 43 */
EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1,
long l1, long l2, Bool b, Atom a2, Atom *ap,
int *ip, unsigned long *ulp1,
unsigned long *ulp2, unsigned char **cpp);
-/* 33 */
+/* 44 */
+EXTERN Status XGetWindowAttributes(Display *d, Window w,
+ XWindowAttributes *x);
+/* 45 */
EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1,
int i2, Time t);
-/* 34 */
+/* 46 */
EXTERN int XGrabPointer(Display *d, Window w1, Bool b,
unsigned int ui, int i1, int i2, Window w2,
Cursor c, Time t);
-/* 35 */
+/* 47 */
EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k);
-/* 36 */
+/* 48 */
+EXTERN Status XLookupColor(Display *d, Colormap c1,
+ _Xconst char *c2, XColor *x1, XColor *x2);
+/* 49 */
EXTERN int XMapWindow(Display *d, Window w);
-/* 37 */
+/* 50 */
EXTERN int XMoveResizeWindow(Display *d, Window w, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-/* 38 */
+/* 51 */
EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2);
-/* 39 */
+/* 52 */
+EXTERN int XNextEvent(Display *d, XEvent *x);
+/* 53 */
+EXTERN int XPutBackEvent(Display *d, XEvent *x);
+/* 54 */
+EXTERN int XQueryColors(Display *d, Colormap c, XColor *x,
+ int i);
+/* 55 */
EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2,
Window *w3, int *i1, int *i2, int *i3,
int *i4, unsigned int *ui);
-/* 40 */
+/* 56 */
+EXTERN Status XQueryTree(Display *d, Window w1, Window *w2,
+ Window *w3, Window **w4, unsigned int *ui);
+/* 57 */
EXTERN int XRaiseWindow(Display *d, Window w);
-/* 41 */
+/* 58 */
EXTERN int XRefreshKeyboardMapping(XMappingEvent *x);
-/* 42 */
+/* 59 */
EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1,
unsigned int ui2);
-/* 43 */
+/* 60 */
EXTERN int XSelectInput(Display *d, Window w, long l);
-/* 44 */
+/* 61 */
EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l,
XEvent *x);
-/* 45 */
+/* 62 */
+EXTERN int XSetCommand(Display *d, Window w, char **c, int i);
+/* 63 */
EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c);
-/* 46 */
+/* 64 */
EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t);
-/* 47 */
+/* 65 */
EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w,
Time t);
-/* 48 */
+/* 66 */
EXTERN int XSetWindowBackground(Display *d, Window w,
unsigned long ul);
-/* 49 */
+/* 67 */
EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w,
Pixmap p);
-/* 50 */
+/* 68 */
EXTERN int XSetWindowBorder(Display *d, Window w,
unsigned long ul);
-/* 51 */
+/* 69 */
EXTERN int XSetWindowBorderPixmap(Display *d, Window w,
Pixmap p);
-/* 52 */
+/* 70 */
EXTERN int XSetWindowBorderWidth(Display *d, Window w,
unsigned int ui);
-/* 53 */
+/* 71 */
EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c);
-/* 54 */
+/* 72 */
+EXTERN Bool XTranslateCoordinates(Display *d, Window w1,
+ Window w2, int i1, int i2, int *i3, int *i4,
+ Window *w3);
+/* 73 */
EXTERN int XUngrabKeyboard(Display *d, Time t);
-/* 55 */
+/* 74 */
EXTERN int XUngrabPointer(Display *d, Time t);
-/* 56 */
+/* 75 */
EXTERN int XUnmapWindow(Display *d, Window w);
-/* 57 */
+/* 76 */
+EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x);
+/* 77 */
+EXTERN void XDestroyIC(XIC x);
+/* 78 */
+EXTERN Bool XFilterEvent(XEvent *x, Window w);
+/* 79 */
+EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk,
+ char *c, int i, KeySym *k, Status *s);
+/* 80 */
EXTERN int TkPutImage(unsigned long *colors, int ncolors,
Display *display, Drawable d, GC gc,
XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
unsigned int height);
-/* 58 */
+/* 81 */
+EXTERN int XSetClipRectangles(Display *display, GC gc,
+ int clip_x_origin, int clip_y_origin,
+ XRectangle rectangles[], int n, int ordering);
+/* 82 */
EXTERN Status XParseColor(Display *display, Colormap map,
_Xconst char *spec, XColor *colorPtr);
-/* 59 */
+/* 83 */
EXTERN GC XCreateGC(Display *display, Drawable d,
unsigned long valuemask, XGCValues *values);
-/* 60 */
+/* 84 */
EXTERN int XFreeGC(Display *display, GC gc);
-/* 61 */
+/* 85 */
EXTERN Atom XInternAtom(Display *display,
_Xconst char *atom_name, Bool only_if_exists);
-/* 62 */
+/* 86 */
EXTERN int XSetBackground(Display *display, GC gc,
unsigned long foreground);
-/* 63 */
+/* 87 */
EXTERN int XSetForeground(Display *display, GC gc,
unsigned long foreground);
-/* 64 */
+/* 88 */
EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap);
-/* 65 */
+/* 89 */
EXTERN int XSetClipOrigin(Display *display, GC gc,
int clip_x_origin, int clip_y_origin);
-/* 66 */
+/* 90 */
EXTERN int XSetTSOrigin(Display *display, GC gc,
int ts_x_origin, int ts_y_origin);
-/* 67 */
+/* 91 */
EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask,
XGCValues *values);
-/* 68 */
+/* 92 */
EXTERN int XSetFont(Display *display, GC gc, Font font);
-/* 69 */
+/* 93 */
EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode);
-/* 70 */
+/* 94 */
EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple);
-/* 71 */
+/* 95 */
EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule);
-/* 72 */
+/* 96 */
EXTERN int XSetFillStyle(Display *display, GC gc,
int fill_style);
-/* 73 */
+/* 97 */
EXTERN int XSetFunction(Display *display, GC gc, int function);
-/* 74 */
+/* 98 */
EXTERN int XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style);
-/* 75 */
+/* 99 */
EXTERN int _XInitImageFuncPtrs(XImage *image);
-/* 76 */
+/* 100 */
EXTERN XIC XCreateIC(XIM xim, ...);
-/* 77 */
+/* 101 */
EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask,
XVisualInfo *vinfo_template,
int *nitems_return);
-/* 78 */
+/* 102 */
EXTERN void XSetWMClientMachine(Display *display, Window w,
XTextProperty *text_prop);
-/* 79 */
+/* 103 */
EXTERN Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return);
-/* 80 */
-EXTERN int XDrawSegments(Display *display, Drawable d, GC gc,
- XSegment *segments, int nsegments);
-/* 81 */
-EXTERN int XForceScreenSaver(Display *display, int mode);
-/* 82 */
+/* 104 */
EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1,
int y1, int x2, int y2);
-/* 83 */
+/* 105 */
+EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx,
+ int sy, unsigned int sw, unsigned int sh,
+ int dx, int dy);
+/* 106 */
EXTERN int XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
-/* 84 */
-EXTERN int XClearWindow(Display *d, Window w);
-/* 85 */
-EXTERN int XDrawPoint(Display *display, Drawable d, GC gc,
- int x, int y);
-/* 86 */
-EXTERN int XDrawPoints(Display *display, Drawable d, GC gc,
- XPoint *points, int npoints, int mode);
-/* 87 */
-EXTERN int XWarpPointer(Display *display, Window src_w,
- Window dest_w, int src_x, int src_y,
- unsigned int src_width,
- unsigned int src_height, int dest_x,
- int dest_y);
-/* 88 */
-EXTERN int XQueryColor(Display *display, Colormap colormap,
- XColor *def_in_out);
-/* 89 */
-EXTERN int XQueryColors(Display *display, Colormap colormap,
- XColor *defs_in_out, int ncolors);
-/* 90 */
-EXTERN Status XQueryTree(Display *d, Window w1, Window *w2,
- Window *w3, Window **w4, unsigned int *ui);
-/* 91 */
-EXTERN int XSync(Display *display, Bool discard);
-/* 92 */
-EXTERN Bool XTranslateCoordinates(Display *d, Window w1,
- Window w2, int i1, int i2, int *i3, int *i4,
- Window *w3);
-/* 93 */
-EXTERN int XDeleteProperty(Display *d, Window w, Atom a);
-/* 94 */
-EXTERN int XFreeCursor(Display *d, Cursor c);
-/* 95 */
-EXTERN int XGetInputFocus(Display *d, Window *w, int *i);
-/* 96 */
-EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk,
- char *c, int i, KeySym *k, Status *s);
-/* 97 */
-EXTERN int XNextEvent(Display *d, XEvent *x);
-/* 98 */
-EXTERN int XPutBackEvent(Display *d, XEvent *x);
-/* 99 */
-EXTERN int XSetCommand(Display *d, Window w, char **c, int i);
-/* 100 */
-EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x);
-/* 101 */
-EXTERN Status XGetWindowAttributes(Display *d, Window w,
- XWindowAttributes *x);
-/* 102 */
-EXTERN Status XGetWMColormapWindows(Display *d, Window w,
- Window **wpp, int *ip);
-/* 103 */
-EXTERN Status XIconifyWindow(Display *d, Window w, int i);
-/* 104 */
-EXTERN Status XWithdrawWindow(Display *d, Window w, int i);
-/* 105 */
-EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b);
-/* 106 */
-EXTERN int XSetClipRectangles(Display *display, GC gc,
- int clip_x_origin, int clip_y_origin,
- XRectangle rectangles[], int n, int ordering);
/* 107 */
EXTERN int XFlush(Display *display);
/* 108 */
@@ -789,8 +788,7 @@ EXTERN int XNoOp(Display *display);
/* 112 */
EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff);
/* 113 */
-EXTERN Status XLookupColor(Display *d, Colormap c1,
- _Xconst char *c2, XColor *x1, XColor *x2);
+EXTERN int XSync(Display *display, Bool discard);
/* 114 */
EXTERN VisualID XVisualIDFromVisual(Visual *visual);
/* Slot 115 is reserved */
@@ -828,9 +826,15 @@ EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a,
/* 132 */
EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc,
XRectangle *r, int n);
-/* Slot 133 is reserved */
-/* Slot 134 is reserved */
-/* Slot 135 is reserved */
+/* 133 */
+EXTERN int XDrawSegments(Display *d, Drawable dr, GC gc,
+ XSegment *s, int n);
+/* 134 */
+EXTERN int XDrawPoint(Display *d, Drawable dr, GC gc, int x,
+ int y);
+/* 135 */
+EXTERN int XDrawPoints(Display *d, Drawable dr, GC gc,
+ XPoint *p, int n, int m);
/* 136 */
EXTERN int XReparentWindow(Display *d, Window w, Window p,
int x, int y);
@@ -850,16 +854,9 @@ EXTERN char * XSetICValues(XIC xic, ...);
EXTERN char * XGetICValues(XIC xic, ...);
/* 143 */
EXTERN void XSetICFocus(XIC xic);
-/* 144 */
-EXTERN void XDestroyIC(XIC xic);
-/* 145 */
-EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
- XColor *x1, XColor *x2, unsigned int ui1,
- unsigned int ui2);
-/* 146 */
-EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
- unsigned int ui1, unsigned int ui2,
- XColor _Xconst *x1, XColor _Xconst *x2);
+/* Slot 144 is reserved */
+/* Slot 145 is reserved */
+/* Slot 146 is reserved */
/* 147 */
EXTERN void XFreeFontSet(Display *display, XFontSet fontset);
/* 148 */
@@ -1073,113 +1070,113 @@ typedef struct TkIntXlibStubs {
char * (*xGetAtomName) (Display *d, Atom a); /* 4 */
char * (*xKeysymToString) (KeySym k); /* 5 */
Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */
- GContext (*xGContextFromGC) (GC g); /* 7 */
- KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 8 */
- KeySym (*xStringToKeysym) (_Xconst char *c); /* 9 */
- Window (*xRootWindow) (Display *d, int i); /* 10 */
- XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */
- Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */
- int (*xBell) (Display *d, int i); /* 13 */
- int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */
- int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */
- int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */
- int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */
- int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */
- Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */
- int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */
- int (*xDestroyWindow) (Display *d, Window w); /* 21 */
- int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */
- int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */
- int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */
- int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */
- int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */
- int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */
- int (*xFreeColormap) (Display *d, Colormap c); /* 28 */
- int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */
- int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */
- Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */
- int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */
- int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */
- int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 34 */
- KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 35 */
- int (*xMapWindow) (Display *d, Window w); /* 36 */
- int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 37 */
- int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 38 */
- Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 39 */
- int (*xRaiseWindow) (Display *d, Window w); /* 40 */
- int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 41 */
- int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 42 */
- int (*xSelectInput) (Display *d, Window w, long l); /* 43 */
- Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */
- int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */
- int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */
- int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */
- int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */
- int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */
- int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */
- int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 51 */
- int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */
- int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */
- int (*xUngrabKeyboard) (Display *d, Time t); /* 54 */
- int (*xUngrabPointer) (Display *d, Time t); /* 55 */
- int (*xUnmapWindow) (Display *d, Window w); /* 56 */
- int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */
- Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */
- GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */
- int (*xFreeGC) (Display *display, GC gc); /* 60 */
- Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */
- int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */
- int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */
- int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */
- int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */
- int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */
- int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */
- int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */
- int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */
- int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */
- int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */
- int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */
- int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */
- int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */
- int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */
- XIC (*xCreateIC) (XIM xim, ...); /* 76 */
- XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */
- void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 78 */
- Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */
- int (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */
- int (*xForceScreenSaver) (Display *display, int mode); /* 81 */
- int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */
- int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */
- int (*xClearWindow) (Display *d, Window w); /* 84 */
- int (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */
- int (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */
- int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */
- int (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */
- int (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */
- Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */
- int (*xSync) (Display *display, Bool discard); /* 91 */
- Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 92 */
- int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 93 */
- int (*xFreeCursor) (Display *d, Cursor c); /* 94 */
- int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 95 */
- int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 96 */
- int (*xNextEvent) (Display *d, XEvent *x); /* 97 */
- int (*xPutBackEvent) (Display *d, XEvent *x); /* 98 */
- int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 99 */
- int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 100 */
- Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 101 */
- Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 102 */
- Status (*xIconifyWindow) (Display *d, Window w, int i); /* 103 */
- Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 104 */
- XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 105 */
- int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 106 */
+ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */
+ Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */
+ GContext (*xGContextFromGC) (GC g); /* 9 */
+ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */
+ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */
+ KeySym (*xStringToKeysym) (_Xconst char *c); /* 12 */
+ Window (*xRootWindow) (Display *d, int i); /* 13 */
+ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 14 */
+ Status (*xIconifyWindow) (Display *d, Window w, int i); /* 15 */
+ Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */
+ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */
+ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */
+ int (*xBell) (Display *d, int i); /* 19 */
+ int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */
+ int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */
+ int (*xClearWindow) (Display *d, Window w); /* 22 */
+ int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */
+ int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */
+ int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */
+ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */
+ int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */
+ int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */
+ int (*xDestroyWindow) (Display *d, Window w); /* 29 */
+ int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */
+ int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */
+ int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */
+ int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */
+ int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */
+ int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */
+ int (*xForceScreenSaver) (Display *d, int i); /* 36 */
+ int (*xFreeColormap) (Display *d, Colormap c); /* 37 */
+ int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */
+ int (*xFreeCursor) (Display *d, Cursor c); /* 39 */
+ int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */
+ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */
+ int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */
+ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */
+ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */
+ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */
+ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */
+ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */
+ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */
+ int (*xMapWindow) (Display *d, Window w); /* 49 */
+ int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */
+ int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */
+ int (*xNextEvent) (Display *d, XEvent *x); /* 52 */
+ int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */
+ int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */
+ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */
+ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */
+ int (*xRaiseWindow) (Display *d, Window w); /* 57 */
+ int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */
+ int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */
+ int (*xSelectInput) (Display *d, Window w, long l); /* 60 */
+ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */
+ int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */
+ int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */
+ int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */
+ int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */
+ int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */
+ int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */
+ int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */
+ int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */
+ int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */
+ int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */
+ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */
+ int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */
+ int (*xUngrabPointer) (Display *d, Time t); /* 74 */
+ int (*xUnmapWindow) (Display *d, Window w); /* 75 */
+ int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */
+ void (*xDestroyIC) (XIC x); /* 77 */
+ Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */
+ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */
+ int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */
+ int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 81 */
+ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */
+ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */
+ int (*xFreeGC) (Display *display, GC gc); /* 84 */
+ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */
+ int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */
+ int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */
+ int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */
+ int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */
+ int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */
+ int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */
+ int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */
+ int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */
+ int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */
+ int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */
+ int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */
+ int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */
+ int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */
+ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */
+ XIC (*xCreateIC) (XIM xim, ...); /* 100 */
+ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */
+ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */
+ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */
+ int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */
+ int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */
+ int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */
int (*xFlush) (Display *display); /* 107 */
int (*xGrabServer) (Display *display); /* 108 */
int (*xUngrabServer) (Display *display); /* 109 */
int (*xFree) (void *data); /* 110 */
int (*xNoOp) (Display *display); /* 111 */
XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */
- Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 113 */
+ int (*xSync) (Display *display, Bool discard); /* 113 */
VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */
void (*reserved115)(void);
void (*reserved116)(void);
@@ -1199,9 +1196,9 @@ typedef struct TkIntXlibStubs {
int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */
int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */
int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */
- void (*reserved133)(void);
- void (*reserved134)(void);
- void (*reserved135)(void);
+ int (*xDrawSegments) (Display *d, Drawable dr, GC gc, XSegment *s, int n); /* 133 */
+ int (*xDrawPoint) (Display *d, Drawable dr, GC gc, int x, int y); /* 134 */
+ int (*xDrawPoints) (Display *d, Drawable dr, GC gc, XPoint *p, int n, int m); /* 135 */
int (*xReparentWindow) (Display *d, Window w, Window p, int x, int y); /* 136 */
int (*xPutImage) (Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 137 */
Region (*xPolygonRegion) (XPoint *pts, int n, int rule); /* 138 */
@@ -1210,9 +1207,9 @@ typedef struct TkIntXlibStubs {
char * (*xSetICValues) (XIC xic, ...); /* 141 */
char * (*xGetICValues) (XIC xic, ...); /* 142 */
void (*xSetICFocus) (XIC xic); /* 143 */
- void (*xDestroyIC) (XIC xic); /* 144 */
- Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 145 */
- Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 146 */
+ void (*reserved144)(void);
+ void (*reserved145)(void);
+ void (*reserved146)(void);
void (*xFreeFontSet) (Display *display, XFontSet fontset); /* 147 */
int (*xCloseIM) (XIM im); /* 148 */
Bool (*xRegisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 149 */
@@ -1561,206 +1558,206 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr;
(tkIntXlibStubsPtr->xKeysymToString) /* 5 */
#define XCreateColormap \
(tkIntXlibStubsPtr->xCreateColormap) /* 6 */
+#define XCreatePixmapCursor \
+ (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 7 */
+#define XCreateGlyphCursor \
+ (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 8 */
#define XGContextFromGC \
- (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */
+ (tkIntXlibStubsPtr->xGContextFromGC) /* 9 */
+#define XListHosts \
+ (tkIntXlibStubsPtr->xListHosts) /* 10 */
#define XKeycodeToKeysym \
- (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */
+ (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 11 */
#define XStringToKeysym \
- (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */
+ (tkIntXlibStubsPtr->xStringToKeysym) /* 12 */
#define XRootWindow \
- (tkIntXlibStubsPtr->xRootWindow) /* 10 */
+ (tkIntXlibStubsPtr->xRootWindow) /* 13 */
#define XSetErrorHandler \
- (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */
+ (tkIntXlibStubsPtr->xSetErrorHandler) /* 14 */
+#define XIconifyWindow \
+ (tkIntXlibStubsPtr->xIconifyWindow) /* 15 */
+#define XWithdrawWindow \
+ (tkIntXlibStubsPtr->xWithdrawWindow) /* 16 */
+#define XGetWMColormapWindows \
+ (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 17 */
#define XAllocColor \
- (tkIntXlibStubsPtr->xAllocColor) /* 12 */
+ (tkIntXlibStubsPtr->xAllocColor) /* 18 */
#define XBell \
- (tkIntXlibStubsPtr->xBell) /* 13 */
+ (tkIntXlibStubsPtr->xBell) /* 19 */
#define XChangeProperty \
- (tkIntXlibStubsPtr->xChangeProperty) /* 14 */
+ (tkIntXlibStubsPtr->xChangeProperty) /* 20 */
#define XChangeWindowAttributes \
- (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */
+ (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 21 */
+#define XClearWindow \
+ (tkIntXlibStubsPtr->xClearWindow) /* 22 */
#define XConfigureWindow \
- (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */
+ (tkIntXlibStubsPtr->xConfigureWindow) /* 23 */
#define XCopyArea \
- (tkIntXlibStubsPtr->xCopyArea) /* 17 */
+ (tkIntXlibStubsPtr->xCopyArea) /* 24 */
#define XCopyPlane \
- (tkIntXlibStubsPtr->xCopyPlane) /* 18 */
+ (tkIntXlibStubsPtr->xCopyPlane) /* 25 */
#define XCreateBitmapFromData \
- (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */
+ (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 26 */
#define XDefineCursor \
- (tkIntXlibStubsPtr->xDefineCursor) /* 20 */
+ (tkIntXlibStubsPtr->xDefineCursor) /* 27 */
+#define XDeleteProperty \
+ (tkIntXlibStubsPtr->xDeleteProperty) /* 28 */
#define XDestroyWindow \
- (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */
+ (tkIntXlibStubsPtr->xDestroyWindow) /* 29 */
#define XDrawArc \
- (tkIntXlibStubsPtr->xDrawArc) /* 22 */
+ (tkIntXlibStubsPtr->xDrawArc) /* 30 */
#define XDrawLines \
- (tkIntXlibStubsPtr->xDrawLines) /* 23 */
+ (tkIntXlibStubsPtr->xDrawLines) /* 31 */
#define XDrawRectangle \
- (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */
+ (tkIntXlibStubsPtr->xDrawRectangle) /* 32 */
#define XFillArc \
- (tkIntXlibStubsPtr->xFillArc) /* 25 */
+ (tkIntXlibStubsPtr->xFillArc) /* 33 */
#define XFillPolygon \
- (tkIntXlibStubsPtr->xFillPolygon) /* 26 */
+ (tkIntXlibStubsPtr->xFillPolygon) /* 34 */
#define XFillRectangles \
- (tkIntXlibStubsPtr->xFillRectangles) /* 27 */
+ (tkIntXlibStubsPtr->xFillRectangles) /* 35 */
+#define XForceScreenSaver \
+ (tkIntXlibStubsPtr->xForceScreenSaver) /* 36 */
#define XFreeColormap \
- (tkIntXlibStubsPtr->xFreeColormap) /* 28 */
+ (tkIntXlibStubsPtr->xFreeColormap) /* 37 */
#define XFreeColors \
- (tkIntXlibStubsPtr->xFreeColors) /* 29 */
+ (tkIntXlibStubsPtr->xFreeColors) /* 38 */
+#define XFreeCursor \
+ (tkIntXlibStubsPtr->xFreeCursor) /* 39 */
#define XFreeModifiermap \
- (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */
+ (tkIntXlibStubsPtr->xFreeModifiermap) /* 40 */
#define XGetGeometry \
- (tkIntXlibStubsPtr->xGetGeometry) /* 31 */
+ (tkIntXlibStubsPtr->xGetGeometry) /* 41 */
+#define XGetInputFocus \
+ (tkIntXlibStubsPtr->xGetInputFocus) /* 42 */
#define XGetWindowProperty \
- (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */
+ (tkIntXlibStubsPtr->xGetWindowProperty) /* 43 */
+#define XGetWindowAttributes \
+ (tkIntXlibStubsPtr->xGetWindowAttributes) /* 44 */
#define XGrabKeyboard \
- (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */
+ (tkIntXlibStubsPtr->xGrabKeyboard) /* 45 */
#define XGrabPointer \
- (tkIntXlibStubsPtr->xGrabPointer) /* 34 */
+ (tkIntXlibStubsPtr->xGrabPointer) /* 46 */
#define XKeysymToKeycode \
- (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */
+ (tkIntXlibStubsPtr->xKeysymToKeycode) /* 47 */
+#define XLookupColor \
+ (tkIntXlibStubsPtr->xLookupColor) /* 48 */
#define XMapWindow \
- (tkIntXlibStubsPtr->xMapWindow) /* 36 */
+ (tkIntXlibStubsPtr->xMapWindow) /* 49 */
#define XMoveResizeWindow \
- (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */
+ (tkIntXlibStubsPtr->xMoveResizeWindow) /* 50 */
#define XMoveWindow \
- (tkIntXlibStubsPtr->xMoveWindow) /* 38 */
+ (tkIntXlibStubsPtr->xMoveWindow) /* 51 */
+#define XNextEvent \
+ (tkIntXlibStubsPtr->xNextEvent) /* 52 */
+#define XPutBackEvent \
+ (tkIntXlibStubsPtr->xPutBackEvent) /* 53 */
+#define XQueryColors \
+ (tkIntXlibStubsPtr->xQueryColors) /* 54 */
#define XQueryPointer \
- (tkIntXlibStubsPtr->xQueryPointer) /* 39 */
+ (tkIntXlibStubsPtr->xQueryPointer) /* 55 */
+#define XQueryTree \
+ (tkIntXlibStubsPtr->xQueryTree) /* 56 */
#define XRaiseWindow \
- (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */
+ (tkIntXlibStubsPtr->xRaiseWindow) /* 57 */
#define XRefreshKeyboardMapping \
- (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */
+ (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 58 */
#define XResizeWindow \
- (tkIntXlibStubsPtr->xResizeWindow) /* 42 */
+ (tkIntXlibStubsPtr->xResizeWindow) /* 59 */
#define XSelectInput \
- (tkIntXlibStubsPtr->xSelectInput) /* 43 */
+ (tkIntXlibStubsPtr->xSelectInput) /* 60 */
#define XSendEvent \
- (tkIntXlibStubsPtr->xSendEvent) /* 44 */
+ (tkIntXlibStubsPtr->xSendEvent) /* 61 */
+#define XSetCommand \
+ (tkIntXlibStubsPtr->xSetCommand) /* 62 */
#define XSetIconName \
- (tkIntXlibStubsPtr->xSetIconName) /* 45 */
+ (tkIntXlibStubsPtr->xSetIconName) /* 63 */
#define XSetInputFocus \
- (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */
+ (tkIntXlibStubsPtr->xSetInputFocus) /* 64 */
#define XSetSelectionOwner \
- (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */
+ (tkIntXlibStubsPtr->xSetSelectionOwner) /* 65 */
#define XSetWindowBackground \
- (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */
+ (tkIntXlibStubsPtr->xSetWindowBackground) /* 66 */
#define XSetWindowBackgroundPixmap \
- (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */
+ (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 67 */
#define XSetWindowBorder \
- (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */
+ (tkIntXlibStubsPtr->xSetWindowBorder) /* 68 */
#define XSetWindowBorderPixmap \
- (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */
+ (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 69 */
#define XSetWindowBorderWidth \
- (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */
+ (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 70 */
#define XSetWindowColormap \
- (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */
+ (tkIntXlibStubsPtr->xSetWindowColormap) /* 71 */
+#define XTranslateCoordinates \
+ (tkIntXlibStubsPtr->xTranslateCoordinates) /* 72 */
#define XUngrabKeyboard \
- (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */
+ (tkIntXlibStubsPtr->xUngrabKeyboard) /* 73 */
#define XUngrabPointer \
- (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */
+ (tkIntXlibStubsPtr->xUngrabPointer) /* 74 */
#define XUnmapWindow \
- (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */
+ (tkIntXlibStubsPtr->xUnmapWindow) /* 75 */
+#define XWindowEvent \
+ (tkIntXlibStubsPtr->xWindowEvent) /* 76 */
+#define XDestroyIC \
+ (tkIntXlibStubsPtr->xDestroyIC) /* 77 */
+#define XFilterEvent \
+ (tkIntXlibStubsPtr->xFilterEvent) /* 78 */
+#define XmbLookupString \
+ (tkIntXlibStubsPtr->xmbLookupString) /* 79 */
#define TkPutImage \
- (tkIntXlibStubsPtr->tkPutImage) /* 57 */
+ (tkIntXlibStubsPtr->tkPutImage) /* 80 */
+#define XSetClipRectangles \
+ (tkIntXlibStubsPtr->xSetClipRectangles) /* 81 */
#define XParseColor \
- (tkIntXlibStubsPtr->xParseColor) /* 58 */
+ (tkIntXlibStubsPtr->xParseColor) /* 82 */
#define XCreateGC \
- (tkIntXlibStubsPtr->xCreateGC) /* 59 */
+ (tkIntXlibStubsPtr->xCreateGC) /* 83 */
#define XFreeGC \
- (tkIntXlibStubsPtr->xFreeGC) /* 60 */
+ (tkIntXlibStubsPtr->xFreeGC) /* 84 */
#define XInternAtom \
- (tkIntXlibStubsPtr->xInternAtom) /* 61 */
+ (tkIntXlibStubsPtr->xInternAtom) /* 85 */
#define XSetBackground \
- (tkIntXlibStubsPtr->xSetBackground) /* 62 */
+ (tkIntXlibStubsPtr->xSetBackground) /* 86 */
#define XSetForeground \
- (tkIntXlibStubsPtr->xSetForeground) /* 63 */
+ (tkIntXlibStubsPtr->xSetForeground) /* 87 */
#define XSetClipMask \
- (tkIntXlibStubsPtr->xSetClipMask) /* 64 */
+ (tkIntXlibStubsPtr->xSetClipMask) /* 88 */
#define XSetClipOrigin \
- (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */
+ (tkIntXlibStubsPtr->xSetClipOrigin) /* 89 */
#define XSetTSOrigin \
- (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */
+ (tkIntXlibStubsPtr->xSetTSOrigin) /* 90 */
#define XChangeGC \
- (tkIntXlibStubsPtr->xChangeGC) /* 67 */
+ (tkIntXlibStubsPtr->xChangeGC) /* 91 */
#define XSetFont \
- (tkIntXlibStubsPtr->xSetFont) /* 68 */
+ (tkIntXlibStubsPtr->xSetFont) /* 92 */
#define XSetArcMode \
- (tkIntXlibStubsPtr->xSetArcMode) /* 69 */
+ (tkIntXlibStubsPtr->xSetArcMode) /* 93 */
#define XSetStipple \
- (tkIntXlibStubsPtr->xSetStipple) /* 70 */
+ (tkIntXlibStubsPtr->xSetStipple) /* 94 */
#define XSetFillRule \
- (tkIntXlibStubsPtr->xSetFillRule) /* 71 */
+ (tkIntXlibStubsPtr->xSetFillRule) /* 95 */
#define XSetFillStyle \
- (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */
+ (tkIntXlibStubsPtr->xSetFillStyle) /* 96 */
#define XSetFunction \
- (tkIntXlibStubsPtr->xSetFunction) /* 73 */
+ (tkIntXlibStubsPtr->xSetFunction) /* 97 */
#define XSetLineAttributes \
- (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */
+ (tkIntXlibStubsPtr->xSetLineAttributes) /* 98 */
#define _XInitImageFuncPtrs \
- (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */
+ (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 99 */
#define XCreateIC \
- (tkIntXlibStubsPtr->xCreateIC) /* 76 */
+ (tkIntXlibStubsPtr->xCreateIC) /* 100 */
#define XGetVisualInfo \
- (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */
+ (tkIntXlibStubsPtr->xGetVisualInfo) /* 101 */
#define XSetWMClientMachine \
- (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */
+ (tkIntXlibStubsPtr->xSetWMClientMachine) /* 102 */
#define XStringListToTextProperty \
- (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */
-#define XDrawSegments \
- (tkIntXlibStubsPtr->xDrawSegments) /* 80 */
-#define XForceScreenSaver \
- (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */
+ (tkIntXlibStubsPtr->xStringListToTextProperty) /* 103 */
#define XDrawLine \
- (tkIntXlibStubsPtr->xDrawLine) /* 82 */
-#define XFillRectangle \
- (tkIntXlibStubsPtr->xFillRectangle) /* 83 */
-#define XClearWindow \
- (tkIntXlibStubsPtr->xClearWindow) /* 84 */
-#define XDrawPoint \
- (tkIntXlibStubsPtr->xDrawPoint) /* 85 */
-#define XDrawPoints \
- (tkIntXlibStubsPtr->xDrawPoints) /* 86 */
+ (tkIntXlibStubsPtr->xDrawLine) /* 104 */
#define XWarpPointer \
- (tkIntXlibStubsPtr->xWarpPointer) /* 87 */
-#define XQueryColor \
- (tkIntXlibStubsPtr->xQueryColor) /* 88 */
-#define XQueryColors \
- (tkIntXlibStubsPtr->xQueryColors) /* 89 */
-#define XQueryTree \
- (tkIntXlibStubsPtr->xQueryTree) /* 90 */
-#define XSync \
- (tkIntXlibStubsPtr->xSync) /* 91 */
-#define XTranslateCoordinates \
- (tkIntXlibStubsPtr->xTranslateCoordinates) /* 92 */
-#define XDeleteProperty \
- (tkIntXlibStubsPtr->xDeleteProperty) /* 93 */
-#define XFreeCursor \
- (tkIntXlibStubsPtr->xFreeCursor) /* 94 */
-#define XGetInputFocus \
- (tkIntXlibStubsPtr->xGetInputFocus) /* 95 */
-#define XmbLookupString \
- (tkIntXlibStubsPtr->xmbLookupString) /* 96 */
-#define XNextEvent \
- (tkIntXlibStubsPtr->xNextEvent) /* 97 */
-#define XPutBackEvent \
- (tkIntXlibStubsPtr->xPutBackEvent) /* 98 */
-#define XSetCommand \
- (tkIntXlibStubsPtr->xSetCommand) /* 99 */
-#define XWindowEvent \
- (tkIntXlibStubsPtr->xWindowEvent) /* 100 */
-#define XGetWindowAttributes \
- (tkIntXlibStubsPtr->xGetWindowAttributes) /* 101 */
-#define XGetWMColormapWindows \
- (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 102 */
-#define XIconifyWindow \
- (tkIntXlibStubsPtr->xIconifyWindow) /* 103 */
-#define XWithdrawWindow \
- (tkIntXlibStubsPtr->xWithdrawWindow) /* 104 */
-#define XListHosts \
- (tkIntXlibStubsPtr->xListHosts) /* 105 */
-#define XSetClipRectangles \
- (tkIntXlibStubsPtr->xSetClipRectangles) /* 106 */
+ (tkIntXlibStubsPtr->xWarpPointer) /* 105 */
+#define XFillRectangle \
+ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */
#define XFlush \
(tkIntXlibStubsPtr->xFlush) /* 107 */
#define XGrabServer \
@@ -1773,8 +1770,8 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr;
(tkIntXlibStubsPtr->xNoOp) /* 111 */
#define XSynchronize \
(tkIntXlibStubsPtr->xSynchronize) /* 112 */
-#define XLookupColor \
- (tkIntXlibStubsPtr->xLookupColor) /* 113 */
+#define XSync \
+ (tkIntXlibStubsPtr->xSync) /* 113 */
#define XVisualIDFromVisual \
(tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */
/* Slot 115 is reserved */
@@ -1802,9 +1799,12 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr;
(tkIntXlibStubsPtr->xDrawArcs) /* 131 */
#define XDrawRectangles \
(tkIntXlibStubsPtr->xDrawRectangles) /* 132 */
-/* Slot 133 is reserved */
-/* Slot 134 is reserved */
-/* Slot 135 is reserved */
+#define XDrawSegments \
+ (tkIntXlibStubsPtr->xDrawSegments) /* 133 */
+#define XDrawPoint \
+ (tkIntXlibStubsPtr->xDrawPoint) /* 134 */
+#define XDrawPoints \
+ (tkIntXlibStubsPtr->xDrawPoints) /* 135 */
#define XReparentWindow \
(tkIntXlibStubsPtr->xReparentWindow) /* 136 */
#define XPutImage \
@@ -1821,12 +1821,9 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr;
(tkIntXlibStubsPtr->xGetICValues) /* 142 */
#define XSetICFocus \
(tkIntXlibStubsPtr->xSetICFocus) /* 143 */
-#define XDestroyIC \
- (tkIntXlibStubsPtr->xDestroyIC) /* 144 */
-#define XCreatePixmapCursor \
- (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 145 */
-#define XCreateGlyphCursor \
- (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 146 */
+/* Slot 144 is reserved */
+/* Slot 145 is reserved */
+/* Slot 146 is reserved */
#define XFreeFontSet \
(tkIntXlibStubsPtr->xFreeFontSet) /* 147 */
#define XCloseIM \
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 07a7813..f172130 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -163,7 +163,7 @@ static void StdinProc(void *clientData, int mask);
*----------------------------------------------------------------------
*/
-TCL_NORETURN1 void
+void
Tk_MainEx(
Tcl_Size argc, /* Number of arguments. */
TCHAR **argv, /* Array of argument strings. */
@@ -189,7 +189,7 @@ Tk_MainEx(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
abort();
} else {
@@ -203,7 +203,7 @@ Tk_MainEx(
/* We are running win32 Tk under Cygwin, so let's check
* whether the env("DISPLAY") variable or the -display
* argument is set. If so, we really want to run the
- * Tk_MainEx function of libtk8.?.dll, not this one. */
+ * Tk_MainEx function of libtcl9tk9.?.dll, not this one. */
if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) {
loadCygwinTk:
TkCygwinMainEx(argc, argv, appInitProc, interp);
@@ -247,9 +247,6 @@ Tk_MainEx(
*/
if (NULL == Tcl_GetStartupScript(NULL)) {
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- size_t length;
-#endif
/*
* Check whether first 3 args (argv[1] - argv[3]) look like
@@ -264,7 +261,8 @@ Tk_MainEx(
if ((argc >= 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1]))
&& ('-' != argv[3][0])) {
Tcl_Obj *value = NewNativeObj(argv[2]);
- Tcl_SetStartupScript(NewNativeObj(argv[3]), Tcl_GetString(value));
+ Tcl_SetStartupScript(NewNativeObj(argv[3]),
+ Tcl_GetString(value));
Tcl_DecrRefCount(value);
argc -= 3;
i += 3;
@@ -272,14 +270,6 @@ Tk_MainEx(
Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL);
argc--;
i++;
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- } else if ((argc >= 2) && (length = _tcslen(argv[1]))
- && (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length))
- && ('-' != argv[2][0])) {
- Tcl_SetStartupScript(NewNativeObj(argv[2]), NULL);
- argc -= 2;
- i += 2;
-#endif
}
}
@@ -291,7 +281,7 @@ Tk_MainEx(
}
Tcl_SetVar2Ex(interp, "argv0", NULL, appName, TCL_GLOBAL_ONLY);
- Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj((Tcl_WideInt)argc), TCL_GLOBAL_ONLY);
argvPtr = Tcl_NewListObj(0, NULL);
while (argc--) {
@@ -318,7 +308,7 @@ Tk_MainEx(
}
#endif
Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
- Tcl_NewBooleanObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY);
+ Tcl_NewWideIntObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY);
/*
* Invoke application-specific initialization.
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index b32c114..be60f2a 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -278,7 +278,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = {
DEF_MENU_POST_COMMAND,
offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0},
+ DEF_MENU_RELIEF, TCL_INDEX_NONE, offsetof(TkMenu, relief), 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background",
DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0,
DEF_MENU_SELECT_MONO, 0},
@@ -855,11 +855,7 @@ MenuWidgetObjCmd(
goto error;
}
if (index < 0) {
-#if defined(TK_NO_DEPRECATED)
Tcl_SetObjResult(interp, Tcl_NewObj());
-#else
- Tcl_SetObjResult(interp, Tcl_NewStringObj("none", TCL_INDEX_NONE));
-#endif
} else {
Tcl_SetObjResult(interp, TkNewIndexObj(index));
}
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index ffe6770..fdb9ae9 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -284,7 +284,7 @@ typedef struct TkMenu {
* active element (if any). */
Tcl_Obj *activeBorderWidthPtr;
/* Width of border around active element. */
- Tcl_Obj *reliefPtr; /* 3-d effect: TK_RELIEF_RAISED, etc. */
+ int relief; /* 3-d effect: TK_RELIEF_RAISED, etc. */
Tcl_Obj *fontPtr; /* Text font for menu entries. */
Tcl_Obj *fgPtr; /* Foreground color for entries. */
Tcl_Obj *disabledFgPtr; /* Foreground color when disabled. NULL means
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index 62ab105..275b9f5 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -626,7 +626,6 @@ DisplayMenu(
int width;
int borderWidth;
Tk_3DBorder border;
- int relief;
menuPtr->menuFlags &= ~REDRAW_PENDING;
@@ -732,10 +731,9 @@ DisplayMenu(
width, height, 0, TK_RELIEF_FLAT);
}
- Tk_GetReliefFromObj(NULL, menuPtr->reliefPtr, &relief);
Tk_Draw3DRectangle(menuPtr->tkwin, Tk_WindowId(tkwin),
border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth,
- relief);
+ menuPtr->relief);
}
/*
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index 0dc912c..75caf7c 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -21,13 +21,6 @@
* managed by this file:
*/
-#ifdef TK_NO_DEPRECATED
-# undef DEF_MESSAGE_PADX
-# undef DEF_MESSAGE_PADY
-# define DEF_MESSAGE_PADX NULL
-# define DEF_MESSAGE_PADY NULL
-#endif
-
typedef struct {
Tk_Window tkwin; /* Window that embodies the message. NULL
* means that the window has been destroyed
@@ -496,7 +489,7 @@ ConfigureMessage(
* be specified to Tk_ConfigureWidget.
*/
- msgPtr->numChars = TkNumUtfChars(msgPtr->string, TCL_INDEX_NONE);
+ msgPtr->numChars = Tcl_NumUtfChars(msgPtr->string, TCL_INDEX_NONE);
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width);
if (width < 0) {
@@ -522,28 +515,18 @@ ConfigureMessage(
msgPtr->highlightWidthObj = Tcl_NewIntObj(0);
Tcl_IncrRefCount(msgPtr->highlightWidthObj);
}
- if (!msgPtr->padXObj) {
- msgPtr->padXObj = Tcl_NewIntObj(-1);
- Tcl_IncrRefCount(msgPtr->padXObj);
- }
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
- if (padX < 0) {
- if (strcmp(Tcl_GetString(msgPtr->padXObj), "-1")) {
+ if (msgPtr->padXObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
+ if (padX < 0) {
Tcl_DecrRefCount(msgPtr->padXObj);
- msgPtr->padXObj = Tcl_NewIntObj(-1);
- Tcl_IncrRefCount(msgPtr->padXObj);
+ msgPtr->padXObj = NULL;
}
}
- if (!msgPtr->padYObj) {
- msgPtr->padYObj = Tcl_NewIntObj(-1);
- Tcl_IncrRefCount(msgPtr->padYObj);
- }
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
- if (padY < 0) {
- if (strcmp(Tcl_GetString(msgPtr->padYObj), "-1")) {
+ if (msgPtr->padYObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
+ if (padY < 0) {
Tcl_DecrRefCount(msgPtr->padYObj);
- msgPtr->padYObj = Tcl_NewIntObj(-1);
- Tcl_IncrRefCount(msgPtr->padYObj);
+ msgPtr->padYObj = NULL;
}
}
@@ -635,13 +618,15 @@ ComputeMessageGeometry(
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth);
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth);
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
Tk_GetFontMetrics(msgPtr->tkfont, &fm);
- if (padX < 0) {
+ if (msgPtr->padXObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
+ } else {
padX = fm.ascent / 2;
}
- if (padY < 0) {
+ if (msgPtr->padYObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
+ } else {
padY = fm.ascent / 4;
}
@@ -729,13 +714,15 @@ DisplayMessage(
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth);
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth);
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
- Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
Tk_GetFontMetrics(msgPtr->tkfont, &fm);
- if (padX < 0) {
+ if (msgPtr->padXObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX);
+ } else {
padX = fm.ascent / 2;
}
- if (padY < 0) {
+ if (msgPtr->padYObj) {
+ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY);
+ } else {
padY = fm.ascent / 4;
}
@@ -952,7 +939,7 @@ MessageTextVarProc(
if (msgPtr->string != NULL) {
ckfree(msgPtr->string);
}
- msgPtr->numChars = TkNumUtfChars(value, TCL_INDEX_NONE);
+ msgPtr->numChars = Tcl_NumUtfChars(value, TCL_INDEX_NONE);
msgPtr->string = (char *)ckalloc(strlen(value) + 1);
strcpy(msgPtr->string, value);
ComputeMessageGeometry(msgPtr);
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 170f7d0..dcff758 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -96,35 +96,6 @@ static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
-#if TCL_MAJOR_VERSION < 9
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if defined(USE_TCL_STUBS)
-/* Little hack to eliminate the need for "tclInt.h" here:
- Just copy a small portion of TclIntStubs, just
- enough to make it work */
-typedef struct TclIntStubs {
- int magic;
- void *hooks;
- void (*dummy[34]) (void); /* dummy entries 0-33, not used */
- int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 34 */
-} TclIntStubs;
-extern const TclIntStubs *tclIntStubsPtr;
-
-# undef Tcl_GetIntForIndex
-# define Tcl_GetIntForIndex(interp, obj, max, ptr) ((tclIntStubsPtr->tclGetIntForIndex == NULL)? \
- ((int (*)(Tcl_Interp*, Tcl_Obj *, int, int*))(void *)((&(tclStubsPtr->tcl_PkgProvideEx))[645]))((interp), (obj), (max), (ptr)): \
- tclIntStubsPtr->tclGetIntForIndex((interp), (obj), (max), (ptr)))
-#elif TCL_MINOR_VERSION < 7
-extern int TclGetIntForIndex(Tcl_Interp*, Tcl_Obj *, int, int*);
-# define Tcl_GetIntForIndex(interp, obj, max, ptr) TclGetIntForIndex(interp, obj, max, ptr)
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-
/*
* The following structure defines the implementation of the "pixel" Tcl
* object, used for measuring distances. The pixel object remembers its
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 23259ec..0f22e3b 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -61,7 +61,7 @@ static void DeleteSpecCacheTable(void *clientData,
* will hold an error message.
*
* Side effects:
- * The fields of widgRec get filled in with information from argc/argv
+ * The fields of widgRec get filled in with information from objc/objv
* and the option database. Old information in widgRec's fields gets
* recycled. A copy of the spec-table is taken with (some of) the char*
* fields converted into Tk_Uid fields; this copy will be released when
@@ -76,8 +76,8 @@ Tk_ConfigureWidget(
Tk_Window tkwin, /* Window containing widget (needed to set up
* X resources). */
const Tk_ConfigSpec *specs, /* Describes legal options. */
- Tcl_Size argc, /* Number of elements in argv. */
- const char **argv, /* Command-line options. */
+ Tcl_Size objc, /* Number of elements in objv. */
+ Tcl_Obj *const *objv, /* Command-line options. */
void *widgRec, /* Record whose fields are to be modified.
* Values must be properly initialized. */
int flags) /* Used to specify additional flags that must
@@ -125,18 +125,10 @@ Tk_ConfigureWidget(
* match entries in the specs.
*/
- for ( ; argc > 0; argc -= 2, argv += 2) {
+ for ( ; objc > 0; objc -= 2, objv += 2) {
const char *arg;
- if (flags & TK_CONFIG_OBJS) {
- arg = Tcl_GetString((Tcl_Obj *) *argv);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- arg = *argv;
-#endif
- }
+ arg = Tcl_GetString(*objv);
specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags);
if (specPtr == NULL) {
return TCL_ERROR;
@@ -146,21 +138,13 @@ Tk_ConfigureWidget(
* Process the entry.
*/
- if (argc < 2) {
+ if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"value for \"%s\" missing", arg));
Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", (char *)NULL);
return TCL_ERROR;
}
- if (flags & TK_CONFIG_OBJS) {
- arg = Tcl_GetString((Tcl_Obj *) argv[1]);
- } else {
-#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8)
- Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory");
-#else
- arg = argv[1];
-#endif
- }
+ arg = Tcl_GetString(objv[1]);
if (DoConfig(interp, tkwin, specPtr, arg, 0, widgRec) != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (processing \"%.40s\" option)",specPtr->argvName));
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
deleted file mode 100644
index 82b8ef2..0000000
--- a/generic/tkOldTest.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * tkOldTest.c --
- *
- * This file contains C command functions for additional Tcl
- * commands that are used to test Tk's support for legacy
- * interfaces. These commands are not normally included in Tcl/Tk
- * applications; they're only used for testing.
- *
- * Copyright © 1993-1994 The Regents of the University of California.
- * Copyright © 1994-1997 Sun Microsystems, Inc.
- * Copyright © 1998-1999 Scriptics Corporation.
- * Contributions by Don Porter, NIST, 2007. (not subject to US copyright)
- *
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#define USE_OLD_IMAGE
-#ifndef USE_TCL_STUBS
-# define USE_TCL_STUBS
-#endif
-#ifndef USE_TK_STUBS
-# define USE_TK_STUBS
-#endif
-#include "tkInt.h"
-
-#ifdef _WIN32
-#include "tkWinInt.h"
-#endif
-
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
-/*
- * The following data structure represents the model for a test image:
- */
-
-typedef struct TImageModel {
- Tk_ImageModel model; /* Tk's token for image model. */
- Tcl_Interp *interp; /* Interpreter for application. */
- int width, height; /* Dimensions of image. */
- char *imageName; /* Name of image (malloc-ed). */
- char *varName; /* Name of variable in which to log events for
- * image (malloc-ed). */
-} TImageModel;
-
-/*
- * The following data structure represents a particular use of a particular
- * test image.
- */
-
-typedef struct TImageInstance {
- TImageModel *modelPtr; /* Pointer to model for image. */
- XColor *fg; /* Foreground color for drawing in image. */
- GC gc; /* Graphics context for drawing in image. */
-} TImageInstance;
-
-/*
- * The type record for test images:
- */
-
-static int ImageCreate(Tcl_Interp *interp,
- char *name, Tcl_Size argc, char **argv,
- Tk_ImageType *typePtr, Tk_ImageModel model,
- void **clientDataPtr);
-static void *ImageGet(Tk_Window tkwin, void *clientData);
-static void ImageDisplay(void *clientData,
- Display *display, Drawable drawable,
- int imageX, int imageY, int width,
- int height, int drawableX,
- int drawableY);
-static void ImageFree(void *clientData, Display *display);
-static void ImageDelete(void *clientData);
-
-static Tk_ImageType imageType = {
- "oldtest", /* name */
- (Tk_ImageCreateProc *) ImageCreate, /* createProc */
- ImageGet, /* getProc */
- ImageDisplay, /* displayProc */
- ImageFree, /* freeProc */
- ImageDelete, /* deleteProc */
- NULL, /* postscriptPtr */
- NULL, /* nextPtr */
- NULL
-};
-
-/*
- * Forward declarations for functions defined later in this file:
- */
-
-static Tcl_ObjCmdProc ImageObjCmd;
-#endif
-
-/*
- *----------------------------------------------------------------------
- *
- * TkOldTestInit --
- *
- * This function performs initialization for the Tk test suite
- * extensions for testing support for legacy interfaces.
- *
- * Results:
- * Returns a standard Tcl completion code, and leaves an error message in
- * the interp's result if an error occurs.
- *
- * Side effects:
- * Creates several test commands.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkOldTestInit(
- Tcl_Interp *dummy)
-{
- static int initialized = 0;
- (void)dummy;
-
- if (!initialized) {
- initialized = 1;
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
- Tk_CreateImageType(&imageType);
-#endif
- }
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageCreate --
- *
- * This function is called by the Tk image code to create "oldtest" images.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * The data structure for a new image is allocated.
- *
- *----------------------------------------------------------------------
- */
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
-static int
-ImageCreate(
- Tcl_Interp *interp, /* Interpreter for application containing
- * image. */
- char *name, /* Name to use for image. */
- Tcl_Size argc, /* Number of arguments. */
- char **argv, /* Argument strings for options (doesn't
- * include image name or type). */
- Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
- Tk_ImageModel model, /* Token for image, to be used by us in later
- * callbacks. */
- void **clientDataPtr) /* Store manager's token for image here; it
- * will be returned in later callbacks. */
-{
- TImageModel *timPtr;
- const char *varName;
- Tcl_Size i;
- (void)typePtr;
-
- varName = "log";
- for (i = 0; i < argc; i += 2) {
- if (strcmp(argv[i], "-variable") != 0) {
- Tcl_AppendResult(interp, "bad option name \"",
- argv[i], "\"", NULL);
- return TCL_ERROR;
- }
- if ((i+1) == argc) {
- Tcl_AppendResult(interp, "no value given for \"",
- argv[i], "\" option", NULL);
- return TCL_ERROR;
- }
- varName = argv[i+1];
- }
-
- timPtr = (TImageModel *)ckalloc(sizeof(TImageModel));
- timPtr->model = model;
- timPtr->interp = interp;
- timPtr->width = 30;
- timPtr->height = 15;
- timPtr->imageName = (char *)ckalloc(strlen(name) + 1);
- strcpy(timPtr->imageName, name);
- timPtr->varName = (char *)ckalloc(strlen(varName) + 1);
- strcpy(timPtr->varName, varName);
- Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL);
- *clientDataPtr = timPtr;
- Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15);
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageObjCmd --
- *
- * This function implements the commands corresponding to individual
- * images.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * Forces windows to be created.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-ImageObjCmd(
- void *clientData, /* Main window for application. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
-{
- TImageModel *timPtr = (TImageModel *)clientData;
- int x, y, width, height;
-
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
- return TCL_ERROR;
- }
- if (strcmp(Tcl_GetString(objv[1]), "changed") == 0) {
- if (objc != 8) {
- Tcl_WrongNumArgs(interp, 1, objv, "changed x y width height"
- " imageWidth imageHeight");
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &width) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[5], &height) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[6], &timPtr->width) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) {
- return TCL_ERROR;
- }
- Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width,
- timPtr->height);
- } else {
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
- "\": must be changed", NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageGet --
- *
- * This function is called by Tk to set things up for using a test image
- * in a particular widget.
- *
- * Results:
- * The return value is a token for the image instance, which is used in
- * future callbacks to ImageDisplay and ImageFree.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static void *
-ImageGet(
- Tk_Window tkwin, /* Token for window in which image will be
- * used. */
- void *clientData) /* Pointer to TImageModel for image. */
-{
- TImageModel *timPtr = (TImageModel *)clientData;
- TImageInstance *instPtr;
- char buffer[100];
- XGCValues gcValues;
-
- snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName);
- Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer,
- TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
-
- instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance));
- instPtr->modelPtr = timPtr;
- instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
- gcValues.foreground = instPtr->fg->pixel;
- instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
- return instPtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageDisplay --
- *
- * This function is invoked to redisplay part or all of an image in a
- * given drawable.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The image gets partially redrawn, as an "X" that shows the exact
- * redraw area.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImageDisplay(
- void *clientData, /* Pointer to TImageInstance for image. */
- Display *display, /* Display to use for drawing. */
- Drawable drawable, /* Where to redraw image. */
- int imageX, int imageY, /* Origin of area to redraw, relative to
- * origin of image. */
- int width, int height, /* Dimensions of area to redraw. */
- int drawableX, int drawableY)
- /* Coordinates in drawable corresponding to
- * imageX and imageY. */
-{
- TImageInstance *instPtr = (TImageInstance *)clientData;
- char buffer[200 + TCL_INTEGER_SPACE * 6];
-
- snprintf(buffer, sizeof(buffer), "%s display %d %d %d %d %d %d",
- instPtr->modelPtr->imageName, imageX, imageY, width, height,
- drawableX, drawableY);
- Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL,
- buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
- if (width > (instPtr->modelPtr->width - imageX)) {
- width = instPtr->modelPtr->width - imageX;
- }
- if (height > (instPtr->modelPtr->height - imageY)) {
- height = instPtr->modelPtr->height - imageY;
- }
- XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY,
- (unsigned) (width-1), (unsigned) (height-1));
- XDrawLine(display, drawable, instPtr->gc, drawableX, drawableY,
- (int) (drawableX + width - 1), (int) (drawableY + height - 1));
- XDrawLine(display, drawable, instPtr->gc, drawableX,
- (int) (drawableY + height - 1),
- (int) (drawableX + width - 1), drawableY);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageFree --
- *
- * This function is called when an instance of an image is no longer
- * used.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information related to the instance is freed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImageFree(
- void *clientData, /* Pointer to TImageInstance for instance. */
- Display *display) /* Display where image was to be drawn. */
-{
- TImageInstance *instPtr = (TImageInstance *)clientData;
- char buffer[200];
-
- snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName);
- Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL,
- buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
- Tk_FreeColor(instPtr->fg);
- Tk_FreeGC(display, instPtr->gc);
- ckfree(instPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImageDelete --
- *
- * This function is called to clean up a test image when an application
- * goes away.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information about the image is deleted.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImageDelete(
- void *clientData) /* Pointer to TImageModel for image. When
- * this function is called, no more instances
- * exist. */
-{
- TImageModel *timPtr = (TImageModel *)clientData;
- char buffer[100];
-
- snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName);
- Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer,
- TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
-
- Tcl_DeleteCommand(timPtr->interp, timPtr->imageName);
- ckfree(timPtr->imageName);
- ckfree(timPtr->varName);
- ckfree(timPtr);
-}
-#endif
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 65962bf..3ad8cae 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -122,10 +122,6 @@ static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin,
int objc, Tcl_Obj *const objv[]);
static Tcl_FreeProc DestroyPacker;
static Packer * GetPacker(Tk_Window tkwin);
-#ifndef TK_NO_DEPRECATED
-static int PackAfter(Tcl_Interp *interp, Packer *prevPtr,
- Packer *containerPtr, int objc,Tcl_Obj *const objv[]);
-#endif /* !TK_NO_DEPRECATED */
static void PackStructureProc(void *clientData,
XEvent *eventPtr);
static void Unlink(Packer *packPtr);
@@ -199,16 +195,10 @@ Tk_PackObjCmd(
Tk_Window tkwin = (Tk_Window)clientData;
const char *argv2;
static const char *const optionStrings[] = {
-#ifndef TK_NO_DEPRECATED
- "after", "append", "before", "unpack",
-#endif /* !TK_NO_DEPRECATED */
"configure", "content", "forget", "info", "propagate", "slaves", NULL };
static const char *const optionStringsNoDep[] = {
"configure", "content", "forget", "info", "propagate", NULL };
enum options {
-#ifndef TK_NO_DEPRECATED
- PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK,
-#endif /* !TK_NO_DEPRECATED */
PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES };
int index;
@@ -239,77 +229,11 @@ Tk_PackObjCmd(
argv2 = Tcl_GetString(objv[2]);
switch ((enum options) index) {
-#ifndef TK_NO_DEPRECATED
- case PACK_AFTER: {
- Packer *prevPtr;
- Tk_Window tkwin2;
-
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- prevPtr = GetPacker(tkwin2);
- if (prevPtr->containerPtr == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "window \"%s\" isn't packed", argv2));
- Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL);
- return TCL_ERROR;
- }
- return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3);
- }
- case PACK_APPEND: {
- Packer *containerPtr;
- Packer *prevPtr;
- Tk_Window tkwin2;
-
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- containerPtr = GetPacker(tkwin2);
- prevPtr = containerPtr->contentPtr;
- if (prevPtr != NULL) {
- while (prevPtr->nextPtr != NULL) {
- prevPtr = prevPtr->nextPtr;
- }
- }
- return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3);
- }
- case PACK_BEFORE: {
- Packer *packPtr, *containerPtr;
- Packer *prevPtr;
- Tk_Window tkwin2;
-
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- packPtr = GetPacker(tkwin2);
- if (packPtr->containerPtr == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "window \"%s\" isn't packed", argv2));
- Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL);
- return TCL_ERROR;
- }
- containerPtr = packPtr->containerPtr;
- prevPtr = containerPtr->contentPtr;
- if (prevPtr == packPtr) {
- prevPtr = NULL;
- } else {
- for ( ; ; prevPtr = prevPtr->nextPtr) {
- if (prevPtr == NULL) {
- Tcl_Panic("\"pack before\" couldn't find predecessor");
- }
- if (prevPtr->nextPtr == packPtr) {
- break;
- }
- }
- }
- return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3);
- }
-#endif /* !TK_NO_DEPRECATED */
case PACK_CONFIGURE:
if (argv2[0] != '.') {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad argument \"%s\": must be name of window", argv2));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL);
return TCL_ERROR;
}
return ConfigureContent(interp, tkwin, objc-2, objv+2);
@@ -351,7 +275,7 @@ Tk_PackObjCmd(
if (contentPtr->containerPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"window \"%s\" isn't packed", argv2));
- Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL);
return TCL_ERROR;
}
@@ -467,31 +391,6 @@ Tk_PackObjCmd(
Tcl_SetObjResult(interp, resultObj);
break;
}
-#ifndef TK_NO_DEPRECATED
- case PACK_UNPACK: {
- Tk_Window tkwin2;
- Packer *packPtr;
-
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "window");
- return TCL_ERROR;
- }
- if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- packPtr = GetPacker(tkwin2);
- if ((packPtr != NULL) && (packPtr->containerPtr != NULL)) {
- Tk_ManageGeometry(tkwin2, NULL, NULL);
- if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) {
- Tk_UnmaintainGeometry(packPtr->tkwin,
- packPtr->containerPtr->tkwin);
- }
- Unlink(packPtr);
- Tk_UnmapWindow(packPtr->tkwin);
- }
- break;
- }
-#endif /* !TK_NO_DEPRECATED */
}
return TCL_OK;
@@ -1078,248 +977,6 @@ GetPacker(
}
/*
- *------------------------------------------------------------------------
- *
- * PackAfter --
- *
- * This function does most of the real work of adding one or more windows
- * into the packing order for its container.
- *
- * Results:
- * A standard Tcl return value.
- *
- * Side effects:
- * The geometry of the specified windows may change, both now and again
- * in the future.
- *
- *------------------------------------------------------------------------
- */
-
-#ifndef TK_NO_DEPRECATED
-static int
-PackAfter(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Packer *prevPtr, /* Pack windows in argv just after this
- * window; NULL means pack as first child of
- * containerPtr. */
- Packer *containerPtr, /* Container in which to pack windows. */
- int objc, /* Number of elements in objv. */
- Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements:
- * window name and side against which to
- * pack. */
-{
- Packer *packPtr;
- Tk_Window tkwin, ancestor, parent;
- Tcl_Obj **options;
- int c;
- Tcl_Size index, optionCount;
-
- /*
- * Iterate over all of the window specifiers, each consisting of two
- * arguments. The first argument contains the window name and the
- * additional arguments contain options such as "top" or "padx 20".
- */
-
- for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) {
- if (objc < 2) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: window \"%s\" should be followed by options",
- Tcl_GetString(objv[0])));
- Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL);
- return TCL_ERROR;
- }
-
- /*
- * Find the packer for the window to be packed, and make sure that the
- * window in which it will be packed is either its or a descendant of
- * its parent.
- */
-
- if (TkGetWindowFromObj(interp, containerPtr->tkwin, objv[0], &tkwin)
- != TCL_OK) {
- return TCL_ERROR;
- }
-
- parent = Tk_Parent(tkwin);
- for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) {
- if (ancestor == parent) {
- break;
- }
- if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) {
- badWindow:
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]),
- Tk_PathName(containerPtr->tkwin)));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) {
- goto badWindow;
- }
- if (tkwin == containerPtr->tkwin) {
- goto badWindow;
- }
- packPtr = GetPacker(tkwin);
-
- /*
- * Process options for this window.
- */
-
- if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options)
- != TCL_OK) {
- return TCL_ERROR;
- }
- packPtr->side = TOP;
- packPtr->anchor = TK_ANCHOR_CENTER;
- packPtr->padX = packPtr->padY = 0;
- packPtr->padLeft = packPtr->padTop = 0;
- packPtr->iPadX = packPtr->iPadY = 0;
- packPtr->flags &= ~(FILLX|FILLY|EXPAND);
- packPtr->flags |= OLD_STYLE;
- for (index = 0 ; index < optionCount; index++) {
- Tcl_Obj *curOptPtr = options[index];
- Tcl_Size length;
- const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length);
-
- c = curOpt[0];
-
- if ((c == 't')
- && (strncmp(curOpt, "top", length)) == 0) {
- packPtr->side = TOP;
- } else if ((c == 'b')
- && (strncmp(curOpt, "bottom", length)) == 0) {
- packPtr->side = BOTTOM;
- } else if ((c == 'l')
- && (strncmp(curOpt, "left", length)) == 0) {
- packPtr->side = LEFT;
- } else if ((c == 'r')
- && (strncmp(curOpt, "right", length)) == 0) {
- packPtr->side = RIGHT;
- } else if ((c == 'e')
- && (strncmp(curOpt, "expand", length)) == 0) {
- packPtr->flags |= EXPAND;
- } else if ((c == 'f')
- && (strcmp(curOpt, "fill")) == 0) {
- packPtr->flags |= FILLX|FILLY;
- } else if ((length == 5) && (strcmp(curOpt, "fillx")) == 0) {
- packPtr->flags |= FILLX;
- } else if ((length == 5) && (strcmp(curOpt, "filly")) == 0) {
- packPtr->flags |= FILLY;
- } else if ((c == 'p') && (strcmp(curOpt, "padx")) == 0) {
- if (optionCount <= (index+1)) {
- missingPad:
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "wrong # args: \"%s\" option must be"
- " followed by screen distance", curOpt));
- Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (TkParsePadAmount(interp, tkwin, options[index+1],
- &packPtr->padLeft, &packPtr->padX) != TCL_OK) {
- return TCL_ERROR;
- }
- packPtr->padX /= 2;
- packPtr->padLeft /= 2;
- packPtr->iPadX = 0;
- index++;
- } else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) {
- if (optionCount <= (index+1)) {
- goto missingPad;
- }
- if (TkParsePadAmount(interp, tkwin, options[index+1],
- &packPtr->padTop, &packPtr->padY) != TCL_OK) {
- return TCL_ERROR;
- }
- packPtr->padY /= 2;
- packPtr->padTop /= 2;
- packPtr->iPadY = 0;
- index++;
- } else if ((c == 'f') && (length > 1)
- && (strncmp(curOpt, "frame", length) == 0)) {
- if (optionCount <= (index+1)) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "wrong # args: \"frame\""
- " option must be followed by anchor point", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_GetAnchorFromObj(interp, options[index+1],
- &packPtr->anchor) != TCL_OK) {
- return TCL_ERROR;
- }
- index++;
- } else {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad option \"%s\": should be top, bottom, left,"
- " right, expand, fill, fillx, filly, padx, pady, or"
- " frame", curOpt));
- Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
-
- if (packPtr != prevPtr) {
- /*
- * Unpack this window if it's currently packed.
- */
-
- if (packPtr->containerPtr != NULL) {
- if ((packPtr->containerPtr != containerPtr) &&
- (packPtr->containerPtr->tkwin
- != Tk_Parent(packPtr->tkwin))) {
- Tk_UnmaintainGeometry(packPtr->tkwin,
- packPtr->containerPtr->tkwin);
- }
- Unlink(packPtr);
- }
-
- /*
- * Add the window in the correct place in its container's packing
- * order, then make sure that the window is managed by us.
- */
-
- packPtr->containerPtr = containerPtr;
- if (prevPtr == NULL) {
- packPtr->nextPtr = containerPtr->contentPtr;
- containerPtr->contentPtr = packPtr;
- } else {
- packPtr->nextPtr = prevPtr->nextPtr;
- prevPtr->nextPtr = packPtr;
- }
- Tk_ManageGeometry(tkwin, &packerType, packPtr);
-
- if (!(containerPtr->flags & DONT_PROPAGATE)) {
- if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack")
- != TCL_OK) {
- Tk_ManageGeometry(tkwin, NULL, NULL);
- Unlink(packPtr);
- return TCL_ERROR;
- }
- containerPtr->flags |= ALLOCED_CONTAINER;
- }
- }
- }
-
- /*
- * Arrange for the container to be re-packed at the first idle moment.
- */
-
- if (containerPtr->abortPtr != NULL) {
- *containerPtr->abortPtr = 1;
- }
- if (!(containerPtr->flags & REQUESTED_REPACK)) {
- containerPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, containerPtr);
- }
- return TCL_OK;
-}
-#endif /* !TK_NO_DEPRECATED */
-
-/*
*----------------------------------------------------------------------
*
* Unlink --
@@ -1586,7 +1243,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't pack \"%s\": it's a top-level window",
Tcl_GetString(objv[j])));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL);
return TCL_ERROR;
}
contentPtr = GetPacker(content);
@@ -1612,7 +1269,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"extra option \"%s\" (option with no value?)",
Tcl_GetString(objv[i])));
- Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", NULL);
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
@@ -1634,7 +1291,7 @@ ConfigureContent(
"window \"%s\" isn't packed",
Tcl_GetString(objv[i+1])));
Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED",
- (char *)NULL);
+ NULL);
return TCL_ERROR;
}
containerPtr = prevPtr->containerPtr;
@@ -1692,7 +1349,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad fill style \"%s\": must be "
"none, x, y, or both", string));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", NULL);
return TCL_ERROR;
}
break;
@@ -1718,7 +1375,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipadx value \"%s\": must be positive screen"
" distance", Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
contentPtr->iPadX = tmp * 2;
@@ -1729,7 +1386,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipady value \"%s\": must be positive screen"
" distance", Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
return TCL_ERROR;
}
contentPtr->iPadY = tmp * 2;
@@ -1809,14 +1466,14 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]),
Tk_PathName(containerPtr->tkwin)));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL);
return TCL_ERROR;
}
}
if (content == containerPtr->tkwin) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't pack \"%s\" inside itself", Tcl_GetString(objv[j])));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL);
return TCL_ERROR;
}
@@ -1830,7 +1487,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put \"%s\" inside \"%s\": would cause management loop",
Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin)));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL);
return TCL_ERROR;
}
}
diff --git a/generic/tkPkgConfig.c b/generic/tkPkgConfig.c
index 5050f8a..44c5e5e 100644
--- a/generic/tkPkgConfig.c
+++ b/generic/tkPkgConfig.c
@@ -14,20 +14,9 @@
/* Note, the definitions in this module are influenced by the following C
* preprocessor macros:
*
- * OSCMa = shortcut for "old style configuration macro activates"
- * NSCMdt = shortcut for "new style configuration macro declares that"
- *
- * - TCL_THREADS OSCMa compilation as threaded.
- * - TCL_MEM_DEBUG OSCMa memory debugging.
- *
- * - TCL_CFG_DO64BIT NSCMdt tk is compiled for a 64bit system.
- * - NDEBUG NSCMdt tk is compiled with symbol info off.
- * - TCL_CFG_OPTIMIZED NSCMdt tk is compiled with cc optimizations on
- * - TCL_CFG_PROFILED NSCMdt tk is compiled with profiling info.
- *
* - _WIN32 || __CYGWIN__ The value for the fontsytem key will be
* MAC_OSX_TK chosen based on these macros/defines.
- * HAVE_XFT NSCMdt xft font support was requested.
+ * HAVE_XFT declares that xft font support was requested.
*
* - CFG_RUNTIME_* Paths to various stuff at runtime.
* - CFG_INSTALL_* Paths to various stuff at installation time.
@@ -48,42 +37,6 @@
* configuration information.
*/
-#ifdef TCL_THREADS
-# define CFG_THREADED "1"
-#else
-# define CFG_THREADED "0"
-#endif
-
-#ifdef TCL_MEM_DEBUG
-# define CFG_MEMDEBUG "1"
-#else
-# define CFG_MEMDEBUG "0"
-#endif
-
-#ifdef TCL_CFG_DO64BIT
-# define CFG_64 "1"
-#else
-# define CFG_64 "0"
-#endif
-
-#ifndef NDEBUG
-# define CFG_DEBUG "1"
-#else
-# define CFG_DEBUG "0"
-#endif
-
-#ifdef TCL_CFG_OPTIMIZED
-# define CFG_OPTIMIZED "1"
-#else
-# define CFG_OPTIMIZED "0"
-#endif
-
-#ifdef TCL_CFG_PROFILED
-# define CFG_PROFILED "1"
-#else
-# define CFG_PROFILED "0"
-#endif
-
#if defined(_WIN32)
# define CFG_FONTSYSTEM "gdi"
#elif defined(MAC_OSX_TK)
@@ -95,14 +48,6 @@
#endif
static const Tcl_Config cfg[] = {
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
- {"debug", CFG_DEBUG},
- {"threaded", CFG_THREADED},
- {"profiled", CFG_PROFILED},
- {"64bit", CFG_64},
- {"optimized", CFG_OPTIMIZED},
- {"mem_debug", CFG_MEMDEBUG},
-#endif
{"fontsystem", CFG_FONTSYSTEM},
/* Runtime paths to various stuff */
diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h
index 46d425f..06012a7 100644
--- a/generic/tkPlatDecls.h
+++ b/generic/tkPlatDecls.h
@@ -46,12 +46,6 @@ EXTERN HINSTANCE Tk_GetHINSTANCE(void);
EXTERN HWND Tk_GetHWND(Window window);
/* 3 */
EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd);
-/* 4 */
-EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y);
-/* 5 */
-EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam,
- LRESULT *result);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* Slot 0 is reserved */
@@ -60,9 +54,7 @@ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message,
/* Slot 3 is reserved */
/* 4 */
EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp);
-/* 5 */
-EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y,
- int width, int height, int flags);
+/* Slot 5 is reserved */
/* 6 */
EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin);
/* Slot 7 is reserved */
@@ -94,8 +86,6 @@ typedef struct TkPlatStubs {
HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */
HWND (*tk_GetHWND) (Window window); /* 2 */
Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */
- void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */
- int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
void (*reserved0)(void);
@@ -103,7 +93,7 @@ typedef struct TkPlatStubs {
void (*reserved2)(void);
void (*reserved3)(void);
void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */
- void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */
+ void (*reserved5)(void);
void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
void (*reserved7)(void);
void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
@@ -139,10 +129,6 @@ extern const TkPlatStubs *tkPlatStubsPtr;
(tkPlatStubsPtr->tk_GetHWND) /* 2 */
#define Tk_HWNDToWindow \
(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
-#define Tk_PointerEvent \
- (tkPlatStubsPtr->tk_PointerEvent) /* 4 */
-#define Tk_TranslateWinEvent \
- (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* Slot 0 is reserved */
@@ -151,8 +137,7 @@ extern const TkPlatStubs *tkPlatStubsPtr;
/* Slot 3 is reserved */
#define TkMacOSXInitAppleEvents \
(tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */
-#define TkGenWMConfigureEvent_ \
- (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 5 */
+/* Slot 5 is reserved */
#define TkMacOSXInvalClipRgns \
(tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
/* Slot 7 is reserved */
@@ -185,7 +170,6 @@ extern const TkPlatStubs *tkPlatStubsPtr;
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#undef TkGenWMConfigureEvent_
#define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl
#endif /* _TKPLATDECLS */
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 2162591..2bbfce8 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -171,7 +171,7 @@ Tk_ItemType tkRectangleType = {
RectOvalCoords, /* coordProc */
DeleteRectOval, /* deleteProc */
DisplayRectOval, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
RectToPoint, /* pointProc */
RectToArea, /* areaProc */
RectOvalToPostscript, /* postscriptProc */
@@ -196,7 +196,7 @@ Tk_ItemType tkOvalType = {
RectOvalCoords, /* coordProc */
DeleteRectOval, /* deleteProc */
DisplayRectOval, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ 0, /* flags */
OvalToPoint, /* pointProc */
OvalToArea, /* areaProc */
RectOvalToPostscript, /* postscriptProc */
@@ -416,7 +416,7 @@ ConfigureRectOval(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
+ objv, rectOvalPtr, flags)) {
return TCL_ERROR;
}
state = itemPtr->state;
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index ec94418..5f03fee 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -172,18 +172,12 @@ Tk_ScrollbarObjCmd(
scrollPtr->highlightBgColorPtr = NULL;
scrollPtr->highlightColorPtr = NULL;
scrollPtr->inset = 0;
- scrollPtr->elementBorderWidth = -1;
+ scrollPtr->elementBorderWidth = INT_MIN;
scrollPtr->arrowLength = 0;
scrollPtr->sliderFirst = 0;
scrollPtr->sliderLast = 0;
scrollPtr->activeField = 0;
scrollPtr->activeRelief = TK_RELIEF_RAISED;
-#ifndef TK_NO_DEPRECATED
- scrollPtr->totalUnits = 0;
- scrollPtr->windowUnits = 0;
- scrollPtr->firstUnit = 0;
- scrollPtr->lastUnit = 0;
-#endif /* TK_NO_DEPRECATED */
scrollPtr->firstFraction = 0.0;
scrollPtr->lastFraction = 0.0;
scrollPtr->cursor = NULL;
@@ -378,16 +372,6 @@ ScrollbarWidgetObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "get");
goto error;
}
-#ifndef TK_NO_DEPRECATED
- if (scrollPtr->flags & OLD_STYLE_COMMANDS) {
- resObjs[0] = Tcl_NewWideIntObj(scrollPtr->totalUnits);
- resObjs[1] = Tcl_NewWideIntObj(scrollPtr->windowUnits);
- resObjs[2] = Tcl_NewWideIntObj(scrollPtr->firstUnit);
- resObjs[3] = Tcl_NewWideIntObj(scrollPtr->lastUnit);
- Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs));
- break;
- }
-#endif /* TK_NO_DEPRECATED */
resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction);
resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs));
@@ -439,48 +423,6 @@ ScrollbarWidgetObjCmd(
} else {
scrollPtr->lastFraction = last;
}
-#ifndef TK_NO_DEPRECATED
- scrollPtr->flags &= ~OLD_STYLE_COMMANDS;
- } else if (objc == 6) {
- int totalUnits, windowUnits, firstUnit, lastUnit;
- if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) {
- goto error;
- }
- if (totalUnits < 0) {
- totalUnits = 0;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) {
- goto error;
- }
- if (windowUnits < 0) {
- windowUnits = 0;
- }
- if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) {
- goto error;
- }
- if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) {
- goto error;
- }
- if (totalUnits > 0) {
- if (lastUnit < firstUnit) {
- lastUnit = firstUnit;
- }
- } else {
- firstUnit = lastUnit = 0;
- }
- scrollPtr->totalUnits = totalUnits;
- scrollPtr->windowUnits = windowUnits;
- scrollPtr->firstUnit = firstUnit;
- scrollPtr->lastUnit = lastUnit;
- if (scrollPtr->totalUnits == 0) {
- scrollPtr->firstFraction = 0.0;
- scrollPtr->lastFraction = 1.0;
- } else {
- scrollPtr->firstFraction = ((double) firstUnit)/totalUnits;
- scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits;
- }
- scrollPtr->flags |= OLD_STYLE_COMMANDS;
-#endif /* !TK_NO_DEPRECATED */
} else {
Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction");
goto error;
@@ -531,7 +473,7 @@ ConfigureScrollbar(
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc,
- (const char **)objv, (char *) scrollPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ objv, scrollPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -549,7 +491,7 @@ ConfigureScrollbar(
scrollPtr->highlightWidth = 0;
}
if (scrollPtr->elementBorderWidth < 0) {
- scrollPtr->elementBorderWidth = -1;
+ scrollPtr->elementBorderWidth = INT_MIN;
}
/*
diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h
index 6912e71..3543d4f 100644
--- a/generic/tkScrollbar.h
+++ b/generic/tkScrollbar.h
@@ -96,22 +96,6 @@ typedef struct TkScrollbar {
* the OLD_STYLE_COMMANDS flag is 1.
*/
-#ifndef TK_NO_DEPRECATED
- int totalUnits; /* Total dimension of application, in units.
- * Valid only if the OLD_STYLE_COMMANDS flag
- * is set. */
- int windowUnits; /* Maximum number of units that can be
- * displayed in the window at once. Valid only
- * if the OLD_STYLE_COMMANDS flag is set. */
- int firstUnit; /* Number of last unit visible in
- * application's window. Valid only if the
- * OLD_STYLE_COMMANDS flag is set. */
- int lastUnit; /* Index of last unit visible in window.
- * Valid only if the OLD_STYLE_COMMANDS flag
- * isn't set. */
-#else
- int dummy1,dummy2,dummy3,dummy4; /* sizeof(TkScrollbar) should not depend on TK_NO_DEPRECATED */
-#endif /* TK_NO_DEPRECATED */
double firstFraction; /* Position of first visible thing in window,
* specified as a fraction between 0 and
* 1.0. */
@@ -157,9 +141,6 @@ typedef struct TkScrollbar {
*/
#define REDRAW_PENDING 1
-#ifndef TK_NO_DEPRECATED
-# define OLD_STYLE_COMMANDS 2
-#endif /* TK_NO_DEPRECATED */
#define GOT_FOCUS 4
/*
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 3478c3c..752b5ea 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -1401,15 +1401,15 @@ HandleTclCommand(
if (cmdInfoPtr->interp != NULL) {
if (length <= maxBytes) {
- cmdInfoPtr->charOffset += TkNumUtfChars(string, TCL_INDEX_NONE);
+ cmdInfoPtr->charOffset += Tcl_NumUtfChars(string, TCL_INDEX_NONE);
cmdInfoPtr->buffer[0] = '\0';
} else {
- int ch = 0;
+ Tcl_UniChar ch = 0;
p = string;
string += count;
numChars = 0;
while (p < string) {
- p += TkUtfToUniChar(p, &ch);
+ p += Tcl_UtfToUniChar(p, &ch);
numChars++;
}
cmdInfoPtr->charOffset += numChars;
diff --git a/generic/tkSquare.c b/generic/tkSquare.c
index 708adbe..3ba32b5 100644
--- a/generic/tkSquare.c
+++ b/generic/tkSquare.c
@@ -23,6 +23,7 @@
# define USE_TK_STUBS
#endif
#include "tkInt.h"
+#include <stdbool.h>
/*
* A data structure of the following type is kept for each square widget
@@ -53,10 +54,10 @@ typedef struct {
Tcl_Obj *reliefPtr;
GC gc; /* Graphics context for copying from
* off-screen pixmap onto screen. */
- Tcl_Obj *doubleBufferPtr; /* Non-zero means double-buffer redisplay with
- * pixmap; zero means draw straight onto the
+ bool doubleBuffer; /* true means double-buffer redisplay with
+ * pixmap; false means draw straight onto the
* display. */
- int updatePending; /* Non-zero means a call to SquareDisplay has
+ bool updatePending; /* true means a call to SquareDisplay has
* already been scheduled. */
} Square;
@@ -75,7 +76,7 @@ static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
"2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer",
- "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0},
+ "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), TK_OPTION_VAR(bool) , NULL, 0},
{TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
"-foreground", 0},
{TK_OPTION_BORDER, "-foreground", "foreground", "Foreground",
@@ -279,7 +280,7 @@ SquareWidgetObjCmd(
}
if (!squarePtr->updatePending) {
Tcl_DoWhenIdle(SquareDisplay, squarePtr);
- squarePtr->updatePending = 1;
+ squarePtr->updatePending = true;
}
}
if (resultObjPtr != NULL) {
@@ -321,7 +322,6 @@ SquareConfigure(
{
int borderWidth;
Tk_3DBorder bgBorder;
- int doubleBuffer;
/*
* Set the background for the window and create a graphics context for use
@@ -332,8 +332,7 @@ SquareConfigure(
squarePtr->bgBorderPtr);
Tk_SetWindowBackground(squarePtr->tkwin,
Tk_3DBorderColor(bgBorder)->pixel);
- Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer);
- if ((squarePtr->gc == NULL) && doubleBuffer) {
+ if ((squarePtr->gc == NULL) && squarePtr->doubleBuffer) {
XGCValues gcValues;
gcValues.function = GXcopy;
gcValues.graphics_exposures = False;
@@ -352,7 +351,7 @@ SquareConfigure(
Tk_SetInternalBorder(squarePtr->tkwin, borderWidth);
if (!squarePtr->updatePending) {
Tcl_DoWhenIdle(SquareDisplay, squarePtr);
- squarePtr->updatePending = 1;
+ squarePtr->updatePending = true;
}
KeepInWindow(squarePtr);
return TCL_OK;
@@ -386,13 +385,13 @@ SquareObjEventProc(
if (eventPtr->type == Expose) {
if (!squarePtr->updatePending) {
Tcl_DoWhenIdle(SquareDisplay, squarePtr);
- squarePtr->updatePending = 1;
+ squarePtr->updatePending = true;
}
} else if (eventPtr->type == ConfigureNotify) {
KeepInWindow(squarePtr);
if (!squarePtr->updatePending) {
Tcl_DoWhenIdle(SquareDisplay, squarePtr);
- squarePtr->updatePending = 1;
+ squarePtr->updatePending = true;
}
} else if (eventPtr->type == DestroyNotify) {
if (squarePtr->tkwin != NULL) {
@@ -477,9 +476,8 @@ SquareDisplay(
Drawable d;
int borderWidth, size, relief;
Tk_3DBorder bgBorder, fgBorder;
- int doubleBuffer;
- squarePtr->updatePending = 0;
+ squarePtr->updatePending = false;
if (!Tk_IsMapped(tkwin)) {
return;
}
@@ -488,8 +486,7 @@ SquareDisplay(
* Create a pixmap for double-buffering, if necessary.
*/
- Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer);
- if (doubleBuffer) {
+ if (squarePtr->doubleBuffer) {
pm = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin),
Tk_Width(tkwin), Tk_Height(tkwin),
DefaultDepthOfScreen(Tk_Screen(tkwin)));
@@ -524,7 +521,7 @@ SquareDisplay(
* If double-buffered, copy to the screen and release the pixmap.
*/
- if (doubleBuffer) {
+ if (squarePtr->doubleBuffer) {
XCopyArea(Tk_Display(tkwin), pm, Tk_WindowId(tkwin), squarePtr->gc,
0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin),
0, 0);
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index ac0af8e..a5c6460 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -39,88 +39,26 @@ MODULE_SCOPE const TkStubs tkStubs;
* Remove macro that might interfere with the definition below.
*/
-#undef Tk_MainEx
-#undef Tk_FreeXId
-#undef Tk_FreeStyleFromObj
-#undef Tk_GetStyleFromObj
-#undef TkWinGetPlatformId
#undef TkPutImage
#undef XPutImage
-#define TkMacOSXSetUpClippingRgn (void (*)(Drawable))(void *)doNothing
-#undef TkMacOSXIsCharacterMissing
-#define TkMacOSXIsCharacterMissing (int (*)(Tk_Font, unsigned int))(void *)doNothing
-
-#if defined(_WIN32) && !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-# define Tk_TranslateWinEvent TkTranslateWinEvent
-# define Tk_PointerEvent TkWinPointerEvent
-#define TkWinGetPlatformId winGetPlatformId
-static int TkWinGetPlatformId(void) {
- return 2;
-}
-#else
-# define Tk_TranslateWinEvent 0
-# define Tk_PointerEvent 0
-# define TkWinGetPlatformId 0
-#endif
-
-#if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8)
-# define TkSetWindowMenuBar 0
-# define TkpDrawHighlightBorder 0
-# define TkpUseWindow 0
-# define TkpSetMainMenubar 0
-# define TkpGetOtherWindow 0
-# define TkpGetSystemDefault 0
-# define TkpMakeContainer 0
-# define TkpMakeWindow 0
-#endif
+#if !defined(MAC_OSX_TK)
static int
doNothing(void)
{
/* dummy implementation, no need to do anything */
return 0;
}
-
-#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
-#define Tk_MainEx 0
-#define Tk_FreeXId 0
-#define Tk_FreeStyleFromObj 0
-#define Tk_GetStyleFromObj 0
-#define TkWinGetPlatformId 0
-#define Tk_PhotoPutBlock_NoComposite 0
-#define Tk_PhotoPutZoomedBlock_NoComposite 0
-#define Tk_PhotoExpand_Panic 0
-#define Tk_PhotoPutBlock_Panic 0
-#define Tk_PhotoPutZoomedBlock_Panic 0
-#define Tk_PhotoSetSize_Panic 0
-#define Tk_CreateOldPhotoImageFormat 0
-#else
-#define Tk_FreeXId ((void (*)(Display *, XID))(void *)doNothing)
-#define Tk_FreeStyleFromObj ((void (*)(Tcl_Obj *))(void *)doNothing)
-#define Tk_GetStyleFromObj getStyleFromObj
-static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj)
-{
- return Tk_AllocStyleFromObj(NULL, obj);
-}
-#endif /* !TK_NO_DEPRECATED */
-
-#define TkpCmapStressed_ TkpCmapStressed
-#define TkpSync_ TkpSync
-#define TkUnixContainerId_ TkUnixContainerId
-#define TkUnixDoOneXEvent_ TkUnixDoOneXEvent
-#define TkUnixSetMenubar_ TkUnixSetMenubar
-#define TkWmCleanup_ TkWmCleanup
-#define TkSendCleanup_ TkSendCleanup
-#define TkpTestsendCmd_ TkpTestsendCmd
-#define TkGenWMConfigureEvent_ TkGenWMConfigureEvent
-#define TkGenerateActivateEvents_ TkGenerateActivateEvents
-#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable
-
-#if !defined(MAC_OSX_TK)
# undef TkpWillDrawWidget
# undef TkpRedrawWidget
+# undef TkpDefineNativeBitmaps
+# undef TkpCreateNativeBitmap
+# undef TkpGetNativeAppBitmap
# define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing)
# define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing)
+# define TkpDefineNativeBitmaps ((void (*)(void))(void *)doNothing)
+# define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing)
+# define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char*, int *, int *))(void *)doNothing)
#endif
#ifdef _WIN32
@@ -358,13 +296,13 @@ static const TkIntStubs tkIntStubs = {
TkpClaimFocus, /* 57 */
TkpDisplayWarning, /* 58 */
TkpGetAppName, /* 59 */
- TkpGetOtherWindow, /* 60 */
+ 0, /* 60 */
TkpGetWrapperWindow, /* 61 */
TkpInit, /* 62 */
TkpInitializeMenuBindings, /* 63 */
- TkpMakeContainer, /* 64 */
+ 0, /* 64 */
TkpMakeMenuWindow, /* 65 */
- TkpMakeWindow, /* 66 */
+ 0, /* 66 */
TkpMenuNotifyToplevelCreate, /* 67 */
TkpOpenDisplay, /* 68 */
TkPointerEvent, /* 69 */
@@ -372,8 +310,8 @@ static const TkIntStubs tkIntStubs = {
TkPolygonToPoint, /* 71 */
TkPositionInTree, /* 72 */
TkpRedirectKeyEvent, /* 73 */
- TkpSetMainMenubar, /* 74 */
- TkpUseWindow, /* 75 */
+ 0, /* 74 */
+ 0, /* 75 */
0, /* 76 */
TkQueueEventForAllChildren, /* 77 */
TkReadBitmapFile, /* 78 */
@@ -383,7 +321,7 @@ static const TkIntStubs tkIntStubs = {
TkSelInit, /* 82 */
TkSelPropProc, /* 83 */
0, /* 84 */
- TkSetWindowMenuBar, /* 85 */
+ 0, /* 85 */
TkStringToKeysym, /* 86 */
TkThickPolyLineToArea, /* 87 */
TkWmAddToColormapWindows, /* 88 */
@@ -409,7 +347,7 @@ static const TkIntStubs tkIntStubs = {
TkGetWindowFromObj, /* 108 */
TkpGetString, /* 109 */
TkpGetSubFonts, /* 110 */
- TkpGetSystemDefault, /* 111 */
+ 0, /* 111 */
TkpMenuThreadInit, /* 112 */
XClipBox, /* 113 */
XCreateRegion, /* 114 */
@@ -419,43 +357,10 @@ static const TkIntStubs tkIntStubs = {
XSetRegion, /* 118 */
XUnionRectWithRegion, /* 119 */
0, /* 120 */
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- 0, /* 121 */
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- 0, /* 121 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
TkpCreateNativeBitmap, /* 121 */
-#endif /* AQUA */
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- 0, /* 122 */
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- 0, /* 122 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
TkpDefineNativeBitmaps, /* 122 */
-#endif /* AQUA */
0, /* 123 */
-#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
- 0, /* 124 */
-#endif /* X11 */
-#if defined(_WIN32) /* WIN */
- 0, /* 124 */
-#endif /* WIN */
-#ifdef MAC_OSX_TK /* AQUA */
-# if TCL_MAJOR_VERSION < 9
- 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */
-# endif /* TCL_MAJOR_VERSION < 9 */
TkpGetNativeAppBitmap, /* 124 */
-#endif /* AQUA */
0, /* 125 */
0, /* 126 */
0, /* 127 */
@@ -466,7 +371,7 @@ static const TkIntStubs tkIntStubs = {
0, /* 132 */
0, /* 133 */
0, /* 134 */
- TkpDrawHighlightBorder, /* 135 */
+ 0, /* 135 */
TkSetFocusWin, /* 136 */
TkpSetKeycodeAndState, /* 137 */
TkpGetKeySym, /* 138 */
@@ -525,7 +430,7 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
0,
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
- TkAlignImageData, /* 0 */
+ TkCreateXEventSource, /* 0 */
0, /* 1 */
TkGenerateActivateEvents, /* 2 */
TkpGetMS, /* 3 */
@@ -558,11 +463,11 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkWinSetForegroundWindow, /* 30 */
TkWinDialogDebug, /* 31 */
TkWinGetMenuSystemDefault, /* 32 */
- TkWinGetPlatformId, /* 33 */
+ TkAlignImageData, /* 33 */
TkWinSetHINSTANCE, /* 34 */
TkWinGetPlatformTheme, /* 35 */
TkWinChildProc, /* 36 */
- TkCreateXEventSource, /* 37 */
+ 0, /* 37 */
TkpCmapStressed, /* 38 */
TkpSync, /* 39 */
TkUnixContainerId, /* 40 */
@@ -575,18 +480,18 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkpGetCapture, /* 47 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- TkGenerateActivateEvents, /* 0 */
- 0, /* 1 */
- TkGenerateActivateEvents_, /* 2 */
- TkPointerDeadWindow, /* 3 */
- TkpSetCapture, /* 4 */
+ 0, /* 0 */
+ TkAboutDlg, /* 1 */
+ TkGenerateActivateEvents, /* 2 */
+ TkpGetMS, /* 3 */
+ TkPointerDeadWindow, /* 4 */
TkpSetCursor, /* 5 */
- TkpWmSetState, /* 6 */
- TkAboutDlg, /* 7 */
+ TkpScanWindowId, /* 6 */
+ TkpWmSetState, /* 7 */
TkMacOSXButtonKeyState, /* 8 */
TkMacOSXClearMenubarActive, /* 9 */
TkMacOSXDispatchMenuEvent, /* 10 */
- 0, /* 11 */
+ TkpSetCapture, /* 11 */
TkMacOSXHandleTearoffMenu, /* 12 */
0, /* 13 */
TkMacOSXDoHLEvent, /* 14 */
@@ -597,7 +502,7 @@ static const TkIntPlatStubs tkIntPlatStubs = {
0, /* 19 */
0, /* 20 */
TkMacOSXInvalidateWindow, /* 21 */
- TkMacOSXIsCharacterMissing, /* 22 */
+ 0, /* 22 */
TkMacOSXMakeRealWindowExist, /* 23 */
TkMacOSXMakeStippleMap, /* 24 */
TkMacOSXMenuClick, /* 25 */
@@ -605,7 +510,7 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXResizable, /* 27 */
TkMacOSXSetHelpMenuItemCount, /* 28 */
TkMacOSXSetScrollbarGrow, /* 29 */
- TkMacOSXSetUpClippingRgn, /* 30 */
+ 0, /* 30 */
TkMacOSXSetUpGraphicsPort, /* 31 */
TkMacOSXUpdateClipRgn, /* 32 */
0, /* 33 */
@@ -628,25 +533,22 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkGenerateButtonEvent, /* 50 */
TkGenWMDestroyEvent, /* 51 */
TkMacOSXSetDrawingEnabled, /* 52 */
- TkpGetMS, /* 53 */
- TkMacOSXDrawable, /* 54 */
- TkpScanWindowId, /* 55 */
#endif /* AQUA */
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
0, /* 1 */
TkGenerateActivateEvents, /* 2 */
- TkpCmapStressed, /* 3 */
- TkpSync, /* 4 */
- TkUnixContainerId, /* 5 */
- TkUnixDoOneXEvent, /* 6 */
- TkUnixSetMenubar, /* 7 */
- TkpScanWindowId, /* 8 */
- TkWmCleanup, /* 9 */
- TkSendCleanup, /* 10 */
+ 0, /* 3 */
+ 0, /* 4 */
+ 0, /* 5 */
+ TkpScanWindowId, /* 6 */
+ 0, /* 7 */
+ 0, /* 8 */
+ TkpWmSetState, /* 9 */
+ 0, /* 10 */
0, /* 11 */
- TkpWmSetState, /* 12 */
- TkpTestsendCmd_, /* 13 */
+ 0, /* 12 */
+ 0, /* 13 */
0, /* 14 */
0, /* 15 */
0, /* 16 */
@@ -671,13 +573,13 @@ static const TkIntPlatStubs tkIntPlatStubs = {
0, /* 35 */
0, /* 36 */
0, /* 37 */
- TkpCmapStressed_, /* 38 */
- TkpSync_, /* 39 */
- TkUnixContainerId_, /* 40 */
- TkUnixDoOneXEvent_, /* 41 */
- TkUnixSetMenubar_, /* 42 */
- TkWmCleanup_, /* 43 */
- TkSendCleanup_, /* 44 */
+ TkpCmapStressed, /* 38 */
+ TkpSync, /* 39 */
+ TkUnixContainerId, /* 40 */
+ TkUnixDoOneXEvent, /* 41 */
+ TkUnixSetMenubar, /* 42 */
+ TkWmCleanup, /* 43 */
+ TkSendCleanup, /* 44 */
TkpTestsendCmd, /* 45 */
#endif /* X11 */
};
@@ -854,113 +756,113 @@ static const TkIntXlibStubs tkIntXlibStubs = {
XGetAtomName, /* 4 */
XKeysymToString, /* 5 */
XCreateColormap, /* 6 */
- XGContextFromGC, /* 7 */
- XKeycodeToKeysym, /* 8 */
- XStringToKeysym, /* 9 */
- XRootWindow, /* 10 */
- XSetErrorHandler, /* 11 */
- XAllocColor, /* 12 */
- XBell, /* 13 */
- XChangeProperty, /* 14 */
- XChangeWindowAttributes, /* 15 */
- XConfigureWindow, /* 16 */
- XCopyArea, /* 17 */
- XCopyPlane, /* 18 */
- XCreateBitmapFromData, /* 19 */
- XDefineCursor, /* 20 */
- XDestroyWindow, /* 21 */
- XDrawArc, /* 22 */
- XDrawLines, /* 23 */
- XDrawRectangle, /* 24 */
- XFillArc, /* 25 */
- XFillPolygon, /* 26 */
- XFillRectangles, /* 27 */
- XFreeColormap, /* 28 */
- XFreeColors, /* 29 */
- XFreeModifiermap, /* 30 */
- XGetGeometry, /* 31 */
- XGetWindowProperty, /* 32 */
- XGrabKeyboard, /* 33 */
- XGrabPointer, /* 34 */
- XKeysymToKeycode, /* 35 */
- XMapWindow, /* 36 */
- XMoveResizeWindow, /* 37 */
- XMoveWindow, /* 38 */
- XQueryPointer, /* 39 */
- XRaiseWindow, /* 40 */
- XRefreshKeyboardMapping, /* 41 */
- XResizeWindow, /* 42 */
- XSelectInput, /* 43 */
- XSendEvent, /* 44 */
- XSetIconName, /* 45 */
- XSetInputFocus, /* 46 */
- XSetSelectionOwner, /* 47 */
- XSetWindowBackground, /* 48 */
- XSetWindowBackgroundPixmap, /* 49 */
- XSetWindowBorder, /* 50 */
- XSetWindowBorderPixmap, /* 51 */
- XSetWindowBorderWidth, /* 52 */
- XSetWindowColormap, /* 53 */
- XUngrabKeyboard, /* 54 */
- XUngrabPointer, /* 55 */
- XUnmapWindow, /* 56 */
- TkPutImage, /* 57 */
- XParseColor, /* 58 */
- XCreateGC, /* 59 */
- XFreeGC, /* 60 */
- XInternAtom, /* 61 */
- XSetBackground, /* 62 */
- XSetForeground, /* 63 */
- XSetClipMask, /* 64 */
- XSetClipOrigin, /* 65 */
- XSetTSOrigin, /* 66 */
- XChangeGC, /* 67 */
- XSetFont, /* 68 */
- XSetArcMode, /* 69 */
- XSetStipple, /* 70 */
- XSetFillRule, /* 71 */
- XSetFillStyle, /* 72 */
- XSetFunction, /* 73 */
- XSetLineAttributes, /* 74 */
- _XInitImageFuncPtrs, /* 75 */
- XCreateIC, /* 76 */
- XGetVisualInfo, /* 77 */
- XSetWMClientMachine, /* 78 */
- XStringListToTextProperty, /* 79 */
- XDrawSegments, /* 80 */
- XForceScreenSaver, /* 81 */
- XDrawLine, /* 82 */
- XFillRectangle, /* 83 */
- XClearWindow, /* 84 */
- XDrawPoint, /* 85 */
- XDrawPoints, /* 86 */
- XWarpPointer, /* 87 */
- XQueryColor, /* 88 */
- XQueryColors, /* 89 */
- XQueryTree, /* 90 */
- XSync, /* 91 */
- XTranslateCoordinates, /* 92 */
- XDeleteProperty, /* 93 */
- XFreeCursor, /* 94 */
- XGetInputFocus, /* 95 */
- XmbLookupString, /* 96 */
- XNextEvent, /* 97 */
- XPutBackEvent, /* 98 */
- XSetCommand, /* 99 */
- XWindowEvent, /* 100 */
- XGetWindowAttributes, /* 101 */
- XGetWMColormapWindows, /* 102 */
- XIconifyWindow, /* 103 */
- XWithdrawWindow, /* 104 */
- XListHosts, /* 105 */
- XSetClipRectangles, /* 106 */
+ XCreatePixmapCursor, /* 7 */
+ XCreateGlyphCursor, /* 8 */
+ XGContextFromGC, /* 9 */
+ XListHosts, /* 10 */
+ XKeycodeToKeysym, /* 11 */
+ XStringToKeysym, /* 12 */
+ XRootWindow, /* 13 */
+ XSetErrorHandler, /* 14 */
+ XIconifyWindow, /* 15 */
+ XWithdrawWindow, /* 16 */
+ XGetWMColormapWindows, /* 17 */
+ XAllocColor, /* 18 */
+ XBell, /* 19 */
+ XChangeProperty, /* 20 */
+ XChangeWindowAttributes, /* 21 */
+ XClearWindow, /* 22 */
+ XConfigureWindow, /* 23 */
+ XCopyArea, /* 24 */
+ XCopyPlane, /* 25 */
+ XCreateBitmapFromData, /* 26 */
+ XDefineCursor, /* 27 */
+ XDeleteProperty, /* 28 */
+ XDestroyWindow, /* 29 */
+ XDrawArc, /* 30 */
+ XDrawLines, /* 31 */
+ XDrawRectangle, /* 32 */
+ XFillArc, /* 33 */
+ XFillPolygon, /* 34 */
+ XFillRectangles, /* 35 */
+ XForceScreenSaver, /* 36 */
+ XFreeColormap, /* 37 */
+ XFreeColors, /* 38 */
+ XFreeCursor, /* 39 */
+ XFreeModifiermap, /* 40 */
+ XGetGeometry, /* 41 */
+ XGetInputFocus, /* 42 */
+ XGetWindowProperty, /* 43 */
+ XGetWindowAttributes, /* 44 */
+ XGrabKeyboard, /* 45 */
+ XGrabPointer, /* 46 */
+ XKeysymToKeycode, /* 47 */
+ XLookupColor, /* 48 */
+ XMapWindow, /* 49 */
+ XMoveResizeWindow, /* 50 */
+ XMoveWindow, /* 51 */
+ XNextEvent, /* 52 */
+ XPutBackEvent, /* 53 */
+ XQueryColors, /* 54 */
+ XQueryPointer, /* 55 */
+ XQueryTree, /* 56 */
+ XRaiseWindow, /* 57 */
+ XRefreshKeyboardMapping, /* 58 */
+ XResizeWindow, /* 59 */
+ XSelectInput, /* 60 */
+ XSendEvent, /* 61 */
+ XSetCommand, /* 62 */
+ XSetIconName, /* 63 */
+ XSetInputFocus, /* 64 */
+ XSetSelectionOwner, /* 65 */
+ XSetWindowBackground, /* 66 */
+ XSetWindowBackgroundPixmap, /* 67 */
+ XSetWindowBorder, /* 68 */
+ XSetWindowBorderPixmap, /* 69 */
+ XSetWindowBorderWidth, /* 70 */
+ XSetWindowColormap, /* 71 */
+ XTranslateCoordinates, /* 72 */
+ XUngrabKeyboard, /* 73 */
+ XUngrabPointer, /* 74 */
+ XUnmapWindow, /* 75 */
+ XWindowEvent, /* 76 */
+ XDestroyIC, /* 77 */
+ XFilterEvent, /* 78 */
+ XmbLookupString, /* 79 */
+ TkPutImage, /* 80 */
+ XSetClipRectangles, /* 81 */
+ XParseColor, /* 82 */
+ XCreateGC, /* 83 */
+ XFreeGC, /* 84 */
+ XInternAtom, /* 85 */
+ XSetBackground, /* 86 */
+ XSetForeground, /* 87 */
+ XSetClipMask, /* 88 */
+ XSetClipOrigin, /* 89 */
+ XSetTSOrigin, /* 90 */
+ XChangeGC, /* 91 */
+ XSetFont, /* 92 */
+ XSetArcMode, /* 93 */
+ XSetStipple, /* 94 */
+ XSetFillRule, /* 95 */
+ XSetFillStyle, /* 96 */
+ XSetFunction, /* 97 */
+ XSetLineAttributes, /* 98 */
+ _XInitImageFuncPtrs, /* 99 */
+ XCreateIC, /* 100 */
+ XGetVisualInfo, /* 101 */
+ XSetWMClientMachine, /* 102 */
+ XStringListToTextProperty, /* 103 */
+ XDrawLine, /* 104 */
+ XWarpPointer, /* 105 */
+ XFillRectangle, /* 106 */
XFlush, /* 107 */
XGrabServer, /* 108 */
XUngrabServer, /* 109 */
XFree, /* 110 */
XNoOp, /* 111 */
XSynchronize, /* 112 */
- XLookupColor, /* 113 */
+ XSync, /* 113 */
XVisualIDFromVisual, /* 114 */
0, /* 115 */
0, /* 116 */
@@ -980,9 +882,9 @@ static const TkIntXlibStubs tkIntXlibStubs = {
XFillArcs, /* 130 */
XDrawArcs, /* 131 */
XDrawRectangles, /* 132 */
- 0, /* 133 */
- 0, /* 134 */
- 0, /* 135 */
+ XDrawSegments, /* 133 */
+ XDrawPoint, /* 134 */
+ XDrawPoints, /* 135 */
XReparentWindow, /* 136 */
XPutImage, /* 137 */
XPolygonRegion, /* 138 */
@@ -991,9 +893,9 @@ static const TkIntXlibStubs tkIntXlibStubs = {
XSetICValues, /* 141 */
XGetICValues, /* 142 */
XSetICFocus, /* 143 */
- XDestroyIC, /* 144 */
- XCreatePixmapCursor, /* 145 */
- XCreateGlyphCursor, /* 146 */
+ 0, /* 144 */
+ 0, /* 145 */
+ 0, /* 146 */
XFreeFontSet, /* 147 */
XCloseIM, /* 148 */
XRegisterIMInstantiateCallback, /* 149 */
@@ -1017,8 +919,6 @@ static const TkPlatStubs tkPlatStubs = {
Tk_GetHINSTANCE, /* 1 */
Tk_GetHWND, /* 2 */
Tk_HWNDToWindow, /* 3 */
- Tk_PointerEvent, /* 4 */
- Tk_TranslateWinEvent, /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
0, /* 0 */
@@ -1026,7 +926,7 @@ static const TkPlatStubs tkPlatStubs = {
0, /* 2 */
0, /* 3 */
TkMacOSXInitAppleEvents, /* 4 */
- TkGenWMConfigureEvent_, /* 5 */
+ 0, /* 5 */
TkMacOSXInvalClipRgns, /* 6 */
0, /* 7 */
TkMacOSXGetRootControl, /* 8 */
@@ -1128,7 +1028,7 @@ const TkStubs tkStubs = {
Tk_FreeOptions, /* 74 */
Tk_FreePixmap, /* 75 */
Tk_FreeTextLayout, /* 76 */
- Tk_FreeXId, /* 77 */
+ 0, /* 77 */
Tk_GCForColor, /* 78 */
Tk_GeometryRequest, /* 79 */
Tk_Get3DBorder, /* 80 */
@@ -1169,7 +1069,7 @@ const TkStubs tkStubs = {
Tk_HandleEvent, /* 115 */
Tk_IdToWindow, /* 116 */
Tk_ImageChanged, /* 117 */
- Tk_Init, /* 118 */
+ 0, /* 118 */
Tk_InternAtom, /* 119 */
Tk_IntersectTextLayout, /* 120 */
Tk_MaintainGeometry, /* 121 */
@@ -1195,13 +1095,13 @@ const TkStubs tkStubs = {
Tk_NameToWindow, /* 141 */
Tk_OwnSelection, /* 142 */
Tk_ParseArgv, /* 143 */
- Tk_PhotoPutBlock_NoComposite, /* 144 */
- Tk_PhotoPutZoomedBlock_NoComposite, /* 145 */
+ 0, /* 144 */
+ 0, /* 145 */
Tk_PhotoGetImage, /* 146 */
Tk_PhotoBlank, /* 147 */
- Tk_PhotoExpand_Panic, /* 148 */
+ 0, /* 148 */
Tk_PhotoGetSize, /* 149 */
- Tk_PhotoSetSize_Panic, /* 150 */
+ 0, /* 150 */
Tk_PointToChar, /* 151 */
Tk_PostscriptFontName, /* 152 */
Tk_PreserveColormap, /* 153 */
@@ -1210,7 +1110,7 @@ const TkStubs tkStubs = {
Tk_ResizeWindow, /* 156 */
Tk_RestackWindow, /* 157 */
Tk_RestrictEvents, /* 158 */
- Tk_SafeInit, /* 159 */
+ 0, /* 159 */
Tk_SetAppName, /* 160 */
Tk_SetBackgroundFromBorder, /* 161 */
Tk_SetClass, /* 162 */
@@ -1263,11 +1163,11 @@ const TkStubs tkStubs = {
Tk_GetReliefFromObj, /* 209 */
Tk_GetScrollInfoObj, /* 210 */
Tk_InitOptions, /* 211 */
- Tk_MainEx, /* 212 */
+ 0, /* 212 */
Tk_RestoreSavedOptions, /* 213 */
Tk_SetOptions, /* 214 */
Tk_InitConsoleChannels, /* 215 */
- Tk_CreateConsoleWindow, /* 216 */
+ 0, /* 216 */
Tk_CreateSmoothMethod, /* 217 */
0, /* 218 */
0, /* 219 */
@@ -1297,8 +1197,8 @@ const TkStubs tkStubs = {
Tk_SetInternalBorderEx, /* 243 */
Tk_SetMinimumRequestSize, /* 244 */
Tk_SetCaretPos, /* 245 */
- Tk_PhotoPutBlock_Panic, /* 246 */
- Tk_PhotoPutZoomedBlock_Panic, /* 247 */
+ 0, /* 246 */
+ 0, /* 247 */
Tk_CollapseMotionEvents, /* 248 */
Tk_RegisterStyleEngine, /* 249 */
Tk_GetStyleEngine, /* 250 */
@@ -1309,8 +1209,8 @@ const TkStubs tkStubs = {
Tk_FreeStyle, /* 255 */
Tk_NameOfStyle, /* 256 */
Tk_AllocStyleFromObj, /* 257 */
- Tk_GetStyleFromObj, /* 258 */
- Tk_FreeStyleFromObj, /* 259 */
+ 0, /* 258 */
+ 0, /* 259 */
Tk_GetStyledElement, /* 260 */
Tk_GetElementSize, /* 261 */
Tk_GetElementBox, /* 262 */
@@ -1323,8 +1223,8 @@ const TkStubs tkStubs = {
Tk_GetUserInactiveTime, /* 269 */
Tk_ResetUserInactiveTime, /* 270 */
Tk_Interp, /* 271 */
- Tk_CreateOldImageType, /* 272 */
- Tk_CreateOldPhotoImageFormat, /* 273 */
+ 0, /* 272 */
+ 0, /* 273 */
Tk_AlwaysShowSelection, /* 274 */
Tk_GetButtonMask, /* 275 */
Tk_GetDoublePixelsFromObj, /* 276 */
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 4d96ad3..5bdf24e 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -208,7 +208,7 @@ Tktest_Init(
{
static int initialized = 0;
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return TCL_ERROR;
}
if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
@@ -273,14 +273,6 @@ Tktest_Init(
}
/*
- * Enable testing of legacy interfaces.
- */
-
- if (TkOldTestInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /*
* And finally add any platform specific test commands.
*/
diff --git a/generic/tkText.c b/generic/tkText.c
index f792c9c..782c136 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -27,16 +27,6 @@
#include "tkWinInt.h"
#endif
-/*
- * For compatibility with Tk 4.0 through 8.4.x, we allow tabs to be
- * mis-specified with non-increasing values. These are converted into tabs
- * which are the equivalent of at least a character width apart.
- */
-
-#if (TK_MAJOR_VERSION < 9)
-#define _TK_ALLOW_DECREASING_TABS
-#endif
-
#include "tkText.h"
/*
@@ -232,7 +222,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle),
TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TEXT_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkText, takeFocus),
+ DEF_TEXT_TAKE_FOCUS, offsetof(TkText, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-undo", "undo", "Undo",
DEF_TEXT_UNDO, TCL_INDEX_NONE, offsetof(TkText, undo),
@@ -244,10 +234,10 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_TEXT_WRAP, TCL_INDEX_NONE, offsetof(TkText, wrapMode),
TK_OPTION_ENUM_VAR, tkTextWrapStrings, TK_TEXT_LINE_GEOMETRY},
{TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- DEF_TEXT_XSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, xScrollCmd),
+ DEF_TEXT_XSCROLL_COMMAND, offsetof(TkText, xScrollCmdObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- DEF_TEXT_YSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, yScrollCmd),
+ DEF_TEXT_YSCROLL_COMMAND, offsetof(TkText, yScrollCmdObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0}
};
@@ -623,9 +613,6 @@ CreateWidget(
*/
textPtr->selTagPtr = TkTextCreateTag(textPtr, "sel", NULL);
- textPtr->selTagPtr->reliefString = (char *)
- ckalloc(sizeof(DEF_TEXT_SELECT_RELIEF));
- strcpy(textPtr->selTagPtr->reliefString, DEF_TEXT_SELECT_RELIEF);
Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &textPtr->selTagPtr->relief);
textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &startIndex);
textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex);
@@ -1461,7 +1448,7 @@ TextWidgetObjCmd(
insertLength = 0;
for (j = 4; j < objc; j += 2) {
- insertLength += TkGetCharLength(objv[j]);
+ insertLength += Tcl_GetCharLength(objv[j]);
}
/*
@@ -2236,7 +2223,7 @@ ConfigureText(
textPtr->tabArrayPtr = NULL;
}
if (textPtr->tabOptionPtr != NULL) {
- textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr,
+ textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr->tkwin,
textPtr->tabOptionPtr);
if (textPtr->tabArrayPtr == NULL) {
Tcl_AddErrorInfo(interp,"\n (while processing -tabs option)");
@@ -4093,12 +4080,12 @@ TextSearchIndexInLine(
if (searchSpecPtr->exact) {
index += leftToScan;
} else {
- index += TkNumUtfChars(segPtr->body.chars, leftToScan);
+ index += Tcl_NumUtfChars(segPtr->body.chars, leftToScan);
}
} else if (searchSpecPtr->exact) {
index += segPtr->size;
} else {
- index += TkNumUtfChars(segPtr->body.chars, -1);
+ index += Tcl_NumUtfChars(segPtr->body.chars, -1);
}
}
leftToScan -= segPtr->size;
@@ -4223,7 +4210,7 @@ TextSearchAddNextLine(
Tcl_GetString(theLine);
*lenPtr = theLine->length;
} else {
- *lenPtr = TkGetCharLength(theLine);
+ *lenPtr = Tcl_GetCharLength(theLine);
}
}
return linePtr;
@@ -4293,7 +4280,7 @@ TextSearchFoundMatch(
if (searchSpecPtr->exact) {
const char *startOfLine = Tcl_GetString(theLine);
- numChars = TkNumUtfChars(startOfLine + matchOffset, matchLength);
+ numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength);
} else {
numChars = matchLength;
}
@@ -4352,13 +4339,13 @@ TextSearchFoundMatch(
if (searchSpecPtr->exact) {
matchOffset += segPtr->size;
} else {
- matchOffset += TkNumUtfChars(segPtr->body.chars, -1);
+ matchOffset += Tcl_NumUtfChars(segPtr->body.chars, -1);
}
} else {
if (searchSpecPtr->exact) {
leftToScan -= (int)segPtr->size;
} else {
- leftToScan -= TkNumUtfChars(segPtr->body.chars, -1);
+ leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1);
}
}
curIndex.byteIndex += segPtr->size;
@@ -4443,13 +4430,13 @@ TextSearchFoundMatch(
continue;
} else if (!searchSpecPtr->searchElide
&& TkTextIsElided(textPtr, &curIndex, NULL)) {
- numChars += TkNumUtfChars(segPtr->body.chars, -1);
+ numChars += Tcl_NumUtfChars(segPtr->body.chars, -1);
continue;
}
if (searchSpecPtr->exact) {
leftToScan -= segPtr->size;
} else {
- leftToScan -= TkNumUtfChars(segPtr->body.chars, -1);
+ leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1);
}
}
@@ -4493,7 +4480,7 @@ TextSearchFoundMatch(
TkTextTabArray *
TkTextGetTabs(
Tcl_Interp *interp, /* Used for error reporting. */
- const TkText *textPtr, /* Information about the text widget. */
+ Tk_Window tkwin, /* Information about the window. */
Tcl_Obj *stringPtr) /* Description of the tab stops. See the text
* manual entry for details. */
{
@@ -4544,7 +4531,7 @@ TkTextGetTabs(
* downwards, to find the right integer pixel position.
*/
- if (Tk_GetPixelsFromObj(interp, textPtr->tkwin, objv[i],
+ if (Tk_GetPixelsFromObj(interp, tkwin, objv[i],
&tabPtr->location) != TCL_OK) {
goto error;
}
@@ -4558,7 +4545,7 @@ TkTextGetTabs(
}
prevStop = lastStop;
- if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i],
+ if (Tk_GetDoublePixelsFromObj(interp, tkwin, objv[i],
&lastStop) != TCL_OK) {
goto error;
}
@@ -4569,27 +4556,12 @@ TkTextGetTabs(
* illegal.
*/
-#ifdef _TK_ALLOW_DECREASING_TABS
- /*
- * Force the tab to be a typical character width to the right of
- * the previous one, and update the 'lastStop' with the changed
- * position.
- */
-
- if (textPtr->charWidth > 0) {
- tabPtr->location = (tabPtr-1)->location + textPtr->charWidth;
- } else {
- tabPtr->location = (tabPtr-1)->location + 8;
- }
- lastStop = tabPtr->location;
-#else
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"tabs must be monotonically increasing, but \"%s\" is "
"smaller than or equal to the previous tab",
Tcl_GetString(objv[i])));
Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL);
goto error;
-#endif /* _TK_ALLOW_DECREASING_TABS */
}
tabArrayPtr->numTabs++;
@@ -4608,7 +4580,7 @@ TkTextGetTabs(
* There may be a more efficient way of getting this.
*/
- TkUtfToUniChar(Tcl_GetString(objv[i+1]), &ch);
+ Tcl_UtfToUniChar(Tcl_GetString(objv[i+1]), &ch);
if (!Tcl_UniCharIsAlpha(ch)) {
continue;
}
@@ -6195,7 +6167,7 @@ SearchCore(
}
} else {
firstOffset = p - startOfLine +
- TkUtfToUniChar(startOfLine+matchOffset,&ch);
+ Tcl_UtfToUniChar(startOfLine+matchOffset,&ch);
}
}
} while (searchSpecPtr->all);
diff --git a/generic/tkText.h b/generic/tkText.h
index a2d8240..e29a8ac 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -345,8 +345,10 @@ typedef struct TkTextTag {
* value specified here. */
int borderWidth; /* Width of 3-D border for background. */
Tcl_Obj *borderWidthPtr; /* Width of 3-D border for background. */
+#if TK_MAJOR_VERSION < 9
char *reliefString; /* -relief option string (malloc-ed). NULL
* means option not specified. */
+#endif
int relief; /* 3-D relief for background. */
Pixmap bgStipple; /* Stipple bitmap for background. None means
* no value specified here. */
@@ -357,35 +359,57 @@ typedef struct TkTextTag {
Pixmap fgStipple; /* Stipple bitmap for text and other
* foreground stuff. None means no value
* specified here.*/
+#if TK_MAJOR_VERSION < 9
char *justifyString; /* -justify option string (malloc-ed). NULL
* means option not specified. */
+#endif
Tk_Justify justify; /* How to justify text: TK_JUSTIFY_CENTER,
- * TK_JUSTIFY_LEFT, or TK_JUSTIFY_RIGHT.
- * Only valid if justifyString is non-NULL. */
+ * TK_JUSTIFY_LEFT, or TK_JUSTIFY_RIGHT. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *lMargin1Obj; /* -lmargin1 option object. NULL
+ * means option not specified. */
+#else
char *lMargin1String; /* -lmargin1 option string (malloc-ed). NULL
* means option not specified. */
+#endif
int lMargin1; /* Left margin for first display line of each
* text line, in pixels. INT_MIN means option not specified. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *lMargin2Obj; /* -lmargin2 option object. NULL
+ * means option not specified. */
+#else
char *lMargin2String; /* -lmargin2 option string (malloc-ed). NULL
* means option not specified. */
+#endif
int lMargin2; /* Left margin for second and later display lines
* of each text line, in pixels. INT_MIN means option not specified. */
Tk_3DBorder lMarginColor; /* Used for drawing background in left margins.
* This is used for both lmargin1 and lmargin2.
* NULL means no value specified here. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *offsetObj; /* -offset option. NULL means option not specified. */
+#else
char *offsetString; /* -offset option string (malloc-ed). NULL
* means option not specified. */
+#endif
int offset; /* Vertical offset of text's baseline from
* baseline of line. Used for superscripts and
* subscripts. INT_MIN means option not specified. */
+#if TK_MAJOR_VERSION < 9
char *overstrikeString; /* -overstrike option string (malloc-ed). NULL
* means option not specified. */
+#endif
int overstrike; /* > 0 means draw horizontal line through
* middle of text. -1 means not specified. */
XColor *overstrikeColor; /* Color for the overstrike. NULL means same
* color as foreground. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *rMarginObj; /* -rmargin option object. NULL
+ * means option not specified. */
+#else
char *rMarginString; /* -rmargin option string (malloc-ed). NULL
* means option not specified. */
+#endif
int rMargin; /* Right margin for text, in pixels. INT_MIN means option not specified. */
Tk_3DBorder rMarginColor; /* Used for drawing background in right margin.
* NULL means no value specified here. */
@@ -393,16 +417,31 @@ typedef struct TkTextTag {
* NULL means no value specified here. */
XColor *selFgColor; /* Foreground color for selected text. NULL means
* no value specified here. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *spacing1Obj; /* -spacing1 option object. NULL
+ * means option not specified. */
+#else
char *spacing1String; /* -spacing1 option string (malloc-ed). NULL
* means option not specified. */
+#endif
int spacing1; /* Extra spacing above first display line for
* text line. INT_MIN means option not specified. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *spacing2Obj; /* -spacing2 option object. NULL
+ * means option not specified. */
+#else
char *spacing2String; /* -spacing2 option string (malloc-ed). NULL
* means option not specified. */
+#endif
int spacing2; /* Extra spacing between display lines for the
* same text line. INT_MIN means option not specified. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *spacing3Obj; /* -spacing3 option object. NULL
+ * means option not specified. */
+#else
char *spacing3String; /* -spacing3 option string (malloc-ed). NULL
* means option not specified. */
+#endif
int spacing3; /* Extra spacing below last display line for
* text line. INT_MIN means option not specified. */
Tcl_Obj *tabStringPtr; /* -tabs option string. NULL means option not
@@ -410,10 +449,15 @@ typedef struct TkTextTag {
struct TkTextTabArray *tabArrayPtr;
/* Info about tabs for tag (malloc-ed) or
* NULL. Corresponds to tabString. */
- TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR, TK_TEXT_TABSTYLE_WORDPROCESSOR
- * or TK_TEXT_TABSTYLE_NONE. (if not specified)*/
+#if TK_MAJOR_VERSION > 8
+ TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR
+ * or TK_TEXT_TABSTYLE_NULL (if not specified). */
+#else
+ int tabStyle; /* One of TABULAR or WORDPROCESSOR or NONE (if
+ * not specified). */
char *underlineString; /* -underline option string (malloc-ed). NULL
* means option not specified. */
+#endif
int underline; /* > 0 means draw underline underneath
* text. -1 means not specified. */
XColor *underlineColor; /* Color for the underline. NULL means same
@@ -422,8 +466,10 @@ typedef struct TkTextTag {
* Must be TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD,
* TEXT_WRAPMODE_NONE, or TEXT_WRAPMODE_NULL to
* use wrapmode for whole widget. */
+#if TK_MAJOR_VERSION < 9
char *elideString; /* -elide option string (malloc-ed). NULL
* means option not specified. */
+#endif
int elide; /* > 0 means that data under this tag
* should not be displayed. -1 means not specified. */
int affectsDisplay; /* Non-zero means that this tag affects the
@@ -779,13 +825,19 @@ typedef struct TkText {
* Miscellaneous additional information:
*/
- char *takeFocus; /* Value of -takeFocus option; not used in the
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *takeFocusObj; /* Value of -takeFocus option; not used in the
* C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
- char *xScrollCmd; /* Prefix of command to issue to update
+ Tcl_Obj *xScrollCmdObj; /* Prefix of command to issue to update
* horizontal scrollbar when view changes. */
- char *yScrollCmd; /* Prefix of command to issue to update
+ Tcl_Obj *yScrollCmdObj; /* Prefix of command to issue to update
* vertical scrollbar when view changes. */
+#else
+ char *takeFocus;
+ char *xScrollCmd;
+ char *yScrollCmd;
+#endif
int flags; /* Miscellaneous flags; see below for
* definitions. */
Tk_OptionTable optionTable; /* Token representing the configuration
@@ -1084,7 +1136,7 @@ MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp,
MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp,
TkText *textPtr, Tcl_Obj *objPtr);
MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp,
- const TkText *textPtr, Tcl_Obj *stringPtr);
+ Tk_Window tkwin, Tcl_Obj *stringPtr);
MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr,
TkTextIndex *indexPtr, int end, int *xOffset);
MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr,
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index a01c329..66766ea 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -24,7 +24,7 @@
#include "tkMacOSXInt.h"
#endif
-#define OK_TO_LOG (!TkpWillDrawWidget(textPtr->tkwin))
+#define OK_TO_LOG 1
/*
* "Calculations of line pixel heights and the size of the vertical
@@ -4649,7 +4649,7 @@ DisplayText(
doScrollbars:
if (textPtr->flags & UPDATE_SCROLLBARS) {
textPtr->flags &= ~UPDATE_SCROLLBARS;
- if (textPtr->yScrollCmd != NULL) {
+ if (textPtr->yScrollCmdObj != NULL) {
GetYView(textPtr->interp, textPtr, 1);
}
@@ -4665,7 +4665,7 @@ DisplayText(
* Update the horizontal scrollbar, if any.
*/
- if (textPtr->xScrollCmd != NULL) {
+ if (textPtr->xScrollCmdObj != NULL) {
GetXView(textPtr->interp, textPtr, 1);
}
}
@@ -6530,7 +6530,7 @@ GetXView(
}
dInfoPtr->xScrollFirst = first;
dInfoPtr->xScrollLast = last;
- if (textPtr->xScrollCmd != NULL) {
+ if (textPtr->xScrollCmdObj != NULL) {
char buf1[TCL_DOUBLE_SPACE+1];
char buf2[TCL_DOUBLE_SPACE+1];
Tcl_DString buf;
@@ -6540,7 +6540,7 @@ GetXView(
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
Tcl_DStringInit(&buf);
- Tcl_DStringAppend(&buf, textPtr->xScrollCmd, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, Tcl_GetString(textPtr->xScrollCmdObj), TCL_INDEX_NONE);
Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE);
Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE);
code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
@@ -6815,7 +6815,7 @@ GetYView(
dInfoPtr->yScrollFirst = first;
dInfoPtr->yScrollLast = last;
- if (textPtr->yScrollCmd != NULL) {
+ if (textPtr->yScrollCmdObj != NULL) {
char buf1[TCL_DOUBLE_SPACE+1];
char buf2[TCL_DOUBLE_SPACE+1];
Tcl_DString buf;
@@ -6825,7 +6825,7 @@ GetYView(
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
Tcl_DStringInit(&buf);
- Tcl_DStringAppend(&buf, textPtr->yScrollCmd, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, Tcl_GetString(textPtr->yScrollCmdObj), TCL_INDEX_NONE);
Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE);
Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE);
code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
@@ -7703,7 +7703,7 @@ TkTextCharLayoutProc(
if (bytesThatFit + 1 <= maxBytes) {
if ((bytesThatFit == 0) && noCharsYet) {
int ch;
- int chLen = TkUtfToUniChar(p, &ch);
+ int chLen = Tcl_UtfToUniChar(p, &ch);
#ifdef TK_LAYOUT_WITH_BASE_CHUNKS
bytesThatFit = CharChunkMeasureChars(chunkPtr, line,
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index d566d5c..4acad9d 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -48,14 +48,6 @@ static int IndexCountBytesOrdered(const TkText *textPtr,
const TkTextIndex *indexPtr1,
const TkTextIndex *indexPtr2);
-#if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION < 9)
-# undef Tcl_UtfPrev
-# define Tcl_UtfPrev (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \
- ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[656])) \
- : ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[331])))
-#endif
-
-
/*
* The "textindex" Tcl_Obj definition:
*/
@@ -451,7 +443,7 @@ TkTextMakeByteIndex(
start = segPtr->body.chars + (byteIndex - index);
p = Tcl_UtfPrev(start, segPtr->body.chars);
- p += TkUtfToUniChar(p, &ch);
+ p += Tcl_UtfToUniChar(p, &ch);
indexPtr->byteIndex += p - start;
}
break;
@@ -494,7 +486,7 @@ TkTextMakeCharIndex(
TkTextSegment *segPtr;
char *p, *start, *end;
int index, offset;
- int ch = 0;
+ Tcl_UniChar ch = 0;
indexPtr->tree = tree;
if (lineIndex < 0) {
@@ -541,7 +533,7 @@ TkTextMakeCharIndex(
return indexPtr;
}
charIndex--;
- offset = TkUtfToUniChar(p, &ch);
+ offset = Tcl_UtfToUniChar(p, &ch);
index += offset;
}
} else {
@@ -1129,7 +1121,7 @@ TkTextPrintIndex(
break;
}
if (segPtr->typePtr == &tkTextCharType) {
- charIndex += TkNumUtfChars(segPtr->body.chars, segPtr->size);
+ charIndex += Tcl_NumUtfChars(segPtr->body.chars, segPtr->size);
} else {
charIndex += segPtr->size;
}
@@ -1137,7 +1129,7 @@ TkTextPrintIndex(
}
if (segPtr->typePtr == &tkTextCharType) {
- charIndex += TkNumUtfChars(segPtr->body.chars, numBytes);
+ charIndex += Tcl_NumUtfChars(segPtr->body.chars, numBytes);
} else {
charIndex += numBytes;
}
@@ -1665,7 +1657,7 @@ TkTextIndexForwChars(
if (segPtr->typePtr == &tkTextCharType) {
start = segPtr->body.chars + byteOffset;
end = segPtr->body.chars + segPtr->size;
- for (p = start; p < end; p += TkUtfToUniChar(p, &ch)) {
+ for (p = start; p < end; p += Tcl_UtfToUniChar(p, &ch)) {
if (charCount == 0) {
dstPtr->byteIndex += (p - start);
goto forwardCharDone;
@@ -1948,7 +1940,7 @@ TkTextIndexCount(
}
count += byteLen - i;
if (i) {
- count += TkNumUtfChars(segPtr->body.chars + byteOffset
+ count += Tcl_NumUtfChars(segPtr->body.chars + byteOffset
+ (byteLen - i), i);
}
} else {
@@ -2210,6 +2202,9 @@ TkTextIndexBackChars(
if (p == start) {
break;
}
+ if ((sizeof(Tcl_UniChar) == 2) && (unsigned)(UCHAR(*p) - 0xF0) <= 5) {
+ charCount--; /* Characters > U+FFFF count as 2 here */
+ }
if (charCount != 0) {
charCount--;
}
@@ -2394,7 +2389,7 @@ StartEnd(
if (segPtr->typePtr == &tkTextCharType) {
int ch;
- chSize = TkUtfToUniChar(segPtr->body.chars + offset, &ch);
+ chSize = Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
@@ -2439,7 +2434,7 @@ StartEnd(
if (segPtr->typePtr == &tkTextCharType) {
int ch;
- TkUtfToUniChar(segPtr->body.chars + offset, &ch);
+ Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index db1dec1..2339ed0 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -301,7 +301,7 @@ TkTextSetMark(
if (markPtr == textPtr->insertMarkPtr) {
TkTextIndex index, index2;
- int nblines;
+ int nblines;
TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);
TkTextIndexForwChars(NULL, &index, 1, &index2, COUNT_INDICES);
@@ -313,12 +313,12 @@ TkTextSetMark(
TkTextChanged(NULL, textPtr, &index, &index2);
- /*
- * The number of lines in the widget is zero if and only if it is
- * a partial peer with -startline == -endline, i.e. an empty
- * peer. In this case the mark shall be set exactly at the given
- * index, and not one character backwards (bug 3487407).
- */
+ /*
+ * The number of lines in the widget is zero if and only if it is
+ * a partial peer with -startline == -endline, i.e. an empty
+ * peer. In this case the mark shall be set exactly at the given
+ * index, and not one character backwards (bug 3487407).
+ */
nblines = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr);
if ((TkBTreeLinesTo(textPtr, indexPtr->linePtr) == nblines)
@@ -436,7 +436,7 @@ TkTextMarkNameToIndex(
TkTextSegment *segPtr;
if (textPtr == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
if (!strcmp(name, "insert")) {
@@ -749,7 +749,7 @@ MarkCheckProc(
*/
if (markPtr->body.mark.textPtr->insertMarkPtr == markPtr) {
- return;
+ return;
}
if (markPtr->body.mark.textPtr->currentMarkPtr == markPtr) {
return;
@@ -933,16 +933,16 @@ MarkFindPrev(
seg2Ptr = seg2Ptr->nextPtr) {
if (seg2Ptr->typePtr == &tkTextRightMarkType ||
seg2Ptr->typePtr == &tkTextLeftMarkType) {
- if (seg2Ptr->body.mark.hPtr == NULL) {
- if (seg2Ptr != textPtr->currentMarkPtr &&
- seg2Ptr != textPtr->insertMarkPtr) {
- /*
- * This is an insert or current mark from a
- * peer of textPtr.
- */
- continue;
- }
- }
+ if (seg2Ptr->body.mark.hPtr == NULL) {
+ if (seg2Ptr != textPtr->currentMarkPtr &&
+ seg2Ptr != textPtr->insertMarkPtr) {
+ /*
+ * This is an insert or current mark from a
+ * peer of textPtr.
+ */
+ continue;
+ }
+ }
prevPtr = seg2Ptr;
}
}
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 4110e8f..a41caa4 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -16,228 +16,6 @@
#include "tkText.h"
#include "default.h"
-/* This struct can be used for booleans, relief and pixels */
-typedef struct {
- char *string;
- int value;
-} IntStruct;
-
-typedef struct {
- char *string;
- Tk_Justify value;
-} JustifyStruct;
-
-static int
-ObjectIsEmpty(
- Tcl_Obj *objPtr) /* Object to test. May be NULL. */
-{
- if (objPtr == NULL) {
- return 1;
- }
- if (objPtr->bytes == NULL) {
- Tcl_GetString(objPtr);
- }
- return (objPtr->length == 0);
-}
-
-#define OPTION_NONNEG (1 << 10)
-
-static int
-SetPixels(
- TCL_UNUSED(void *),
- Tcl_Interp *interp,
- Tk_Window tkwin,
- Tcl_Obj **value,
- char *recordPtr,
- Tcl_Size internalOffset,
- char *oldInternalPtr,
- int flags)
-{
- IntStruct pixel = {NULL, INT_MIN};
- IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset);
- int nullOK = (flags & TK_OPTION_NULL_OK);
-
- if (!nullOK || !ObjectIsEmpty(*value)) {
- if (Tk_GetPixelsFromObj(nullOK ? NULL : interp, tkwin, *value, &pixel.value) != TCL_OK) {
- if (nullOK) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "expected screen distance or \"\" but got \"%.50s\"", Tcl_GetString(*value)));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if ((flags & OPTION_NONNEG) && pixel.value < 0) {
- pixel.value = 0;
- }
- pixel.string = (char *)ckalloc((*value)->length + 1);
- strcpy(pixel.string, (*value)->bytes);
- }
-
- *((char **)oldInternalPtr) = NULL;
- *internalPtr = pixel;
- return TCL_OK;
-};
-
-static int
-SetBoolean(
- TCL_UNUSED(void *),
- Tcl_Interp *interp,
- TCL_UNUSED(Tk_Window),
- Tcl_Obj **value,
- char *recordPtr,
- Tcl_Size internalOffset,
- char *oldInternalPtr,
- int flags)
-{
- IntStruct booleanVal = {NULL, -1};
- IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset);
- int nullOK = (flags & TK_OPTION_NULL_OK);
-
- if (!nullOK || !ObjectIsEmpty(*value)) {
- if (Tcl_GetBooleanFromObj(nullOK ? NULL : interp, *value, &booleanVal.value) != TCL_OK) {
- if (nullOK) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "expected boolean value or \"\" but got \"%s\"", Tcl_GetString(*value)));
- }
- return TCL_ERROR;
- }
- booleanVal.string = (char *)ckalloc((*value)->length + 1);
- strcpy(booleanVal.string, (*value)->bytes);
- }
-
- *((char **)oldInternalPtr) = NULL;
- *internalPtr = booleanVal;
- return TCL_OK;
-};
-
-static int
-SetRelief(
- TCL_UNUSED(void *),
- Tcl_Interp *interp,
- TCL_UNUSED(Tk_Window),
- Tcl_Obj **value,
- char *recordPtr,
- Tcl_Size internalOffset,
- char *oldInternalPtr,
- int flags)
-{
- IntStruct relief = {NULL, TK_RELIEF_NULL};
- IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset);
- int nullOK = (flags & TK_OPTION_NULL_OK);
-
- if (!nullOK || !ObjectIsEmpty(*value)) {
- if (Tk_GetReliefFromObj(nullOK ? NULL : interp, *value, &relief.value) != TCL_OK) {
- if (nullOK) {
- Tcl_AppendResult(interp, "bad relief \"",
- Tcl_GetString(*value), "\": must be flat, groove, raised, ridge, solid, sunken, or \"\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- relief.string = (char *)ckalloc((*value)->length + 1);
- strcpy(relief.string, (*value)->bytes);
- }
-
- *((char **)oldInternalPtr) = NULL;
- *internalPtr = relief;
- return TCL_OK;
-};
-
-static int
-SetJustify(
- TCL_UNUSED(void *),
- Tcl_Interp *interp,
- TCL_UNUSED(Tk_Window),
- Tcl_Obj **value,
- char *recordPtr,
- Tcl_Size internalOffset,
- char *oldInternalPtr,
- int flags)
-{
- JustifyStruct justify = {NULL, TK_JUSTIFY_NULL};
- JustifyStruct *internalPtr = (JustifyStruct *)(recordPtr + internalOffset);
- int nullOK = (flags & TK_OPTION_NULL_OK);
-
- if (!nullOK || !ObjectIsEmpty(*value)) {
- if (Tk_GetJustifyFromObj(nullOK ? NULL : interp, *value, &justify.value) != TCL_OK) {
- if (nullOK) {
- Tcl_AppendResult(interp, "bad justification \"",
- Tcl_GetString(*value), "\": must be left, right, center, or \"\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- justify.string = (char *)ckalloc((*value)->length + 1);
- strcpy(justify.string, (*value)->bytes);
- }
-
- *((char **)oldInternalPtr) = NULL;
- *internalPtr = justify;
- return TCL_OK;
-};
-
-static Tcl_Obj *GetStruct(
- TCL_UNUSED(void *),
- TCL_UNUSED(Tk_Window),
- char *recordPtr,
- Tcl_Size internalOffset)
-{
- char **structPtr = (char **)(recordPtr + internalOffset);
-
- if (*structPtr == NULL || **structPtr == '\0') {
- return Tcl_NewObj();
- }
- return Tcl_NewStringObj(*structPtr, TCL_INDEX_NONE);
-};
-
-
-static void
-FreeStruct(
- TCL_UNUSED(void *),
- TCL_UNUSED(Tk_Window),
- char *internalPtr)
-{
- char **structPtr = (char **)internalPtr;
- if (*structPtr) {
- ckfree(*structPtr);
- *structPtr = NULL;
- }
-};
-
-static const Tk_ObjCustomOption pixelsOption = {
- "pixels", /* name */
- SetPixels, /* setProc */
- GetStruct, /* getProc */
- NULL, /* restoreProc */
- FreeStruct, /* freeProc */
- 0
-};
-
-static const Tk_ObjCustomOption booleanOption = {
- "boolean", /* name */
- SetBoolean, /* setProc */
- GetStruct, /* getProc */
- NULL, /* restoreProc */
- FreeStruct, /* freeProc */
- 0
-};
-
-static const Tk_ObjCustomOption justifyOption = {
- "justify", /* name */
- SetJustify, /* setProc */
- GetStruct, /* getProc */
- NULL, /* restoreProc */
- FreeStruct, /* freeProc */
- 0
-};
-
-static const Tk_ObjCustomOption reliefOption = {
- "relief", /* name */
- SetRelief, /* setProc */
- GetStruct, /* getProc */
- NULL, /* restoreProc */
- FreeStruct, /* freeProc */
- 0
-};
-
static const Tk_OptionSpec tagOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0},
@@ -246,55 +24,55 @@ static const Tk_OptionSpec tagOptionSpecs[] = {
{TK_OPTION_PIXELS, "-borderwidth", NULL, NULL,
NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_CUSTOM, "-elide", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elideString),
- TK_OPTION_NULL_OK, &booleanOption, 0},
+ {TK_OPTION_BOOLEAN, "-elide", NULL, NULL,
+ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elide),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BITMAP, "-fgstipple", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_FONT, "-font", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-foreground", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_CUSTOM, "-justify", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, &justifyOption,0},
- {TK_OPTION_CUSTOM, "-lmargin1", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,&pixelsOption,0},
- {TK_OPTION_CUSTOM, "-lmargin2", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,&pixelsOption,0},
+ {TK_OPTION_JUSTIFY, "-justify", NULL, NULL,
+ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justify), TK_OPTION_NULL_OK, 0,0},
+ {TK_OPTION_PIXELS, "-lmargin1", NULL, NULL,
+ NULL, offsetof(TkTextTag, lMargin1Obj), offsetof(TkTextTag, lMargin1), TK_OPTION_NULL_OK,0,0},
+ {TK_OPTION_PIXELS, "-lmargin2", NULL, NULL,
+ NULL, offsetof(TkTextTag, lMargin2Obj), offsetof(TkTextTag, lMargin2), TK_OPTION_NULL_OK,0,0},
{TK_OPTION_BORDER, "-lmargincolor", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_CUSTOM, "-offset", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, &pixelsOption, 0},
- {TK_OPTION_CUSTOM, "-overstrike", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeString),
- TK_OPTION_NULL_OK, &booleanOption, 0},
+ {TK_OPTION_PIXELS, "-offset", NULL, NULL,
+ NULL, offsetof(TkTextTag, offsetObj), offsetof(TkTextTag, offset), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_BOOLEAN, "-overstrike", NULL, NULL,
+ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrike),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-overstrikefg", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_CUSTOM, "-relief", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, &reliefOption, 0},
- {TK_OPTION_CUSTOM, "-rmargin", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, &pixelsOption,0},
+ {TK_OPTION_RELIEF, "-relief", NULL, NULL,
+ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, relief), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-rmargin", NULL, NULL,
+ NULL, offsetof(TkTextTag, rMarginObj), offsetof(TkTextTag, rMargin), TK_OPTION_NULL_OK, 0,0},
{TK_OPTION_BORDER, "-rmargincolor", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BORDER, "-selectbackground", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-selectforeground", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_CUSTOM, "-spacing1", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0},
- {TK_OPTION_CUSTOM, "-spacing2", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0},
- {TK_OPTION_CUSTOM, "-spacing3", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0},
+ {TK_OPTION_PIXELS, "-spacing1", NULL, NULL,
+ NULL, offsetof(TkTextTag, spacing1Obj), offsetof(TkTextTag, spacing1), TK_OPTION_NULL_OK,0,0},
+ {TK_OPTION_PIXELS, "-spacing2", NULL, NULL,
+ NULL, offsetof(TkTextTag, spacing2Obj), offsetof(TkTextTag, spacing2), TK_OPTION_NULL_OK,0,0},
+ {TK_OPTION_PIXELS, "-spacing3", NULL, NULL,
+ NULL, offsetof(TkTextTag, spacing3Obj), offsetof(TkTextTag, spacing3), TK_OPTION_NULL_OK,0,0},
{TK_OPTION_STRING, "-tabs", NULL, NULL,
NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle),
TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, 0},
- {TK_OPTION_CUSTOM, "-underline", NULL, NULL,
- NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineString),
- TK_OPTION_NULL_OK, &booleanOption, 0},
+ {TK_OPTION_BOOLEAN, "-underline", NULL, NULL,
+ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underline),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-underlinefg", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor),
TK_OPTION_NULL_OK, 0, 0},
@@ -392,12 +170,12 @@ TkTextTagCmd(
*/
textPtr->sharedTextPtr->stateEpoch++;
}
- for (i = 4; i < objc; i += 2) {
+ for (i = 4; i < (Tcl_Size)objc; i += 2) {
if (TkTextGetObjIndex(interp, textPtr, objv[i],
&index1) != TCL_OK) {
return TCL_ERROR;
}
- if (objc > (i+1)) {
+ if ((Tcl_Size)objc > (i+1)) {
if (TkTextGetObjIndex(interp, textPtr, objv[i+1],
&index2) != TCL_OK) {
return TCL_ERROR;
@@ -503,7 +281,7 @@ TkTextTagCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"requested illegal events; only key, button, motion,"
" enter, leave, and virtual events may be used", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT",NULL);
return TCL_ERROR;
}
} else if (objc == 5) {
@@ -588,13 +366,28 @@ TkTextTagCmd(
if (tagPtr->borderWidth < 0) {
tagPtr->borderWidth = 0;
}
+ if (tagPtr->spacing1 != INT_MIN) {
+ if (tagPtr->spacing1 < 0) {
+ tagPtr->spacing1 = 0;
+ }
+ }
+ if (tagPtr->spacing2 != INT_MIN) {
+ if (tagPtr->spacing2 < 0) {
+ tagPtr->spacing2 = 0;
+ }
+ }
+ if (tagPtr->spacing3 != INT_MIN) {
+ if (tagPtr->spacing3 < 0) {
+ tagPtr->spacing3 = 0;
+ }
+ }
if (tagPtr->tabArrayPtr != NULL) {
ckfree(tagPtr->tabArrayPtr);
tagPtr->tabArrayPtr = NULL;
}
if (tagPtr->tabStringPtr != NULL) {
tagPtr->tabArrayPtr =
- TkTextGetTabs(interp, textPtr, tagPtr->tabStringPtr);
+ TkTextGetTabs(interp, textPtr->tkwin, tagPtr->tabStringPtr);
if (tagPtr->tabArrayPtr == NULL) {
return TCL_ERROR;
}
@@ -694,7 +487,7 @@ TkTextTagCmd(
Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?");
return TCL_ERROR;
}
- for (i = 3; i < objc; i++) {
+ for (i = 3; i < (Tcl_Size)objc; i++) {
hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable,
Tcl_GetString(objv[i]));
if (hPtr == NULL) {
@@ -798,7 +591,7 @@ TkTextTagCmd(
for (i = 0; i < arraySize; i++) {
tagPtr = arrayPtr[i];
Tcl_ListObjAppendElement(interp, listObj,
- Tcl_NewStringObj(tagPtr->name, TCL_INDEX_NONE));
+ Tcl_NewStringObj(tagPtr->name,-1));
}
Tcl_SetObjResult(interp, listObj);
ckfree(arrayPtr);
@@ -1150,42 +943,37 @@ TkTextCreateTag(
tagPtr->border = NULL;
tagPtr->borderWidth = 0;
tagPtr->borderWidthPtr = NULL;
- tagPtr->reliefString = NULL;
tagPtr->relief = TK_RELIEF_NULL;
tagPtr->bgStipple = None;
tagPtr->fgColor = NULL;
tagPtr->tkfont = NULL;
tagPtr->fgStipple = None;
- tagPtr->justifyString = NULL;
tagPtr->justify = TK_JUSTIFY_NULL;
- tagPtr->lMargin1String = NULL;
+ tagPtr->lMargin1Obj = NULL;
tagPtr->lMargin1 = INT_MIN;
- tagPtr->lMargin2String = NULL;
+ tagPtr->lMargin2Obj = NULL;
tagPtr->lMargin2 = INT_MIN;
tagPtr->lMarginColor = NULL;
- tagPtr->offsetString = NULL;
+ tagPtr->offsetObj = NULL;
tagPtr->offset = INT_MIN;
- tagPtr->overstrikeString = NULL;
tagPtr->overstrike = -1;
tagPtr->overstrikeColor = NULL;
- tagPtr->rMarginString = NULL;
+ tagPtr->rMarginObj = NULL;
tagPtr->rMargin = INT_MIN;
tagPtr->rMarginColor = NULL;
tagPtr->selBorder = NULL;
tagPtr->selFgColor = NULL;
- tagPtr->spacing1String = NULL;
+ tagPtr->spacing1Obj = NULL;
tagPtr->spacing1 = INT_MIN;
- tagPtr->spacing2String = NULL;
+ tagPtr->spacing2Obj = NULL;
tagPtr->spacing2 = INT_MIN;
- tagPtr->spacing3String = NULL;
+ tagPtr->spacing3Obj = NULL;
tagPtr->spacing3 = INT_MIN;
tagPtr->tabStringPtr = NULL;
tagPtr->tabArrayPtr = NULL;
tagPtr->tabStyle = TK_TEXT_TABSTYLE_NULL;
- tagPtr->underlineString = NULL;
tagPtr->underline = -1;
tagPtr->underlineColor = NULL;
- tagPtr->elideString = NULL;
tagPtr->elide = -1;
tagPtr->wrapMode = TEXT_WRAPMODE_NULL;
tagPtr->affectsDisplay = 0;
@@ -1247,7 +1035,7 @@ FindTag(
"tag \"%s\" isn't defined in text widget",
Tcl_GetString(tagName)));
Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG",
- Tcl_GetString(tagName), (char *)NULL);
+ Tcl_GetString(tagName), NULL);
}
return NULL;
}
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index 60daffe..3c99a4b 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1246,78 +1246,6 @@ Tk_SendVirtualEvent(
Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL);
}
-#if TCL_MAJOR_VERSION < 9
-/*
- *---------------------------------------------------------------------------
- *
- * TkUtfToUniChar --
- *
- * Almost the same as Tcl_UtfToUniChar but using int instead of Tcl_UniChar.
- * This function is capable of collapsing a upper/lower surrogate pair to a
- * single unicode character. So, up to 6 bytes might be consumed.
- *
- * Results:
- * *chPtr is filled with the Tcl_UniChar, and the return value is the
- * number of bytes from the UTF-8 string that were consumed.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Size
-TkUtfToUniChar(
- const char *src, /* The UTF-8 string. */
- int *chPtr) /* Filled with the Unicode value represented by
- * the UTF-8 string. */
-{
- Tcl_UniChar uniChar = 0;
-
- Tcl_Size len = Tcl_UtfToUniChar(src, &uniChar);
- if ((uniChar & 0xFC00) == 0xD800) {
- Tcl_UniChar low = uniChar;
- /* This can only happen if src points to a character > U+FFFF */
- Tcl_Size len2 = Tcl_UtfToUniChar(src+len, &low);
- if ((low & 0xFC00) == 0xDC00) {
- *chPtr = (((uniChar & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
- return len + len2;
- }
- }
- *chPtr = uniChar;
- return len;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkUniCharToUtf --
- *
- * Almost the same as Tcl_UniCharToUtf but producing 2 x 3-byte UTF-8
- * sequences for out-of-bmp characters when TCL_UTF_MAX==3.
- * So, up to 6 bytes might be produced.
- *
- * Results:
- * *buf is filled with the UTF-8 string, and the return value is the
- * number of bytes produced.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Size TkUniCharToUtf(int ch, char *buf)
-{
- if ((unsigned)(ch - 0x10000) <= 0xFFFFF) {
- /* Spit out a 4-byte UTF-8 character (Tcl 8.7+) or
- * 2 x 3-byte UTF-8 characters (Tcl 8.6) */
- Tcl_Size len = Tcl_UniCharToUtf(0xD800 | ((ch - 0x10000) >> 10), buf);
- return len + Tcl_UniCharToUtf(0xDC00 | (ch & 0x7FF), buf + len);
- }
- return Tcl_UniCharToUtf(ch, buf);
-}
-#endif
/*
* Local Variables:
* mode: c
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index ee0e1b8..9d36e9f 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -215,6 +215,17 @@ static int Initialize(Tcl_Interp *interp);
static int NameWindow(Tcl_Interp *interp, TkWindow *winPtr,
TkWindow *parentPtr, const char *name);
static void UnlinkWindow(TkWindow *winPtr);
+
+/*
+ * This static variable only makes sense for macOS and Windows, which never
+ * have more than one display. It is set by TkCloseDisplay, and when set
+ * prevents sending Enter and Leave events when all of the windows in the
+ * display are being destroyed. Tk does not send those events on X11; that
+ * job is handled by the X server.
+ */
+
+static int displayBeingClosed = 0;
+
/*
*----------------------------------------------------------------------
@@ -239,6 +250,7 @@ static void
TkCloseDisplay(
TkDisplay *dispPtr)
{
+ displayBeingClosed = 1;
TkClipCleanup(dispPtr);
if (dispPtr->name != NULL) {
@@ -888,7 +900,7 @@ TkCreateMainWindow(
#if TCL_MAJOR_VERSION > 8
mainPtr->tclUpdateObjProc2 = NULL;
#endif
- if (Tcl_LinkVar(interp, "tk_strictMotif", (char *)&mainPtr->strictMotif,
+ if (Tcl_LinkVar(interp, "tk_strictMotif", &mainPtr->strictMotif,
TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
@@ -896,7 +908,7 @@ TkCreateMainWindow(
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::AlwaysShowSelection",
- (char *)&mainPtr->alwaysShowSelection,
+ &mainPtr->alwaysShowSelection,
TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
@@ -1334,6 +1346,39 @@ Tk_CreateWindowFromPath(
*--------------------------------------------------------------
*/
+#if defined(MAC_OSX_TK) || defined(_WIN32)
+static void SendEnterLeaveForDestroy(
+ Tk_Window tkwin)
+{
+ int x, y;
+ unsigned int state;
+ Tk_Window pointerWin;
+ TkWindow *containerPtr;
+
+ if (displayBeingClosed) {
+ return;
+ }
+ XQueryPointer(Tk_Display(tkwin), None, NULL, NULL, &x, &y,
+ NULL, NULL, &state);
+ pointerWin = Tk_CoordsToWindow(x, y, tkwin);
+ if (pointerWin == tkwin) {
+ if (!Tk_IsTopLevel(tkwin)) {
+ containerPtr = TkGetContainer((TkWindow *)pointerWin);
+ Tk_UpdatePointer((Tk_Window) containerPtr, x, y, state);
+ }
+ }
+
+ if (pointerWin && (tkwin == Tk_Parent(pointerWin))) {
+ Tk_UpdatePointer(Tk_Parent(tkwin), x, y, state);
+ }
+}
+#else
+static void SendEnterLeaveForDestroy(
+ TCL_UNUSED(Tk_Window))
+{
+}
+#endif
+
void
Tk_DestroyWindow(
Tk_Window tkwin) /* Window to destroy. */
@@ -1353,6 +1398,10 @@ Tk_DestroyWindow(
return;
}
+ if ((winPtr->flags & TK_DONT_DESTROY_WINDOW) == 0) {
+ SendEnterLeaveForDestroy(tkwin);
+ }
+
winPtr->flags |= TK_ALREADY_DEAD;
/*
@@ -1523,7 +1572,7 @@ Tk_DestroyWindow(
* Cleanup the data structures associated with this window.
*/
- if (winPtr->flags & TK_WIN_MANAGED) {
+ if (winPtr->wmInfoPtr && (winPtr->flags & TK_WIN_MANAGED)) {
TkWmDeadWindow(winPtr);
} else if (winPtr->flags & TK_WM_COLORMAP_WINDOW) {
TkWmRemoveFromColormapWindows(winPtr);
@@ -2612,7 +2661,7 @@ Tk_RestackWindow(
TkWindow *otherPtr = (TkWindow *) other;
/*
- * Special case: if winPtr is a top-level window then just find the
+ * Special case: if winPtr is a toplevel window then just find the
* top-level ancestor of otherPtr and restack winPtr above otherPtr
* without changing any of Tk's childLists.
*/
@@ -2948,9 +2997,9 @@ DeleteWindowsExitProc(
static HMODULE tkcygwindll = NULL;
/*
- * Run Tk_MainEx from libtk8.?.dll
+ * Run Tk_MainEx from libtcl9tk9.?.dll
*
- * This function is only ever called from wish8.?.exe, the cygwin port of Tcl.
+ * This function is only ever called from wish9.?.exe, the cygwin port of Tcl.
* This means that the system encoding is utf-8, so we don't have to do any
* encoding conversions.
*/
@@ -2969,15 +3018,15 @@ TkCygwinMainEx(
size_t len;
void (*tkmainex)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *);
- /* construct "<path>/libtk8.?.dll", from "<path>/tk8?.dll" */
+ /* construct "<path>/libtcl9tk9.?.dll", from "<path>/tcl9tk9?.dll" */
len = GetModuleFileNameW((HINSTANCE)Tk_GetHINSTANCE(), name, MAX_PATH);
name[len-2] = '.';
name[len-1] = name[len-5];
wcscpy(name+len, L".dll");
#if TCL_MAJOR_VERSION > 8
- memcpy(name+len-12, L"libtcl9tk8", 10 * sizeof(WCHAR));
+ memcpy(name+len-12, L"libtcl9tk9", 10 * sizeof(WCHAR));
#else
- memcpy(name+len-8, L"libtk8", 6 * sizeof(WCHAR));
+ memcpy(name+len-8, L"libtk9", 6 * sizeof(WCHAR));
#endif
tkcygwindll = LoadLibraryW(name);
@@ -3177,7 +3226,7 @@ Initialize(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return TCL_ERROR;
}
@@ -3377,7 +3426,14 @@ Initialize(
visualObj = NULL;
}
- code = TkListCreateFrame(NULL, interp, cmd, 1, nameObj);
+ Tcl_Size objc;
+ Tcl_Obj **objv;
+
+ if (TCL_OK != Tcl_ListObjGetElements(interp, cmd, &objc, &objv)) {
+ return TCL_ERROR;
+ }
+ code = TkCreateFrame(NULL, interp, objc, objv,
+ 1, nameObj ? Tcl_GetString(nameObj) : NULL);
Tcl_DecrRefCount(cmd);
diff --git a/generic/ttk/ttk.decls b/generic/ttk/ttk.decls
index 1c98b23..7826c99 100644
--- a/generic/ttk/ttk.decls
+++ b/generic/ttk/ttk.decls
@@ -143,8 +143,8 @@ declare 35 {
#
# Utilities.
#
-declare 40 {deprecated {}} {
- int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient)
+declare 40 {
+ int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient)
}
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c
index d13462d..b1c897e 100644
--- a/generic/ttk/ttkClamTheme.c
+++ b/generic/ttk/ttkClamTheme.c
@@ -549,7 +549,7 @@ static const Ttk_ElementSpec IndicatorElementSpec = {
typedef struct {
Tcl_Obj *lightColorObj;
Tcl_Obj *borderColorObj;
- Tcl_Obj *gripCountObj;
+ Tcl_Obj *gripSizeObj;
} GripElement;
static const Ttk_ElementOptionSpec GripElementOptions[] = {
@@ -557,8 +557,8 @@ static const Ttk_ElementOptionSpec GripElementOptions[] = {
offsetof(GripElement,lightColorObj), LIGHT_COLOR },
{ "-bordercolor", TK_OPTION_COLOR,
offsetof(GripElement,borderColorObj), DARKEST_COLOR },
- { "-gripcount", TK_OPTION_PIXELS,
- offsetof(GripElement,gripCountObj), "5" },
+ { "-gripsize", TK_OPTION_PIXELS,
+ offsetof(GripElement,gripSizeObj), "7.5p" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
@@ -571,8 +571,7 @@ static void GripElementSize(
GripElement *grip = (GripElement *)elementRecord;
int gripSize = 0;
- Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize);
- gripSize *= 2;
+ Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize);
if (orient == TTK_ORIENT_HORIZONTAL) {
*widthPtr = gripSize;
} else {
@@ -593,8 +592,7 @@ static void GripElementDraw(
int gripPad = 1, gripSize = 0;
int i;
- Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize);
- gripSize *= 2;
+ Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize);
if (orient == TTK_ORIENT_HORIZONTAL) {
int x = b.x + (b.width - gripSize) / 2;
@@ -637,7 +635,7 @@ typedef struct { /* Common element record for scrollbar elements */
Tcl_Obj *darkColorObj;
Tcl_Obj *arrowColorObj;
Tcl_Obj *arrowSizeObj;
- Tcl_Obj *gripCountObj;
+ Tcl_Obj *gripSizeObj;
Tcl_Obj *sliderlengthObj;
} ScrollbarElement;
@@ -658,8 +656,8 @@ static const Ttk_ElementOptionSpec ScrollbarElementOptions[] = {
offsetof(ScrollbarElement,arrowColorObj), "#000000" },
{ "-arrowsize", TK_OPTION_PIXELS,
offsetof(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) },
- { "-gripcount", TK_OPTION_PIXELS,
- offsetof(ScrollbarElement,gripCountObj), "5" },
+ { "-gripsize", TK_OPTION_PIXELS,
+ offsetof(ScrollbarElement,gripSizeObj), "7.5p" },
{ "-sliderlength", TK_OPTION_PIXELS,
offsetof(ScrollbarElement,sliderlengthObj), "30" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -728,9 +726,8 @@ static void ThumbElementDraw(
/*
* Draw grip:
*/
- TtkGetOrientFromObj(NULL, sb->orientObj, &orient);
- Tk_GetPixelsFromObj(NULL, tkwin, sb->gripCountObj, &gripSize);
- gripSize *= 2;
+ Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient);
+ Tk_GetPixelsFromObj(NULL, tkwin, sb->gripSizeObj, &gripSize);
lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d);
darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d);
@@ -777,7 +774,7 @@ static void SliderElementSize(
Ttk_Orient orient;
length = thickness = SCROLLBAR_THICKNESS;
- TtkGetOrientFromObj(NULL, sb->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient);
Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness);
Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length);
if (orient == TTK_ORIENT_VERTICAL) {
diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c
index c129b0f..b64eb2e 100644
--- a/generic/ttk/ttkClassicTheme.c
+++ b/generic/ttk/ttkClassicTheme.c
@@ -172,15 +172,15 @@ static void ButtonBorderElementDraw(
inset += round(5 * TkScalingLevel(tkwin));
break;
case TTK_BUTTON_DEFAULT_ACTIVE :
- Tk_Draw3DRectangle(tkwin, d, border,
+ Tk_Draw3DRectangle(tkwin, d, border,
b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset,
2, TK_RELIEF_FLAT);
- inset += 2;
- Tk_Draw3DRectangle(tkwin, d, border,
+ inset += 2;
+ Tk_Draw3DRectangle(tkwin, d, border,
b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset,
1, TK_RELIEF_SUNKEN);
++inset;
- Tk_Draw3DRectangle(tkwin, d, border,
+ Tk_Draw3DRectangle(tkwin, d, border,
b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset,
2, TK_RELIEF_FLAT);
inset += 2;
@@ -234,7 +234,7 @@ static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
offsetof(IndicatorElement,colorObj), DEFAULT_BACKGROUND },
{ "-indicatorrelief", TK_OPTION_RELIEF,
offsetof(IndicatorElement,reliefObj), "raised" },
- { "-indicatordiameter", TK_OPTION_PIXELS,
+ { "-indicatorsize", TK_OPTION_PIXELS,
offsetof(IndicatorElement,sizeObj), "9p" },
{ "-indicatormargin", TK_OPTION_STRING,
offsetof(IndicatorElement,marginObj), "0 2 4 2" },
@@ -594,7 +594,7 @@ static void SliderElementSize(
Ttk_Orient orient;
int length, thickness;
- TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
Tk_GetPixelsFromObj(NULL, tkwin, slider->lengthObj, &length);
Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness);
@@ -627,7 +627,7 @@ static void SliderElementDraw(
border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj);
Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief);
Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth);
- TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
Tk_Fill3DRectangle(tkwin, d, border,
b.x, b.y, b.width, b.height,
@@ -805,37 +805,37 @@ TTK_BEGIN_LAYOUT_TABLE(LayoutTable)
TTK_LAYOUT("TButton",
TTK_GROUP("Button.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Button.border", TTK_FILL_BOTH|TTK_BORDER,
+ TTK_GROUP("Button.border", TTK_FILL_BOTH|TTK_BORDER,
TTK_GROUP("Button.padding", TTK_FILL_BOTH,
- TTK_NODE("Button.label", TTK_FILL_BOTH)))))
+ TTK_NODE("Button.label", TTK_FILL_BOTH)))))
TTK_LAYOUT("TCheckbutton",
TTK_GROUP("Checkbutton.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Checkbutton.border", TTK_FILL_BOTH,
+ TTK_GROUP("Checkbutton.border", TTK_FILL_BOTH,
TTK_GROUP("Checkbutton.padding", TTK_FILL_BOTH,
- TTK_NODE("Checkbutton.indicator", TTK_PACK_LEFT)
- TTK_NODE("Checkbutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH)))))
+ TTK_NODE("Checkbutton.indicator", TTK_PACK_LEFT)
+ TTK_NODE("Checkbutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH)))))
TTK_LAYOUT("TRadiobutton",
TTK_GROUP("Radiobutton.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Radiobutton.border", TTK_FILL_BOTH,
+ TTK_GROUP("Radiobutton.border", TTK_FILL_BOTH,
TTK_GROUP("Radiobutton.padding", TTK_FILL_BOTH,
- TTK_NODE("Radiobutton.indicator", TTK_PACK_LEFT)
- TTK_NODE("Radiobutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH)))))
+ TTK_NODE("Radiobutton.indicator", TTK_PACK_LEFT)
+ TTK_NODE("Radiobutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH)))))
TTK_LAYOUT("TMenubutton",
TTK_GROUP("Menubutton.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Menubutton.border", TTK_FILL_BOTH,
+ TTK_GROUP("Menubutton.border", TTK_FILL_BOTH,
TTK_NODE("Menubutton.indicator", TTK_PACK_RIGHT)
TTK_GROUP("Menubutton.padding", TTK_FILL_X,
- TTK_NODE("Menubutton.label", 0)))))
+ TTK_NODE("Menubutton.label", 0)))))
/* "classic" entry, includes highlight border */
TTK_LAYOUT("TEntry",
TTK_GROUP("Entry.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER,
+ TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER,
TTK_GROUP("Entry.padding", TTK_FILL_BOTH,
- TTK_NODE("Entry.textarea", TTK_FILL_BOTH)))))
+ TTK_NODE("Entry.textarea", TTK_FILL_BOTH)))))
/* "classic" combobox, includes highlight border */
TTK_LAYOUT("TCombobox",
@@ -848,7 +848,7 @@ TTK_LAYOUT("TCombobox",
/* "classic" spinbox, includes highlight border */
TTK_LAYOUT("TSpinbox",
TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH,
- TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X,
+ TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X,
TTK_GROUP("null", TTK_PACK_RIGHT,
TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E)
TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E))
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index 2b074ac..9c40904 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -13,11 +13,7 @@ extern const char *TtkInitializeStubs(
interp, TTK_VERSION, TTK_STUBS_EPOCH, TTK_STUBS_REVISION)
#else
-#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
-# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "Ttk", TTK_VERSION, 0, NULL)
-#else
-# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL)
-#endif
+#define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL)
#endif
@@ -143,9 +139,8 @@ TTKAPI Tcl_Obj * Ttk_NewBoxObj(Ttk_Box box);
/* Slot 38 is reserved */
/* Slot 39 is reserved */
/* 40 */
-TTK_DEPRECATED("")
-int Ttk_GetOrientFromObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr, int *orient);
+TTKAPI int Ttk_GetOrientFromObj(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, Ttk_Orient *orient);
typedef struct TtkStubs {
int magic;
@@ -193,7 +188,7 @@ typedef struct TtkStubs {
void (*reserved37)(void);
void (*reserved38)(void);
void (*reserved39)(void);
- TCL_DEPRECATED_API("") int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); /* 40 */
+ int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient); /* 40 */
} TtkStubs;
extern const TtkStubs *ttkStubsPtr;
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 8182c27..4c2fcd3 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -1063,7 +1063,7 @@ static void ThumbElementSize(
int size;
Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size);
- TtkGetOrientFromObj(NULL, thumb->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient);
if (orient == TTK_ORIENT_VERTICAL) {
*widthPtr = size;
@@ -1158,7 +1158,7 @@ static void SliderElementSize(
Ttk_Orient orient;
int thickness, borderWidth;
- TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness);
Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth);
@@ -1217,7 +1217,7 @@ typedef struct {
static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
{ "-foreground", TK_OPTION_COLOR,
offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
- { "-diameter", TK_OPTION_PIXELS,
+ { "-size", TK_OPTION_PIXELS,
offsetof(TreeitemIndicator,sizeObj), "6.75p" },
{ "-indicatormargins", TK_OPTION_STRING,
offsetof(TreeitemIndicator,marginObj), "2 2 4 2" },
@@ -1233,13 +1233,13 @@ static void TreeitemIndicatorSize(
TCL_UNUSED(Ttk_Padding *))
{
TreeitemIndicator *indicator = (TreeitemIndicator *)elementRecord;
- int diameter = 0;
+ int size = 0;
Ttk_Padding margins;
- Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &diameter);
+ Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size);
Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins);
- *widthPtr = diameter + Ttk_PaddingWidth(margins);
- *heightPtr = diameter + Ttk_PaddingHeight(margins);
+ *widthPtr = size + Ttk_PaddingWidth(margins);
+ *heightPtr = size + Ttk_PaddingHeight(margins);
}
static void TreeitemIndicatorDraw(
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index 7f46d6d..ad856e3 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -85,7 +85,7 @@ static void FillElementDraw(
TCL_UNUSED(Ttk_State))
{
BackgroundElement *bg = (BackgroundElement *)elementRecord;
- Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin, bg->backgroundObj);
+ Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin,bg->backgroundObj);
XFillRectangle(Tk_Display(tkwin), d,
Tk_3DBorderGC(tkwin, backgroundPtr, TK_3D_FLAT_GC),
@@ -340,7 +340,7 @@ static void PaddingElementSize(
Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief);
Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief);
- Ttk_GetPaddingFromObj(NULL, tkwin, padding->paddingObj, &pad);
+ Ttk_GetPaddingFromObj(NULL,tkwin,padding->paddingObj,&pad);
*paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief);
}
@@ -393,11 +393,11 @@ static void DrawFocusRing(
}
static const Ttk_ElementOptionSpec FocusElementOptions[] = {
- { "-focuscolor", TK_OPTION_COLOR,
+ { "-focuscolor",TK_OPTION_COLOR,
offsetof(FocusElement,focusColorObj), "black" },
- { "-focusthickness", TK_OPTION_PIXELS,
+ { "-focusthickness",TK_OPTION_PIXELS,
offsetof(FocusElement,focusThicknessObj), "1" },
- { "-focussolid", TK_OPTION_BOOLEAN,
+ { "-focussolid",TK_OPTION_BOOLEAN,
offsetof(FocusElement,focusSolidObj), "0" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
@@ -517,7 +517,7 @@ static void GeneralSeparatorElementDraw(
SeparatorElement *separator = (SeparatorElement *)elementRecord;
Ttk_Orient orient;
- TtkGetOrientFromObj(NULL, separator->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, separator->orientObj, &orient);
switch (orient) {
case TTK_ORIENT_HORIZONTAL:
HorizontalSeparatorElementDraw(
@@ -568,7 +568,7 @@ static const Ttk_ElementOptionSpec SizegripOptions[] = {
offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND },
{ "-gripsize", TK_OPTION_PIXELS,
offsetof(SizegripElement,gripSizeObj), "11.25p" },
- {0, TK_OPTION_BOOLEAN, 0, 0}
+ {0,TK_OPTION_BOOLEAN,0,0}
};
static void SizegripSize(
@@ -608,9 +608,9 @@ static void SizegripDraw(
while (gripCount--) {
x1 -= gripSpace; y2 -= gripSpace;
for (int i = 1; i < gripThickness; i++) {
- XDrawLine(Tk_Display(tkwin), d, darkGC, x1,y1, x2,y2); --x1; --y2;
+ XDrawLine(Tk_Display(tkwin), d, darkGC, x1,y1, x2,y2); --x1; --y2;
}
- XDrawLine(Tk_Display(tkwin), d, lightGC, x1,y1, x2,y2); --x1; --y2;
+ XDrawLine(Tk_Display(tkwin), d, lightGC, x1,y1, x2,y2); --x1; --y2;
}
}
@@ -920,7 +920,7 @@ static const Ttk_ElementOptionSpec ArrowElementOptions[] = {
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
-static const Ttk_Padding ArrowPadding = { 3, 3, 3, 3 };
+static const Ttk_Padding ArrowPadding = { 3,3,3,3 };
static void ArrowElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
@@ -1227,7 +1227,7 @@ static void TroughElementDraw(
Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth);
Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth);
Tk_GetReliefFromObj(NULL, troughPtr->reliefObj, &relief);
- TtkGetOrientFromObj(NULL, troughPtr->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, troughPtr->orientObj, &orient);
if (grooveWidth > 0 && grooveWidth < b.height && grooveWidth < b.width) {
if (orient == TTK_ORIENT_HORIZONTAL) {
@@ -1301,7 +1301,7 @@ static void ThumbElementSize(
int thickness;
Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness);
- TtkGetOrientFromObj(NULL, thumb->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient);
if (orient == TTK_ORIENT_VERTICAL) {
*widthPtr = thickness;
@@ -1432,7 +1432,7 @@ static void SliderElementDraw(
* slider's center with the inner color
*/
if (mainInfoPtr != NULL) {
- TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
switch (orient) {
case TTK_ORIENT_HORIZONTAL:
XFillRectangle(disp, d, gc,
@@ -1571,7 +1571,7 @@ static void PbarElementSize(
Ttk_Orient orient;
int thickness = 15, length = 30, borderWidth = 2;
- TtkGetOrientFromObj(NULL, pbar->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orient);
Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness);
Tk_GetPixelsFromObj(NULL, tkwin, pbar->lengthObj, &length);
Tk_GetPixelsFromObj(NULL, tkwin, pbar->borderWidthObj, &borderWidth);
@@ -1634,7 +1634,7 @@ static const Ttk_ElementOptionSpec TabElementOptions[] = {
offsetof(TabElement,highlightObj), "0" },
{ "-highlightcolor", TK_OPTION_COLOR,
offsetof(TabElement,highlightColorObj), "#4a6984" },
- {0, TK_OPTION_BOOLEAN, 0, 0}
+ {0,TK_OPTION_BOOLEAN,0,0}
};
static void TabElementSize(
@@ -1869,7 +1869,7 @@ static void ClientElementDraw(
Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth);
Tk_Fill3DRectangle(tkwin, d, border,
- b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED);
+ b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_RAISED);
}
static const Ttk_ElementSpec ClientElementSpec = {
@@ -1894,7 +1894,7 @@ TtkElements_Init(Tcl_Interp *interp)
* Elements:
*/
Ttk_RegisterElement(interp, theme, "background",
- &BackgroundElementSpec, NULL);
+ &BackgroundElementSpec,NULL);
Ttk_RegisterElement(interp, theme, "fill", &FillElementSpec, NULL);
Ttk_RegisterElement(interp, theme, "border", &BorderElementSpec, NULL);
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 3620a9a..8c023d4 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -300,8 +300,8 @@ static char *EntryDisplayString(const char *showChar, int numChars)
int ch;
char buf[6];
- TkUtfToUniChar(showChar, &ch);
- size = TkUniCharToUtf(ch, buf);
+ Tcl_UtfToUniChar(showChar, &ch);
+ size = Tcl_UniCharToUtf(ch, buf);
p = displayString = (char *)ckalloc(numChars * size + 1);
while (numChars--) {
@@ -369,8 +369,8 @@ EntryFetchSelection(
}
string = entryPtr->entry.displayString;
- selStart = TkUtfAtIndex(string, entryPtr->entry.selectFirst);
- selEnd = TkUtfAtIndex(selStart,
+ selStart = Tcl_UtfAtIndex(string, entryPtr->entry.selectFirst);
+ selEnd = Tcl_UtfAtIndex(selStart,
entryPtr->entry.selectLast - entryPtr->entry.selectFirst);
if (selEnd <= selStart + offset) {
return 0;
@@ -458,7 +458,7 @@ ExpandPercents(
*/
++templ; /* skip over % */
if (*templ != '\0') {
- templ += TkUtfToUniChar(templ, &ch);
+ templ += Tcl_UtfToUniChar(templ, &ch);
} else {
ch = '%';
}
@@ -488,11 +488,11 @@ ExpandPercents(
break;
case 'S': /* string to be inserted/deleted, if any */
if (reason == VALIDATE_INSERT) {
- string = TkUtfAtIndex(newValue, index);
- stringLength = TkUtfAtIndex(string, count) - string;
+ string = Tcl_UtfAtIndex(newValue, index);
+ stringLength = Tcl_UtfAtIndex(string, count) - string;
} else if (reason == VALIDATE_DELETE) {
- string = TkUtfAtIndex(entryPtr->entry.string, index);
- stringLength = TkUtfAtIndex(string, count) - string;
+ string = Tcl_UtfAtIndex(entryPtr->entry.string, index);
+ stringLength = Tcl_UtfAtIndex(string, count) - string;
} else {
string = "";
stringLength = 0;
@@ -508,7 +508,7 @@ ExpandPercents(
string = Tk_PathName(entryPtr->core.tkwin);
break;
default:
- length = TkUniCharToUtf(ch, numStorage);
+ length = Tcl_UniCharToUtf(ch, numStorage);
numStorage[length] = '\0';
string = numStorage;
break;
@@ -740,7 +740,7 @@ static void
EntryStoreValue(Entry *entryPtr, const char *value)
{
size_t numBytes = strlen(value);
- Tcl_Size numChars = TkNumUtfChars(value, numBytes);
+ Tcl_Size numChars = Tcl_NumUtfChars(value, numBytes);
if (entryPtr->core.flags & VALIDATING)
entryPtr->core.flags |= VALIDATION_SET_VALUE;
@@ -845,9 +845,9 @@ InsertChars(
const char *value) /* New characters to add */
{
char *string = entryPtr->entry.string;
- size_t byteIndex = TkUtfAtIndex(string, index) - string;
+ size_t byteIndex = Tcl_UtfAtIndex(string, index) - string;
size_t byteCount = strlen(value);
- int charsAdded = TkNumUtfChars(value, byteCount);
+ int charsAdded = Tcl_NumUtfChars(value, byteCount);
size_t newByteCount = entryPtr->entry.numBytes + byteCount + 1;
char *newBytes;
int code;
@@ -899,8 +899,8 @@ DeleteChars(
return TCL_OK;
}
- byteIndex = TkUtfAtIndex(string, index) - string;
- byteCount = TkUtfAtIndex(string+byteIndex, count) - (string+byteIndex);
+ byteIndex = Tcl_UtfAtIndex(string, index) - string;
+ byteCount = Tcl_UtfAtIndex(string+byteIndex, count) - (string+byteIndex);
newByteCount = entryPtr->entry.numBytes + 1 - byteCount;
newBytes = (char *)ckalloc(newByteCount);
@@ -1319,7 +1319,7 @@ static void EntryDisplay(void *clientData, Drawable d)
if ((*(entryPtr->entry.displayString) == '\0')
&& (entryPtr->entry.placeholderObj != NULL)) {
/* No text displayed, but -placeholder is given */
- if (TkGetCharLength(es.placeholderForegroundObj) > 0) {
+ if (Tcl_GetCharLength(es.placeholderForegroundObj) > 0) {
foregroundObj = es.placeholderForegroundObj;
} else {
foregroundObj = es.foregroundObj;
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index 716c477..fcc069b 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -55,17 +55,7 @@ const char *const ttkOrientStrings[] = {
"horizontal", "vertical", NULL
};
-#if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9
int Ttk_GetOrientFromObj(
- Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr)
-{
- *resultPtr = TTK_ORIENT_HORIZONTAL;
- return Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings,
- "orientation", 0, resultPtr);
-}
-#endif
-
-int TtkGetOrientFromObj(
Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr)
{
int orient = (int)TTK_ORIENT_HORIZONTAL;
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index f9698ed..f28b90f 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -54,11 +54,7 @@ static const Ttk_ElementOptionSpec TextElementOptions[] = {
{ "-foreground", TK_OPTION_COLOR,
offsetof(TextElement,foregroundObj), "black" },
{ "-underline", TK_OPTION_INDEX,
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
- offsetof(TextElement,underlineObj), "-1"},
-#else
offsetof(TextElement,underlineObj), NULL},
-#endif
{ "-width", TK_OPTION_INT,
offsetof(TextElement,widthObj), "-1"},
{ "-anchor", TK_OPTION_ANCHOR,
@@ -529,11 +525,7 @@ static const Ttk_ElementOptionSpec LabelElementOptions[] = {
{ "-foreground", TK_OPTION_COLOR,
offsetof(LabelElement,text.foregroundObj), "black" },
{ "-underline", TK_OPTION_INDEX,
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
offsetof(LabelElement,text.underlineObj), "-1"},
-#else
- offsetof(LabelElement,text.underlineObj), NULL},
-#endif
{ "-width", TK_OPTION_INT,
offsetof(LabelElement,text.widthObj), ""},
{ "-anchor", TK_OPTION_ANCHOR,
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index 966f727..7c7e6a5 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -1126,10 +1126,9 @@ static int NotebookIdentifyCommand(
}
break;
case IDENTIFY_TAB:
-#if !defined TK_NO_DEPRECATED && (TCL_MAJOR_VERSION < 9)
- if (tabIndex >= 0)
-#endif
- Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex));
+ if (tabIndex >= 0) {
+ Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex));
+ }
break;
}
return TCL_OK;
@@ -1154,10 +1153,9 @@ static int NotebookIndexCommand(
status = FindTabIndex(interp, nb, objv[2], &index);
if (status == TCL_OK) {
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
- if (index >= 0)
-#endif
- Tcl_SetObjResult(interp, TkNewIndexObj(index));
+ if (index >= 0) {
+ Tcl_SetObjResult(interp, TkNewIndexObj(index));
+ }
}
return status;
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c
index b5e9d5f..5584d9b 100644
--- a/generic/ttk/ttkProgress.c
+++ b/generic/ttk/ttkProgress.c
@@ -303,7 +303,7 @@ static int ProgressbarSize(void *recordPtr, int *widthPtr, int *heightPtr)
/* Override requested width (height) based on -length and -orient
*/
Tk_GetPixelsFromObj(NULL, pb->core.tkwin, pb->progress.lengthObj, &length);
- TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL) {
*widthPtr = length;
@@ -376,7 +376,7 @@ static void ProgressbarDoLayout(void *recordPtr)
Tcl_GetDoubleFromObj(NULL, pb->progress.valueObj, &value);
Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum);
- TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient);
if (pbar) {
double fraction = value / maximum;
diff --git a/generic/ttk/ttkStubInit.c b/generic/ttk/ttkStubInit.c
index 51acf3a..9d7d4fc 100644
--- a/generic/ttk/ttkStubInit.c
+++ b/generic/ttk/ttkStubInit.c
@@ -8,10 +8,6 @@
MODULE_SCOPE const TtkStubs ttkStubs;
-#if defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8
-#define Ttk_GetOrientFromObj 0
-#endif
-
#ifdef __GNUC__
/*
* The rest of this file shouldn't warn about deprecated functions; they're
diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h
index a148fd0..5491693 100644
--- a/generic/ttk/ttkTheme.h
+++ b/generic/ttk/ttkTheme.h
@@ -367,9 +367,6 @@ typedef enum { /* -orient option values */
TTK_ORIENT_VERTICAL
} Ttk_Orient;
-MODULE_SCOPE int TtkGetOrientFromObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr, Ttk_Orient *orient);
-
/*------------------------------------------------------------------------
* +++ Utilities.
*/
diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h
index 37e9c83..79848d0 100644
--- a/generic/ttk/ttkThemeInt.h
+++ b/generic/ttk/ttkThemeInt.h
@@ -52,10 +52,6 @@ MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp);
MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box);
-#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
-# define TTK_OPTION_UNDERLINE_DEF(type, field) "-1", offsetof(type, field), TCL_INDEX_NONE, 0, NULL
-#else
-# define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL
-#endif
+#define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL
#endif /* _TTKTHEMEINT */
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 884c1f3..5106909 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -3253,6 +3253,50 @@ static int TreeviewDetachCommand(
return TCL_OK;
}
+/* Is an item detached? The root is never detached. */
+static int IsDetached(Treeview *tv, TreeItem *item)
+{
+ return item->next == NULL && item->prev == NULL &&
+ item->parent == NULL && item != tv->tree.root;
+}
+
+/* + $tv detached ?$item? --
+ * List detached items (in arbitrary order) or query the detached state of
+ * $item.
+ */
+static int TreeviewDetachedCommand(
+ void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
+{
+ Treeview *tv = (Treeview *)recordPtr;
+ TreeItem *item;
+
+ if (objc == 2) {
+ /* List detached items */
+ Tcl_HashSearch search;
+ Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(&tv->tree.items, &search);
+ Tcl_Obj *objPtr = Tcl_NewObj();
+
+ while (entryPtr != NULL) {
+ item = (TreeItem *)Tcl_GetHashValue(entryPtr);
+ entryPtr = Tcl_NextHashEntry(&search);
+ if (IsDetached(tv, item)) {
+ Tcl_ListObjAppendElement(NULL, objPtr, ItemID(tv, item));
+ }
+ }
+ Tcl_SetObjResult(interp, objPtr);
+ return TCL_OK;
+ } else if (objc == 3) {
+ /* Query; the root is never reported as detached */
+ if (!(item = FindItem(interp, tv, objv[2]))) {
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(IsDetached(tv, item)));
+ return TCL_OK;
+ } else {
+ Tcl_WrongNumArgs(interp, 2, objv, "?item?");
+ return TCL_ERROR;
+ }
+}
/* + $tv delete $items --
* Delete each item in $items.
*
@@ -4363,6 +4407,7 @@ static const Ttk_Ensemble TreeviewCommands[] = {
{ "configure", TtkWidgetConfigureCommand,0 },
{ "delete", TreeviewDeleteCommand,0 },
{ "detach", TreeviewDetachCommand,0 },
+ { "detached", TreeviewDetachedCommand,0 },
{ "drag", TreeviewDragCommand,0 },
{ "drop", TreeviewDropCommand,0 },
{ "exists", TreeviewExistsCommand,0 },
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 3176dca..24035ca 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -482,7 +482,7 @@ Ttk_Layout TtkWidgetGetOrientedLayout(
/* Prefix:
*/
- TtkGetOrientFromObj(NULL, orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL)
Tcl_DStringAppend(&styleName, "Horizontal.", TCL_INDEX_NONE);
else
diff --git a/library/demos/anilabel.tcl b/library/demos/anilabel.tcl
index be1b402..6662f9a 100644
--- a/library/demos/anilabel.tcl
+++ b/library/demos/anilabel.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .anilabel
catch {destroy $w}
diff --git a/library/demos/aniwave.tcl b/library/demos/aniwave.tcl
index 1f7e8f3..50de429 100644
--- a/library/demos/aniwave.tcl
+++ b/library/demos/aniwave.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .aniwave
catch {destroy $w}
diff --git a/library/demos/arrow.tcl b/library/demos/arrow.tcl
index 5674be9..e30406b 100644
--- a/library/demos/arrow.tcl
+++ b/library/demos/arrow.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# scl --
# Scales an integer according to the display's current scaling percentage.
diff --git a/library/demos/bind.tcl b/library/demos/bind.tcl
index 8b56639..179310a 100644
--- a/library/demos/bind.tcl
+++ b/library/demos/bind.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .bind
catch {destroy $w}
diff --git a/library/demos/bitmap.tcl b/library/demos/bitmap.tcl
index 453987d..2787efa 100644
--- a/library/demos/bitmap.tcl
+++ b/library/demos/bitmap.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# bitmapRow --
# Create a row of bitmap items in a window.
diff --git a/library/demos/browse b/library/demos/browse
index d107f28..e401034 100644
--- a/library/demos/browse
+++ b/library/demos/browse
@@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"}
# directory and allows you to open files or subdirectories by
# double-clicking.
-package require Tk
+package require tk
# Create a scrollbar on the right side of the main window and a listbox
# on the left side.
diff --git a/library/demos/button.tcl b/library/demos/button.tcl
index 0169c2a..d7cd4ce 100644
--- a/library/demos/button.tcl
+++ b/library/demos/button.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .button
catch {destroy $w}
diff --git a/library/demos/check.tcl b/library/demos/check.tcl
index 96ff251..2623618 100644
--- a/library/demos/check.tcl
+++ b/library/demos/check.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .check
catch {destroy $w}
diff --git a/library/demos/clrpick.tcl b/library/demos/clrpick.tcl
index ba50b75..7322bcf 100644
--- a/library/demos/clrpick.tcl
+++ b/library/demos/clrpick.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .clrpick
catch {destroy $w}
diff --git a/library/demos/colors.tcl b/library/demos/colors.tcl
index f1f931d..3a79cb1 100644
--- a/library/demos/colors.tcl
+++ b/library/demos/colors.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .colors
catch {destroy $w}
diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl
index 53e5a27..7f33fa9 100644
--- a/library/demos/combo.tcl
+++ b/library/demos/combo.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .combo
catch {destroy $w}
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index 8c16cf3..0463cec 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .cscroll
catch {destroy $w}
diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl
index 5fc32f0..57fbb13 100644
--- a/library/demos/ctext.tcl
+++ b/library/demos/ctext.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ctext
catch {destroy $w}
diff --git a/library/demos/entry1.tcl b/library/demos/entry1.tcl
index f41c2ab..f6b087e 100644
--- a/library/demos/entry1.tcl
+++ b/library/demos/entry1.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .entry1
catch {destroy $w}
diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl
index ac82c6a..7f15ee1 100644
--- a/library/demos/entry2.tcl
+++ b/library/demos/entry2.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .entry2
catch {destroy $w}
diff --git a/library/demos/entry3.tcl b/library/demos/entry3.tcl
index f229de6..f6c2e8c 100644
--- a/library/demos/entry3.tcl
+++ b/library/demos/entry3.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .entry3
catch {destroy $w}
diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl
index a8f5c32..06dacc8 100644
--- a/library/demos/filebox.tcl
+++ b/library/demos/filebox.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .filebox
catch {destroy $w}
diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl
index 9b66116..4bf3ce4 100644
--- a/library/demos/floor.tcl
+++ b/library/demos/floor.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# floorDisplay --
# Recreate the floorplan display in the canvas given by "w". The
diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl
index 4353a4d..de9e854 100644
--- a/library/demos/fontchoose.tcl
+++ b/library/demos/fontchoose.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .fontchoose
catch {destroy $w}
diff --git a/library/demos/form.tcl b/library/demos/form.tcl
index 4d80437..f0f3109 100644
--- a/library/demos/form.tcl
+++ b/library/demos/form.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .form
catch {destroy $w}
diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl
index 860d03c..5a5b462 100644
--- a/library/demos/goldberg.tcl
+++ b/library/demos/goldberg.tcl
@@ -40,7 +40,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .goldberg
catch {destroy $w}
diff --git a/library/demos/hello b/library/demos/hello
index d10b8d5..d5e733d 100644
--- a/library/demos/hello
+++ b/library/demos/hello
@@ -6,7 +6,7 @@ exec wish "$0" ${1+"$@"}
# Simple Tk script to create a button that prints "Hello, world".
# Click on the button to terminate the program.
-package require Tk
+package require tk
# The first line below creates the button, and the second line
# asks the packer to shrink-wrap the application's main window
diff --git a/library/demos/hscale.tcl b/library/demos/hscale.tcl
index 26745bc..777b195 100644
--- a/library/demos/hscale.tcl
+++ b/library/demos/hscale.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .hscale
catch {destroy $w}
diff --git a/library/demos/icon.tcl b/library/demos/icon.tcl
index c8c1e18..14e1c0b 100644
--- a/library/demos/icon.tcl
+++ b/library/demos/icon.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .icon
catch {destroy $w}
diff --git a/library/demos/image1.tcl b/library/demos/image1.tcl
index c174a92..1e67e24 100644
--- a/library/demos/image1.tcl
+++ b/library/demos/image1.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .image1
catch {destroy $w}
diff --git a/library/demos/image2.tcl b/library/demos/image2.tcl
index 9691b87..f3aab60 100644
--- a/library/demos/image2.tcl
+++ b/library/demos/image2.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# loadDir --
# This procedure reloads the directory listbox from the directory
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index 5dc14b8..7b45cf5 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .items
catch {destroy $w}
diff --git a/library/demos/ixset b/library/demos/ixset
index 80dba4a..c934668 100644
--- a/library/demos/ixset
+++ b/library/demos/ixset
@@ -9,7 +9,7 @@ exec wish "$0" ${1+"$@"}
# 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design
# 92/08/01 : pda@masi.ibp.fr : cleaning
-package require Tk
+package require tk
#
# Button actions
diff --git a/library/demos/knightstour.tcl b/library/demos/knightstour.tcl
index 8367477..76b6a4f 100644
--- a/library/demos/knightstour.tcl
+++ b/library/demos/knightstour.tcl
@@ -21,7 +21,7 @@
# If you let it repeat then it will choose random start positions
# for each new tour.
-package require Tk
+package require tk
# Return a list of accessible squares from a given square
proc ValidMoves {square} {
diff --git a/library/demos/label.tcl b/library/demos/label.tcl
index d2823e1..0644de8 100644
--- a/library/demos/label.tcl
+++ b/library/demos/label.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .label
catch {destroy $w}
diff --git a/library/demos/labelframe.tcl b/library/demos/labelframe.tcl
index b40bd54..08e8a23 100644
--- a/library/demos/labelframe.tcl
+++ b/library/demos/labelframe.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .labelframe
catch {destroy $w}
diff --git a/library/demos/mac_styles.tcl b/library/demos/mac_styles.tcl
index 33fa888..804b5c0 100644
--- a/library/demos/mac_styles.tcl
+++ b/library/demos/mac_styles.tcl
@@ -8,12 +8,10 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
-
set w .mac_styles
catch {destroy $w}
toplevel $w
-package require Tk
+package require tk
wm title $w "Tk Aqua Widgets"
wm iconname $w "mac_styles"
positionWindow $w
@@ -247,16 +245,16 @@ if { [wm attributes $w -isdark] } {
}
proc beLight {f w} {
wm attributes $w -appearance aqua
- $f.dark state !selected
- $f.light state selected
- after 10 $f.light state !hover
+ # A small delay is needed for the appearance change to complete.
+ after 10 [list $f.dark state !selected]
+ after 10 [list $f.light state selected]
}
proc beDark {f w} {
wm attributes $w -appearance darkaqua
- $f.light state !selected
- $f.dark state selected
- after 10 $f.dark state !hover
+ # A small delay is needed for the appearance change to complete.
+ after 10 [list $f.light state !selected]
+ after 10 [list $f.dark state selected]
}
$w.notebook add $appearanceFrame -text "Appearance"
diff --git a/library/demos/mac_tabs.tcl b/library/demos/mac_tabs.tcl
index 16771a8..fea9b03 100644
--- a/library/demos/mac_tabs.tcl
+++ b/library/demos/mac_tabs.tcl
@@ -8,12 +8,11 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
catch {font create giant -family {Times New Roman} -size 64}
set w .mac_tabs
catch {destroy $w}
toplevel $w
-package require Tk
wm title $w "Tabbed Windows in Aqua"
wm iconname $w "mac_tabs"
positionWindow $w
diff --git a/library/demos/mac_wm.tcl b/library/demos/mac_wm.tcl
index 3272623..105c12c 100644
--- a/library/demos/mac_wm.tcl
+++ b/library/demos/mac_wm.tcl
@@ -8,12 +8,11 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .mac_wm
catch {destroy $w}
toplevel $w
-package require Tk
wm title $w "Tk Aqua Window Styles"
wm iconname $w "mac_wm"
positionWindow $w
diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl
index 086fbf5..a60a00f 100644
--- a/library/demos/mclist.tcl
+++ b/library/demos/mclist.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .mclist
catch {destroy $w}
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index d43a374..2a8ad1c 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .menu
catch {destroy $w}
diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl
index cb52f43..a45fe84 100644
--- a/library/demos/menubu.tcl
+++ b/library/demos/menubu.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .menubu
catch {destroy $w}
diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl
index 6f34e16..1c9a319 100644
--- a/library/demos/msgbox.tcl
+++ b/library/demos/msgbox.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .msgbox
catch {destroy $w}
diff --git a/library/demos/paned1.tcl b/library/demos/paned1.tcl
index 829988a..8e2568b 100644
--- a/library/demos/paned1.tcl
+++ b/library/demos/paned1.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .paned1
catch {destroy $w}
diff --git a/library/demos/paned2.tcl b/library/demos/paned2.tcl
index 73af21d..feb0254 100644
--- a/library/demos/paned2.tcl
+++ b/library/demos/paned2.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .paned2
catch {destroy $w}
diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl
index d76a1ec..060c070 100644
--- a/library/demos/pendulum.tcl
+++ b/library/demos/pendulum.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .pendulum
catch {destroy $w}
diff --git a/library/demos/plot.tcl b/library/demos/plot.tcl
index 5df318b..32bc2d5 100644
--- a/library/demos/plot.tcl
+++ b/library/demos/plot.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .plot
catch {destroy $w}
diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl
index 30c0562..aab5744 100644
--- a/library/demos/puzzle.tcl
+++ b/library/demos/puzzle.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# puzzleSwitch --
# This procedure is invoked when the user clicks on a particular button;
diff --git a/library/demos/radio.tcl b/library/demos/radio.tcl
index 41f8db2..c6f5135 100644
--- a/library/demos/radio.tcl
+++ b/library/demos/radio.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .radio
catch {destroy $w}
diff --git a/library/demos/rmt b/library/demos/rmt
index 00bdc9d..21c6ca0 100644
--- a/library/demos/rmt
+++ b/library/demos/rmt
@@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"}
# Tk applications. It allows you to select an application and
# then type commands to that application.
-package require Tk
+package require tk
wm title . "Tk Remote Controller"
wm iconname . "Tk Remote"
diff --git a/library/demos/rolodex b/library/demos/rolodex
index d82faf9..891c666 100644
--- a/library/demos/rolodex
+++ b/library/demos/rolodex
@@ -8,7 +8,7 @@ exec wish "$0" ${1+"$@"}
# feel of a rolodex program, although it's lifeless and doesn't
# actually do the rolodex application.
-package require Tk
+package require tk
foreach i [winfo children .] {
catch {destroy $i}
diff --git a/library/demos/ruler.tcl b/library/demos/ruler.tcl
index 0b78370..761892e 100644
--- a/library/demos/ruler.tcl
+++ b/library/demos/ruler.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# rulerMkTab --
# This procedure creates a new triangular polygon in a canvas to
diff --git a/library/demos/sayings.tcl b/library/demos/sayings.tcl
index 3458016..b7be791 100644
--- a/library/demos/sayings.tcl
+++ b/library/demos/sayings.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .sayings
catch {destroy $w}
diff --git a/library/demos/search.tcl b/library/demos/search.tcl
index b4beb28..f4913f8 100644
--- a/library/demos/search.tcl
+++ b/library/demos/search.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# textLoadFile --
# This procedure below loads a file into a text widget, discarding
diff --git a/library/demos/spin.tcl b/library/demos/spin.tcl
index b9a7ac1..990d41c 100644
--- a/library/demos/spin.tcl
+++ b/library/demos/spin.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .spin
catch {destroy $w}
diff --git a/library/demos/states.tcl b/library/demos/states.tcl
index e2acd80..4e14fd5 100644
--- a/library/demos/states.tcl
+++ b/library/demos/states.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .states
catch {destroy $w}
diff --git a/library/demos/style.tcl b/library/demos/style.tcl
index 80b78f3..be0d365 100644
--- a/library/demos/style.tcl
+++ b/library/demos/style.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .style
catch {destroy $w}
diff --git a/library/demos/tcolor b/library/demos/tcolor
index 0aa133b..b349c5b 100644
--- a/library/demos/tcolor
+++ b/library/demos/tcolor
@@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"}
# create colors using either the RGB, HSB, or CYM color spaces
# and apply the color to existing applications.
-package require Tk
+package require tk
wm title . "Color Editor"
# Global variables that control the program:
diff --git a/library/demos/text.tcl b/library/demos/text.tcl
index 2736b88..130a4a5 100644
--- a/library/demos/text.tcl
+++ b/library/demos/text.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .text
catch {destroy $w}
diff --git a/library/demos/textpeer.tcl b/library/demos/textpeer.tcl
index 83e8e14..7dd55a7 100644
--- a/library/demos/textpeer.tcl
+++ b/library/demos/textpeer.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .textpeer
catch {destroy $w}
diff --git a/library/demos/timer b/library/demos/timer
index 6b61ca4..2d96ec4 100644
--- a/library/demos/timer
+++ b/library/demos/timer
@@ -5,7 +5,7 @@ exec wish "$0" ${1+"$@"}
# timer --
# This script generates a counter with start and stop buttons.
-package require Tk
+package require tk
label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m
button .start -text Start -command {
diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl
index c8248e3..50d4e49 100644
--- a/library/demos/toolbar.tcl
+++ b/library/demos/toolbar.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .toolbar
destroy $w
diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl
index 1cc70f8..fe06ce1 100644
--- a/library/demos/tree.tcl
+++ b/library/demos/tree.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .tree
catch {destroy $w}
diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl
index 86e4382..f567790 100644
--- a/library/demos/ttkbut.tcl
+++ b/library/demos/ttkbut.tcl
@@ -8,7 +8,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkbut
catch {destroy $w}
diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl
index aad5aa0..35cf935 100644
--- a/library/demos/ttkmenu.tcl
+++ b/library/demos/ttkmenu.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkmenu
catch {destroy $w}
diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl
index 5e5551d..d1d15f9 100644
--- a/library/demos/ttknote.tcl
+++ b/library/demos/ttknote.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttknote
catch {destroy $w}
diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl
index bae8716..749f940 100644
--- a/library/demos/ttkpane.tcl
+++ b/library/demos/ttkpane.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkpane
catch {destroy $w}
diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl
index e5d0e22..6e5068e 100644
--- a/library/demos/ttkprogress.tcl
+++ b/library/demos/ttkprogress.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkprogress
catch {destroy $w}
diff --git a/library/demos/ttkscale.tcl b/library/demos/ttkscale.tcl
index e08d9b2..6aeb11c 100644
--- a/library/demos/ttkscale.tcl
+++ b/library/demos/ttkscale.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkscale
catch {destroy $w}
diff --git a/library/demos/ttkspin.tcl b/library/demos/ttkspin.tcl
index 83e5449..9f53b2e 100644
--- a/library/demos/ttkspin.tcl
+++ b/library/demos/ttkspin.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .ttkspin
catch {destroy $w}
diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl
index 5268fdf..b974456 100644
--- a/library/demos/twind.tcl
+++ b/library/demos/twind.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
# Make an Aqua button's fill color match its parent's background
proc blend {bt} {
diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl
index 1ecc064..0f3dc2d 100644
--- a/library/demos/unicodeout.tcl
+++ b/library/demos/unicodeout.tcl
@@ -7,7 +7,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .unicodeout
catch {destroy $w}
diff --git a/library/demos/vscale.tcl b/library/demos/vscale.tcl
index 3a041a6..f1529c0 100644
--- a/library/demos/vscale.tcl
+++ b/library/demos/vscale.tcl
@@ -6,7 +6,7 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-package require Tk
+package require tk
set w .vscale
catch {destroy $w}
diff --git a/library/demos/widget b/library/demos/widget
index 39fbbb1..d2dff1c 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"}
# separate ".tcl" files is this directory, which are sourced by this script as
# needed.
-package require Tk 8.7-
+package require tk 8.7-
package require msgcat
destroy {*}[winfo children .]
diff --git a/library/menu.tcl b/library/menu.tcl
index cffa0e2..57dc963 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -487,7 +487,6 @@ proc ::tk::MenuMotion {menu x y state} {
}
set index [$menu index @$x,$y]
if {[info exists Priv(menuActivated)] \
- && $index ne "none" \
&& $index >= 0 \
&& $index ne $activeindex} {
set mode [option get $menu clickToFocus ClickToFocus]
@@ -530,8 +529,7 @@ proc ::tk::MenuButtonDown menu {
if {![winfo viewable $menu]} {
return
}
- set activeindex [$menu index active]
- if {($activeindex eq "none") || ($activeindex < 0)} {
+ if {[$menu index active] < 0} {
if {[$menu cget -type] ne "menubar" } {
set Priv(window) {}
}
@@ -589,8 +587,7 @@ proc ::tk::MenuButtonDown menu {
proc ::tk::MenuLeave {menu rootx rooty state} {
variable ::tk::Priv
set Priv(window) {}
- set activeindex [$menu index active]
- if {($activeindex eq "none") || ($activeindex < 0)} {
+ if {[$menu index active] < 0} {
return
}
if {[$menu type active] eq "cascade" \
@@ -657,8 +654,7 @@ proc ::tk::MenuInvoke {w buttonRelease} {
uplevel #0 [list $w invoke $activeindex]
}
} else {
- set activeindex [$w index active]
- if {($Priv(popup) eq "") || (($activeindex ne "none") && ($activeindex >= 0))} {
+ if {$Priv(popup) eq "" || [$w index active] >= 0} {
MenuUnpost $w
}
uplevel #0 [list $w invoke active]
@@ -802,7 +798,6 @@ proc ::tk::MenuNextMenu {menu direction} {
if {[winfo class $mb] eq "Menubutton" \
&& [$mb cget -state] ne "disabled" \
&& [$mb cget -menu] ne "" \
- && [[$mb cget -menu] index last] ne "none" \
&& [[$mb cget -menu] index last] >= 0} {
break
}
@@ -826,13 +821,13 @@ proc ::tk::MenuNextMenu {menu direction} {
proc ::tk::MenuNextEntry {menu count} {
set last [$menu index last]
- if {($last eq "none") || ($last < 0)} {
+ if {$last < 0} {
return
}
set length [expr {$last+1}]
set quitAfter $length
set activeindex [$menu index active]
- if {($activeindex eq "none") || ($activeindex < 0)} {
+ if {$activeindex < 0} {
set i 0
} else {
set i [expr {$activeindex + $count}]
@@ -1032,9 +1027,6 @@ proc ::tk::TraverseWithinMenu {w char} {
}
set char [string tolower $char]
set last [$w index last]
- if {$last eq "none"} {
- return
- }
for {set i 0} {$i <= $last} {incr i} {
if {[catch {set char2 [string index \
[$w entrycget $i -label] [$w entrycget $i -underline]]}]} {
@@ -1074,14 +1066,10 @@ proc ::tk::MenuFirstEntry menu {
return
}
tk_menuSetFocus $menu
- set activeindex [$menu index active]
- if {($activeindex ne "none") && ($activeindex >= 0)} {
+ if {[$menu index active] >= 0} {
return
}
set last [$menu index last]
- if {$last eq "none"} {
- return
- }
for {set i 0} {$i <= $last} {incr i} {
if {([catch {set state [$menu entrycget $i -state]}] == 0) \
&& $state ne "disabled" && [$menu type $i] ne "tearoff"} {
@@ -1121,9 +1109,6 @@ proc ::tk::MenuFindName {menu s} {
return $i
}
set last [$menu index last]
- if {$last eq "none"} {
- return ""
- }
for {set i 0} {$i <= $last} {incr i} {
if {![catch {$menu entrycget $i -label} label]} {
if {$label eq $s} {
diff --git a/library/obsolete.tcl b/library/obsolete.tcl
deleted file mode 100644
index a31884d..0000000
--- a/library/obsolete.tcl
+++ /dev/null
@@ -1,178 +0,0 @@
-# obsolete.tcl --
-#
-# This file contains obsolete procedures that people really shouldn't
-# be using anymore, but which are kept around for backward compatibility.
-#
-# Copyright © 1994 The Regents of the University of California.
-# Copyright © 1994 Sun Microsystems, Inc.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-
-# The procedures below are here strictly for backward compatibility with
-# Tk version 3.6 and earlier. The procedures are no longer needed, so
-# they are no-ops. You should not use these procedures anymore, since
-# they may be removed in some future release.
-
-proc tk_menuBar args {}
-proc tk_bindForTraversal args {}
-
-# ::tk::classic::restore --
-#
-# Restore the pre-8.5 (Tk classic) look as the widget defaults for classic
-# Tk widgets.
-#
-# The value following an 'option add' call is the new 8.5 value.
-#
-namespace eval ::tk::classic {
- # This may need to be adjusted for some window managers that are
- # more aggressive with their own Xdefaults (like KDE and CDE)
- variable prio "widgetDefault"
-}
-
-proc ::tk::classic::restore {args} {
- # Restore classic (8.4) look to classic Tk widgets
- variable prio
-
- if {[llength $args]} {
- foreach what $args {
- ::tk::classic::restore_$what
- }
- } else {
- foreach cmd [info procs restore_*] {
- $cmd
- }
- }
-}
-
-proc ::tk::classic::restore_font {args} {
- # Many widgets were adjusted from hard-coded defaults to using the
- # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...)
- # For restoring compatibility, we only correct size and weighting changes,
- # as the fonts themselves remained mostly the same.
- if {[tk windowingsystem] eq "x11"} {
- font configure TkDefaultFont -weight bold ; # normal
- font configure TkFixedFont -size -12 ; # -10
- }
- # Add these with prio 21 to override value in dialog/msgbox.tcl
- if {[tk windowingsystem] eq "aqua"} {
- option add *Dialog.msg.font system 21; # TkCaptionFont
- option add *Dialog.dtl.font system 21; # TkCaptionFont
- option add *ErrorDialog*Label.font system 21; # TkCaptionFont
- } else {
- option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont
- option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont
- option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont
- }
-}
-
-proc ::tk::classic::restore_button {args} {
- variable prio
- if {[tk windowingsystem] eq "x11"} {
- foreach cls {Button Radiobutton Checkbutton} {
- option add *$cls.borderWidth 2 $prio; # 1
- }
- }
-}
-
-proc ::tk::classic::restore_entry {args} {
- variable prio
- # Entry and Spinbox share core defaults
- foreach cls {Entry Spinbox} {
- if {[tk windowingsystem] ne "aqua"} {
- option add *$cls.borderWidth 2 $prio; # 1
- }
- if {[tk windowingsystem] eq "x11"} {
- option add *$cls.background "#d9d9d9" $prio; # "white"
- option add *$cls.selectBorderWidth 1 $prio; # 0
- }
- }
-}
-
-proc ::tk::classic::restore_listbox {args} {
- variable prio
- if {[tk windowingsystem] ne "win32"} {
- option add *Listbox.background "#d9d9d9" $prio; # "white"
- option add *Listbox.activeStyle "underline" $prio; # "dotbox"
- }
- if {[tk windowingsystem] ne "aqua"} {
- option add *Listbox.borderWidth 2 $prio; # 1
- }
- if {[tk windowingsystem] eq "x11"} {
- option add *Listbox.selectBorderWidth 1 $prio; # 0
- }
- # Remove focus into Listbox added for 8.5
- bind Listbox <Button-1> {
- if {[winfo exists %W]} {
- tk::ListboxBeginSelect %W [%W index @%x,%y]
- }
- }
-}
-
-proc ::tk::classic::restore_menu {args} {
- variable prio
- if {[tk windowingsystem] eq "x11"} {
- option add *Menu.activeBorderWidth 2 $prio; # 1
- option add *Menu.borderWidth 2 $prio; # 1
- option add *Menu.clickToFocus true $prio
- option add *Menu.useMotifHelp true $prio
- }
- if {[tk windowingsystem] ne "aqua"} {
- option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont"
- }
-}
-
-proc ::tk::classic::restore_menubutton {args} {
- variable prio
- option add *Menubutton.borderWidth 2 $prio; # 1
-}
-
-proc ::tk::classic::restore_message {args} {
- variable prio
- option add *Message.borderWidth 2 $prio; # 1
-}
-
-proc ::tk::classic::restore_panedwindow {args} {
- variable prio
- option add *Panedwindow.borderWidth 2 $prio; # 1
- option add *Panedwindow.sashWidth 2 $prio; # 3
- option add *Panedwindow.sashPad 2 $prio; # 0
- option add *Panedwindow.sashRelief raised $prio; # flat
- option add *Panedwindow.opaqueResize 0 $prio; # 1
- if {[tk windowingsystem] ne "win32"} {
- option add *Panedwindow.showHandle 1 $prio; # 0
- }
-}
-
-proc ::tk::classic::restore_scale {args} {
- variable prio
- option add *Scale.borderWidth 2 $prio; # 1
- if {[tk windowingsystem] eq "x11"} {
- option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3"
- }
-}
-
-proc ::tk::classic::restore_scrollbar {args} {
- variable prio
- if {[tk windowingsystem] eq "x11"} {
- option add *Scrollbar.borderWidth 2 $prio; # 1
- option add *Scrollbar.highlightThickness 1 $prio; # 0
- option add *Scrollbar.width 15 $prio; # 11
- option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3"
- }
-}
-
-proc ::tk::classic::restore_text {args} {
- variable prio
- if {[tk windowingsystem] ne "aqua"} {
- option add *Text.borderWidth 2 $prio; # 1
- }
- if {[tk windowingsystem] eq "win32"} {
- option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont"
- }
- if {[tk windowingsystem] eq "x11"} {
- option add *Text.background "#d9d9d9" $prio; # white
- option add *Text.selectBorderWidth 1 $prio; # 0
- }
-}
diff --git a/library/palette.tcl b/library/palette.tcl
index 90b499b..d07f894 100644
--- a/library/palette.tcl
+++ b/library/palette.tcl
@@ -189,6 +189,9 @@ proc ::tk_setPalette {args} {
# which contains color information. Each element
# is named after a widget configuration option, and
# each value is the value for that option.
+# Return Value:
+# A list of commands which can be run to update
+# the defaults database when exec'ed.
proc ::tk::RecolorTree {w colors} {
upvar $colors c
@@ -200,11 +203,14 @@ proc ::tk::RecolorTree {w colors} {
foreach dbOption [array names c] {
set option -[string tolower $dbOption]
set class [string replace $dbOption 0 0 [string toupper \
- [string index $dbOption 0]]]
+ [string index $dbOption 0]]]
+ # Make sure this option is valid for this window.
if {![catch {$w configure $option} value]} {
- # if the option database has a preference for this
- # dbOption, then use it, otherwise use the defaults
- # for the widget.
+ # Update the option for this window.
+ $w configure $option $c($dbOption)
+ # Retrieve a default value for this option. First check
+ # the option database. If it is not in the database use
+ # the value for the temporary prototype widget.
set defaultcolor [option get $w $dbOption $class]
if {$defaultcolor eq "" || \
([info exists prototype] && \
@@ -214,16 +220,15 @@ proc ::tk::RecolorTree {w colors} {
if {$defaultcolor ne ""} {
set defaultcolor [winfo rgb . $defaultcolor]
}
- set chosencolor [lindex $value 4]
- if {$chosencolor ne ""} {
- set chosencolor [winfo rgb . $chosencolor]
+ # If the color requested for this option differs from
+ # the default, append a command to update the default.
+ set requestcolor [lindex $value 4]
+ if {$requestcolor ne ""} {
+ set requestcolor [winfo rgb . $requestcolor]
}
- if {[string match $defaultcolor $chosencolor]} {
- # Change the option database so that future windows will get
- # the same colors.
+ if {![string match $defaultcolor $requestcolor]} {
append result ";\noption add [list \
*[winfo class $w].$dbOption $c($dbOption) 60]"
- $w configure $option $c($dbOption)
}
}
}
diff --git a/library/tclIndex b/library/tclIndex
index f2a36fa..9b5f889 100644
--- a/library/tclIndex
+++ b/library/tclIndex
@@ -6,252 +6,247 @@
# element name is the name of a command and the value is
# a script that loads the command.
-set auto_index(::tk::dialog::error::Return) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(::tk::dialog::error::Details) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(::tk::dialog::error::SaveToLog) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(::tk::dialog::error::Destroy) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(::tk::dialog::error::bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]]
-set auto_index(::tk::ButtonInvoke) [list source -encoding utf-8 [file join $dir button.tcl]]
-set auto_index(::tk::ButtonAutoInvoke) [list source -encoding utf-8 [file join $dir button.tcl]]
-set auto_index(::tk::CheckRadioInvoke) [list source -encoding utf-8 [file join $dir button.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::Config) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::Done) [list source -encoding utf-8 [file join $dir choosedir.tcl]]
-set auto_index(::tk::dialog::color::) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::InitValues) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::Config) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::BuildDialog) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::SetRGBValue) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::XToRgb) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::RgbToX) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::DrawColorScale) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::CreateSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::RedrawFinalColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::RedrawColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::StartMove) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::MoveSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::ReleaseMouse) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::ResizeColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::HandleSelEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::HandleRGBEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::EnterColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::LeaveColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::OkCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(::tk::dialog::color::CancelCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]]
-set auto_index(tclParseConfigSpec) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(tclListValidFlags) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_Create) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_BindIn) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_BindOut) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_Destroy) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_In) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FocusGroup_Out) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::FDGetFileTypes) [list source -encoding utf-8 [file join $dir comdlg.tcl]]
-set auto_index(::tk::ConsoleInit) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleSource) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleInvoke) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleHistory) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsolePrompt) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleBind) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleInsert) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleOutput) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleExit) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(::tk::ConsoleAbout) [list source -encoding utf-8 [file join $dir console.tcl]]
-set auto_index(tk_dialog) [list source -encoding utf-8 [file join $dir dialog.tcl]]
-set auto_index(::tk::EntryClosestGap) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryButton1) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryMouseSelect) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryPaste) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryAutoScan) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryKeySelect) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryInsert) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryBackspace) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntrySeeInsert) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntrySetCursor) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryTranspose) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryPreviousWord) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(::tk::EntryGetSelection) [list source -encoding utf-8 [file join $dir entry.tcl]]
-set auto_index(tk_focusNext) [list source -encoding utf-8 [file join $dir focus.tcl]]
-set auto_index(tk_focusPrev) [list source -encoding utf-8 [file join $dir focus.tcl]]
-set auto_index(::tk::FocusOK) [list source -encoding utf-8 [file join $dir focus.tcl]]
-set auto_index(tk_focusFollowsMouse) [list source -encoding utf-8 [file join $dir focus.tcl]]
-set auto_index(::tk::IconList) [list source -encoding utf-8 [file join $dir iconlist.tcl]]
-set auto_index(::tk::ListboxBeginSelect) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxMotion) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxBeginExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxBeginToggle) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxAutoScan) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxExtendUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxDataExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxCancel) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::ListboxSelectAll) [list source -encoding utf-8 [file join $dir listbox.tcl]]
-set auto_index(::tk::Megawidget) [list source -encoding utf-8 [file join $dir megawidget.tcl]]
-set auto_index(::tk::MbEnter) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MbLeave) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MbPost) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuUnpost) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MbMotion) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MbButtonUp) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuMotion) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuButtonDown) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuLeave) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuInvoke) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuEscape) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuUpArrow) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuDownArrow) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuLeftArrow) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuRightArrow) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuNextMenu) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuNextEntry) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuFind) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::TraverseToMenu) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::FirstMenu) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::TraverseWithinMenu) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuFirstEntry) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::MenuFindName) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::PostOverPoint) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::SaveGrabInfo) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::RestoreOldGrab) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(tk_menuSetFocus) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::GenerateMenuSelect) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(tk_popup) [list source -encoding utf-8 [file join $dir menu.tcl]]
-set auto_index(::tk::ensure_psenc_is_loaded) [list source -encoding utf-8 [file join $dir mkpsenc.tcl]]
-set auto_index(::tk::MessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]]
-set auto_index(tk_menuBar) [list source -encoding utf-8 [file join $dir obsolete.tcl]]
-set auto_index(tk_bindForTraversal) [list source -encoding utf-8 [file join $dir obsolete.tcl]]
-set auto_index(::tk::classic::restore) [list source -encoding utf-8 [file join $dir obsolete.tcl]]
-set auto_index(tk_optionMenu) [list source -encoding utf-8 [file join $dir optMenu.tcl]]
-set auto_index(tk_setPalette) [list source -encoding utf-8 [file join $dir palette.tcl]]
-set auto_index(::tk::RecolorTree) [list source -encoding utf-8 [file join $dir palette.tcl]]
-set auto_index(::tk::Darken) [list source -encoding utf-8 [file join $dir palette.tcl]]
-set auto_index(tk_bisque) [list source -encoding utf-8 [file join $dir palette.tcl]]
-set auto_index(::safe::tkInterpInit) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::loadTk) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::TkInit) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::allowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::disallowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::tkDelete) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::safe::tkTopLevel) [list source -encoding utf-8 [file join $dir safetk.tcl]]
-set auto_index(::tk::ScaleActivate) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleButtonDown) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleDrag) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleEndDrag) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleIncrement) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleControlPress) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScaleButton2Down) [list source -encoding utf-8 [file join $dir scale.tcl]]
-set auto_index(::tk::ScalingPct) [list source -encoding utf-8 [file join $dir scaling.tcl]]
-set auto_index(::tk::ScaleNum) [list source -encoding utf-8 [file join $dir scaling.tcl]]
-set auto_index(::tk::FontScalingFactor) [list source -encoding utf-8 [file join $dir scaling.tcl]]
-set auto_index(::tk::ScanMonitorsFile) [list source -encoding utf-8 [file join $dir scaling.tcl]]
-set auto_index(::tk::ScrollButtonDown) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollButtonUp) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollSelect) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollStartDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollEndDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollByUnits) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollByPages) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollToPos) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollTopBottom) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::ScrollButton2Down) [list source -encoding utf-8 [file join $dir scrlbar.tcl]]
-set auto_index(::tk::spinbox::Invoke) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::ClosestGap) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::ButtonDown) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::ButtonUp) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::MouseSelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::Paste) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::Motion) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::AutoScan) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::KeySelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::Insert) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::Backspace) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::SeeInsert) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::SetCursor) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::Transpose) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::PreviousWord) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::spinbox::GetSelection) [list source -encoding utf-8 [file join $dir spinbox.tcl]]
-set auto_index(::tk::TearOffMenu) [list source -encoding utf-8 [file join $dir tearoff.tcl]]
-set auto_index(::tk::MenuDup) [list source -encoding utf-8 [file join $dir tearoff.tcl]]
-set auto_index(::tk::TextClosestGap) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextButton1) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextSelectTo) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextKeyExtend) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextPaste) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextAutoScan) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextSetCursor) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextKeySelect) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextResetAnchor) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextInsert) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextUpDownLine) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextPrevPara) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextNextPara) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextScrollPages) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextTranspose) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(tk_textCopy) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(tk_textCut) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(tk_textPaste) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextNextPos) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::TextPrevPos) [list source -encoding utf-8 [file join $dir text.tcl]]
-set auto_index(::tk::PlaceWindow) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::SetFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::RestoreFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::ScreenChanged) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::EventMotifBindings) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::CancelRepeat) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::MouseWheel) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::TabToWindow) [list source -encoding utf-8 [file join $dir tk.tcl]]
-set auto_index(::tk::dialog::file::) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::Config) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::Create) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::SetSelectMode) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::Update) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::SetPathSilently) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::SetPath) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::SetFilter) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::ResolveFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::EntFocusIn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::EntFocusOut) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::ActivateEnt) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::VerifyFileName) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::InvokeBtn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::UpDirCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::JoinFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::OkCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::CancelCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::ListBrowse) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::ListInvoke) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::Done) [list source -encoding utf-8 [file join $dir tkfbox.tcl]]
-set auto_index(::tk::MotifFDialog) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_Create) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_FileTypes) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_SetFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_Config) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_BuildUI) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_SetListMode) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_MakeSList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_InterpFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_Update) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_LoadFiles) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_BrowseDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_ActivateDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_BrowseFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_ActivateFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_OkCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_FilterCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::MotifFDialog_CancelCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::ListBoxKeyAccel_Set) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::ListBoxKeyAccel_Unset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::ListBoxKeyAccel_Key) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::ListBoxKeyAccel_Goto) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::ListBoxKeyAccel_Reset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]]
-set auto_index(::tk::unsupported::ExposePrivateCommand) [list source -encoding utf-8 [file join $dir unsupported.tcl]]
-set auto_index(::tk::unsupported::ExposePrivateVariable) [list source -encoding utf-8 [file join $dir unsupported.tcl]]
-set auto_index(::tk::fontchooser) [list source -encoding utf-8 [file join $dir fontchooser.tcl]]
+set auto_index(::tk::dialog::error::Return) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::Details) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::SaveToLog) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::Destroy) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::bgerror) [list source [file join $dir bgerror.tcl]]
+set auto_index(bgerror) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::ButtonInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::ButtonAutoInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::CheckRadioInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::Config) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::Done) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::color::) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::InitValues) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::Config) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::BuildDialog) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::SetRGBValue) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::XToRgb) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RgbToX) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::DrawColorScale) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::CreateSelector) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RedrawFinalColor) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RedrawColorBars) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::StartMove) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::MoveSelector) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::ReleaseMouse) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::ResizeColorBars) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::HandleSelEntry) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::HandleRGBEntry) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::EnterColorBar) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::LeaveColorBar) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::OkCmd) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::CancelCmd) [list source [file join $dir clrpick.tcl]]
+set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]]
+set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Create) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_BindIn) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_BindOut) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Destroy) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_In) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Out) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FDGetFileTypes) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::ConsoleInit) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleSource) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleInvoke) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleHistory) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsolePrompt) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleBind) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleInsert) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleOutput) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleExit) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleAbout) [list source [file join $dir console.tcl]]
+set auto_index(tk_dialog) [list source [file join $dir dialog.tcl]]
+set auto_index(::tk::EntryClosestGap) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryButton1) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryMouseSelect) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryPaste) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryAutoScan) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryKeySelect) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryInsert) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryBackspace) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntrySeeInsert) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntrySetCursor) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryTranspose) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryPreviousWord) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryGetSelection) [list source [file join $dir entry.tcl]]
+set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]]
+set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]]
+set auto_index(::tk::FocusOK) [list source [file join $dir focus.tcl]]
+set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]]
+set auto_index(::tk::IconList) [list source [file join $dir iconlist.tcl]]
+set auto_index(::tk::ListboxBeginSelect) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxMotion) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxBeginExtend) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxBeginToggle) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxAutoScan) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxUpDown) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxExtendUpDown) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxDataExtend) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxCancel) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxSelectAll) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::Megawidget) [list source [file join $dir megawidget.tcl]]
+set auto_index(::tk::MbEnter) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbLeave) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbPost) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuUnpost) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbMotion) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbButtonUp) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuMotion) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuButtonDown) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuLeave) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuInvoke) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuEscape) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuUpArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuDownArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuLeftArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuRightArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuNextMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuNextEntry) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFind) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::TraverseToMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::FirstMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::TraverseWithinMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFirstEntry) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFindName) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::PostOverPoint) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::SaveGrabInfo) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::RestoreOldGrab) [list source [file join $dir menu.tcl]]
+set auto_index(tk_menuSetFocus) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::GenerateMenuSelect) [list source [file join $dir menu.tcl]]
+set auto_index(tk_popup) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::ensure_psenc_is_loaded) [list source [file join $dir mkpsenc.tcl]]
+set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]]
+set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]]
+set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]]
+set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]]
+set auto_index(::tk::Darken) [list source [file join $dir palette.tcl]]
+set auto_index(tk_bisque) [list source [file join $dir palette.tcl]]
+set auto_index(::safe::tkInterpInit) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::loadTk) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::TkInit) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::allowTk) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::disallowTk) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::tkDelete) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::tkTopLevel) [list source [file join $dir safetk.tcl]]
+set auto_index(::tk::ScaleActivate) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleButtonDown) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleDrag) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleEndDrag) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleIncrement) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleControlPress) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleButton2Down) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScalingPct) [list source [file join $dir scaling.tcl]]
+set auto_index(::tk::ScaleNum) [list source [file join $dir scaling.tcl]]
+set auto_index(::tk::FontScalingFactor) [list source [file join $dir scaling.tcl]]
+set auto_index(::tk::ScanMonitorsFile) [list source [file join $dir scaling.tcl]]
+set auto_index(::tk::ScrollButtonDown) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollButtonUp) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollSelect) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollStartDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollEndDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollByUnits) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollByPages) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollToPos) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollTopBottom) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollButton2Down) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::spinbox::Invoke) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ClosestGap) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ButtonDown) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ButtonUp) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::MouseSelect) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Paste) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Motion) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::AutoScan) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::KeySelect) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Insert) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Backspace) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::SeeInsert) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::SetCursor) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Transpose) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::PreviousWord) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::GetSelection) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::TearOffMenu) [list source [file join $dir tearoff.tcl]]
+set auto_index(::tk::MenuDup) [list source [file join $dir tearoff.tcl]]
+set auto_index(::tk::TextClosestGap) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextButton1) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextSelectTo) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextKeyExtend) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPaste) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextAutoScan) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextSetCursor) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextKeySelect) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextResetAnchor) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextInsert) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextUpDownLine) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPrevPara) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextNextPara) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextScrollPages) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextTranspose) [list source [file join $dir text.tcl]]
+set auto_index(tk_textCopy) [list source [file join $dir text.tcl]]
+set auto_index(tk_textCut) [list source [file join $dir text.tcl]]
+set auto_index(tk_textPaste) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextNextPos) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]]
+set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::MouseWheel) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::dialog::file::) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::SetPathSilently) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::SetPath) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::SetFilter) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::ResolveFile) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::EntFocusIn) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::EntFocusOut) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::ActivateEnt) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::VerifyFileName) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::InvokeBtn) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::UpDirCmd) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::JoinFile) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::OkCmd) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::CancelCmd) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::ListBrowse) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::ListInvoke) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::Done) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::MotifFDialog) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Create) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_FileTypes) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_SetFilter) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Config) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BuildUI) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_SetListMode) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Update) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::fontchooser) [list source [file join $dir fontchooser.tcl]]
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index 1591942..7b2ed66 100644
--- a/library/tearoff.tcl
+++ b/library/tearoff.tcl
@@ -138,14 +138,12 @@ proc ::tk::MenuDup {src dst type} {
# Copy the meny entries, if any
set last [$src index last]
- if {$last ne "none"} {
- for {set i [$src cget -tearoff]} {$i <= $last} {incr i} {
- set cmd [list $dst add [$src type $i] [$src id $i]]
- foreach option [$src entryconfigure $i] {
- lappend cmd [lindex $option 0] [lindex $option 4]
- }
- eval $cmd
+ for {set i [$src cget -tearoff]} {$i <= $last} {incr i} {
+ set cmd [list $dst add [$src type $i] [$src id $i]]
+ foreach option [$src entryconfigure $i] {
+ lappend cmd [lindex $option 0] [lindex $option 4]
}
+ eval $cmd
}
# Duplicate the binding tags from the source menu, replacing src with dst
diff --git a/library/tk.tcl b/library/tk.tcl
index 7916ccb..7741fd0 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -11,7 +11,7 @@
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
# Verify that we have Tk binary and script components from the same release
-package require -exact tk 8.7b1
+package require -exact tk 9.0b3
# Create a ::tk namespace
namespace eval ::tk {
@@ -498,7 +498,7 @@ switch -exact -- [tk windowingsystem] {
if {$::tk_library ne ""} {
proc ::tk::SourceLibFile {file} {
- namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]]
+ namespace eval :: [list source [file join $::tk_library $file.tcl]]
}
namespace eval ::tk {
SourceLibFile icons
@@ -713,7 +713,7 @@ if {[tk windowingsystem] eq "aqua"} {
#stub procedures to respond to "do script" Apple Events
proc ::tk::mac::DoScriptFile {file} {
uplevel #0 $file
- source -encoding utf-8 $file
+ source $file
}
proc ::tk::mac::DoScriptText {script} {
uplevel #0 $script
@@ -841,7 +841,7 @@ if {[tk windowingsystem] eq "x11"} {
# Run the Ttk themed widget set initialization
if {$::ttk::library ne ""} {
- uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl]
+ uplevel \#0 [list source $::ttk::library/ttk.tcl]
}
diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl
index 6711d6c..be72290 100644
--- a/library/ttk/clamTheme.tcl
+++ b/library/ttk/clamTheme.tcl
@@ -144,15 +144,15 @@ namespace eval ttk::theme::clam {
-labeloutside true -labelmargins {0 0 0 3p} \
-borderwidth 2 -relief raised
- ttk::style configure TScrollbar -gripcount 3.75p \
+ ttk::style configure TScrollbar -gripsize 7.5p \
-arrowsize 10.5p -width 10.5p
- ttk::style configure TScale -gripcount 3.75p \
+ ttk::style configure TScale -gripsize 7.5p \
-arrowsize 10.5p -sliderlength 22.5p
ttk::style configure TProgressbar -background $colors(-frame) \
-arrowsize 10.5p -sliderlength 22.5p
- ttk::style configure Sash -sashthickness 4.5p -gripcount 7.5p
+ ttk::style configure Sash -sashthickness 4.5p -gripsize 15p
}
}
diff --git a/library/unsupported.tcl b/library/unsupported.tcl
deleted file mode 100644
index b5f404a..0000000
--- a/library/unsupported.tcl
+++ /dev/null
@@ -1,269 +0,0 @@
-# unsupported.tcl --
-#
-# Commands provided by Tk without official support. Use them at your
-# own risk. They may change or go away without notice.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-
-# ----------------------------------------------------------------------
-# Unsupported compatibility interface for folks accessing Tk's private
-# commands and variable against recommended usage.
-# ----------------------------------------------------------------------
-
-namespace eval ::tk::unsupported {
-
- # Map from the old global names of Tk private commands to their
- # new namespace-encapsulated names.
-
- variable PrivateCommands
- array set PrivateCommands {
- tkButtonAutoInvoke ::tk::ButtonAutoInvoke
- tkButtonDown ::tk::ButtonDown
- tkButtonEnter ::tk::ButtonEnter
- tkButtonInvoke ::tk::ButtonInvoke
- tkButtonLeave ::tk::ButtonLeave
- tkButtonUp ::tk::ButtonUp
- tkCancelRepeat ::tk::CancelRepeat
- tkCheckRadioDown ::tk::CheckRadioDown
- tkCheckRadioEnter ::tk::CheckRadioEnter
- tkCheckRadioInvoke ::tk::CheckRadioInvoke
- tkColorDialog ::tk::dialog::color::
- tkColorDialog_BuildDialog ::tk::dialog::color::BuildDialog
- tkColorDialog_CancelCmd ::tk::dialog::color::CancelCmd
- tkColorDialog_Config ::tk::dialog::color::Config
- tkColorDialog_CreateSelector ::tk::dialog::color::CreateSelector
- tkColorDialog_DrawColorScale ::tk::dialog::color::DrawColorScale
- tkColorDialog_EnterColorBar ::tk::dialog::color::EnterColorBar
- tkColorDialog_InitValues ::tk::dialog::color::InitValues
- tkColorDialog_HandleRGBEntry ::tk::dialog::color::HandleRGBEntry
- tkColorDialog_HandleSelEntry ::tk::dialog::color::HandleSelEntry
- tkColorDialog_LeaveColorBar ::tk::dialog::color::LeaveColorBar
- tkColorDialog_MoveSelector ::tk::dialog::color::MoveSelector
- tkColorDialog_OkCmd ::tk::dialog::color::OkCmd
- tkColorDialog_RedrawColorBars ::tk::dialog::color::RedrawColorBars
- tkColorDialog_RedrawFinalColor ::tk::dialog::color::RedrawFinalColor
- tkColorDialog_ReleaseMouse ::tk::dialog::color::ReleaseMouse
- tkColorDialog_ResizeColorBars ::tk::dialog::color::ResizeColorBars
- tkColorDialog_RgbToX ::tk::dialog::color::RgbToX
- tkColorDialog_SetRGBValue ::tk::dialog::color::SetRGBValue
- tkColorDialog_StartMove ::tk::dialog::color::StartMove
- tkColorDialog_XToRgb ::tk::dialog::color::XToRGB
- tkConsoleAbout ::tk::ConsoleAbout
- tkConsoleBind ::tk::ConsoleBind
- tkConsoleExit ::tk::ConsoleExit
- tkConsoleHistory ::tk::ConsoleHistory
- tkConsoleInit ::tk::ConsoleInit
- tkConsoleInsert ::tk::ConsoleInsert
- tkConsoleInvoke ::tk::ConsoleInvoke
- tkConsoleOutput ::tk::ConsoleOutput
- tkConsolePrompt ::tk::ConsolePrompt
- tkConsoleSource ::tk::ConsoleSource
- tkDarken ::tk::Darken
- tkEntryAutoScan ::tk::EntryAutoScan
- tkEntryBackspace ::tk::EntryBackspace
- tkEntryButton1 ::tk::EntryButton1
- tkEntryClosestGap ::tk::EntryClosestGap
- tkEntryGetSelection ::tk::EntryGetSelection
- tkEntryInsert ::tk::EntryInsert
- tkEntryKeySelect ::tk::EntryKeySelect
- tkEntryMouseSelect ::tk::EntryMouseSelect
- tkEntryNextWord ::tk::EntryNextWord
- tkEntryPaste ::tk::EntryPaste
- tkEntryPreviousWord ::tk::EntryPreviousWord
- tkEntrySeeInsert ::tk::EntrySeeInsert
- tkEntrySetCursor ::tk::EntrySetCursor
- tkEntryTranspose ::tk::EntryTranspose
- tkEventMotifBindings ::tk::EventMotifBindings
- tkFDGetFileTypes ::tk::FDGetFileTypes
- tkFirstMenu ::tk::FirstMenu
- tkFocusGroup_BindIn ::tk::FocusGroup_BindIn
- tkFocusGroup_BindOut ::tk::FocusGroup_BindOut
- tkFocusGroup_Create ::tk::FocusGroup_Create
- tkFocusGroup_Destroy ::tk::FocusGroup_Destroy
- tkFocusGroup_In ::tk::FocusGroup_In
- tkFocusGroup_Out ::tk::FocusGroup_Out
- tkFocusOK ::tk::FocusOK
- tkGenerateMenuSelect ::tk::GenerateMenuSelect
- tkIconList ::tk::IconList
- tkListbox ::tk::Listbox
- tkListboxAutoScan ::tk::ListboxAutoScan
- tkListboxBeginExtend ::tk::ListboxBeginExtend
- tkListboxBeginSelect ::tk::ListboxBeginSelect
- tkListboxBeginToggle ::tk::ListboxBeginToggle
- tkListboxCancel ::tk::ListboxCancel
- tkListboxDataExtend ::tk::ListboxDataExtend
- tkListboxExtendUpDown ::tk::ListboxExtendUpDown
- tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto
- tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key
- tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset
- tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set
- tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet
- tkListboxMotion ::tk::ListboxMotion
- tkListboxSelectAll ::tk::ListboxSelectAll
- tkListboxUpDown ::tk::ListboxUpDown
- tkListboxBeginToggle ::tk::ListboxBeginToggle
- tkMbButtonUp ::tk::MbButtonUp
- tkMbEnter ::tk::MbEnter
- tkMbLeave ::tk::MbLeave
- tkMbMotion ::tk::MbMotion
- tkMbPost ::tk::MbPost
- tkMenuButtonDown ::tk::MenuButtonDown
- tkMenuDownArrow ::tk::MenuDownArrow
- tkMenuDup ::tk::MenuDup
- tkMenuEscape ::tk::MenuEscape
- tkMenuFind ::tk::MenuFind
- tkMenuFindName ::tk::MenuFindName
- tkMenuFirstEntry ::tk::MenuFirstEntry
- tkMenuInvoke ::tk::MenuInvoke
- tkMenuLeave ::tk::MenuLeave
- tkMenuLeftArrow ::tk::MenuLeftArrow
- tkMenuMotion ::tk::MenuMotion
- tkMenuNextEntry ::tk::MenuNextEntry
- tkMenuNextMenu ::tk::MenuNextMenu
- tkMenuRightArrow ::tk::MenuRightArrow
- tkMenuUnpost ::tk::MenuUnpost
- tkMenuUpArrow ::tk::MenuUpArrow
- tkMessageBox ::tk::MessageBox
- tkMotifFDialog ::tk::MotifFDialog
- tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList
- tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList
- tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt
- tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt
- tkMotifFDialog ::tk::MotifFDialog
- tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList
- tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList
- tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI
- tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd
- tkMotifFDialog_Config ::tk::MotifFDialog_Config
- tkMotifFDialog_Create ::tk::MotifFDialog_Create
- tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes
- tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd
- tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter
- tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles
- tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList
- tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd
- tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter
- tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode
- tkMotifFDialog_Update ::tk::MotifFDialog_Update
- tkPostOverPoint ::tk::PostOverPoint
- tkRecolorTree ::tk::RecolorTree
- tkRestoreOldGrab ::tk::RestoreOldGrab
- tkSaveGrabInfo ::tk::SaveGrabInfo
- tkScaleActivate ::tk::ScaleActivate
- tkScaleButtonDown ::tk::ScaleButtonDown
- tkScaleButton2Down ::tk::ScaleButton2Down
- tkScaleControlPress ::tk::ScaleControlPress
- tkScaleDrag ::tk::ScaleDrag
- tkScaleEndDrag ::tk::ScaleEndDrag
- tkScaleIncrement ::tk::ScaleIncrement
- tkScreenChanged ::tk::ScreenChanged
- tkScrollButtonDown ::tk::ScrollButtonDown
- tkScrollButton2Down ::tk::ScrollButton2Down
- tkScrollButtonDrag ::tk::ScrollButtonDrag
- tkScrollButtonUp ::tk::ScrollButtonUp
- tkScrollByPages ::tk::ScrollByPages
- tkScrollByUnits ::tk::ScrollByUnits
- tkScrollEndDrag ::tk::ScrollEndDrag
- tkScrollSelect ::tk::ScrollSelect
- tkScrollStartDrag ::tk::ScrollStartDrag
- tkScrollTopBottom ::tk::ScrollTopBottom
- tkScrollToPos ::tk::ScrollToPos
- tkTabToWindow ::tk::TabToWindow
- tkTearOffMenu ::tk::TearOffMenu
- tkTextAutoScan ::tk::TextAutoScan
- tkTextButton1 ::tk::TextButton1
- tkTextClosestGap ::tk::TextClosestGap
- tkTextInsert ::tk::TextInsert
- tkTextKeyExtend ::tk::TextKeyExtend
- tkTextKeySelect ::tk::TextKeySelect
- tkTextNextPara ::tk::TextNextPara
- tkTextNextPos ::tk::TextNextPos
- tkTextNextWord ::tk::TextNextWord
- tkTextPaste ::tk::TextPaste
- tkTextPrevPara ::tk::TextPrevPara
- tkTextPrevPos ::tk::TextPrevPos
- tkTextPrevWord ::tk::TextPrevWord
- tkTextResetAnchor ::tk::TextResetAnchor
- tkTextScrollPages ::tk::TextScrollPages
- tkTextSelectTo ::tk::TextSelectTo
- tkTextSetCursor ::tk::TextSetCursor
- tkTextTranspose ::tk::TextTranspose
- tkTextUpDownLine ::tk::TextUpDownLine
- tkTraverseToMenu ::tk::TraverseToMenu
- tkTraverseWithinMenu ::tk::TraverseWithinMenu
- unsupported1 ::tk::unsupported::MacWindowStyle
- }
-
- # Map from the old global names of Tk private variable to their
- # new namespace-encapsulated names.
-
- variable PrivateVariables
- array set PrivateVariables {
- droped_to_start ::tk::mac::Droped_to_start
- histNum ::tk::HistNum
- stub_location ::tk::mac::Stub_location
- tkFocusIn ::tk::FocusIn
- tkFocusOut ::tk::FocusOut
- tkPalette ::tk::Palette
- tkPriv ::tk::Priv
- tkPrivMsgBox ::tk::PrivMsgBox
- }
-}
-
-# ::tk::unsupported::ExposePrivateCommand --
-#
-# Expose one of Tk's private commands to be visible under its
-# old global name
-#
-# Arguments:
-# cmd Global name by which the command was once known,
-# or a glob-style pattern.
-#
-# Results:
-# None.
-#
-# Side effects:
-# The old command name in the global namespace is aliased to the
-# new private name.
-
-proc ::tk::unsupported::ExposePrivateCommand {cmd} {
- variable PrivateCommands
- set cmds [array get PrivateCommands $cmd]
- if {[llength $cmds] == 0} {
- return -code error -errorcode {TK EXPOSE_PRIVATE_COMMAND} \
- "No compatibility support for \[$cmd]"
- }
- foreach {old new} $cmds {
- namespace eval :: [list interp alias {} $old {}] $new
- }
-}
-
-# ::tk::unsupported::ExposePrivateVariable --
-#
-# Expose one of Tk's private variables to be visible under its
-# old global name
-#
-# Arguments:
-# var Global name by which the variable was once known,
-# or a glob-style pattern.
-#
-# Results:
-# None.
-#
-# Side effects:
-# The old variable name in the global namespace is aliased to the
-# new private name.
-
-proc ::tk::unsupported::ExposePrivateVariable {var} {
- variable PrivateVariables
- set vars [array get PrivateVariables $var]
- if {[llength $vars] == 0} {
- return -code error -errorcode {TK EXPOSE_PRIVATE_VARIABLE} \
- "No compatibility support for \$$var"
- }
- namespace eval ::tk::mac {}
- foreach {old new} $vars {
- namespace eval :: [list upvar "#0" $new $old]
- }
-}
diff --git a/macosx/README b/macosx/README
index 64be140..c6159a6 100644
--- a/macosx/README
+++ b/macosx/README
@@ -477,9 +477,9 @@ https://developer.apple.com/library/mac/documentation/Cocoa/\
Reference/ApplicationKit/Classes/NSApplication_Class)
void NSApplicationMain(int argc, char *argv[]) {
- [NSApplication sharedApplication];
- [NSBundle loadNibNamed:@"myMain" owner:NSApp];
- [NSApp run];
+ [NSApplication sharedApplication];
+ [NSBundle loadNibNamed:@"myMain" owner:NSApp];
+ [NSApp run];
}
Here NSApp is a standard global variable, initialized by the OS, which
points to an object in a subclass of NSApplication (called
diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj
index 6aa8d2d..b82f51f 100644
--- a/macosx/Tk.xcodeproj/project.pbxproj
+++ b/macosx/Tk.xcodeproj/project.pbxproj
@@ -1000,7 +1000,6 @@
F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; };
F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = "<group>"; };
F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; };
- F966BB8608F27A3A005CB29B /* obsolete.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obsolete.tcl; sourceTree = "<group>"; };
F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; };
F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; };
F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
@@ -1013,7 +1012,6 @@
F966BB9108F27A3B005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; };
F966BB9208F27A3B005CB29B /* tk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.tcl; sourceTree = "<group>"; };
F966BB9308F27A3B005CB29B /* tkfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkfbox.tcl; sourceTree = "<group>"; };
- F966BB9408F27A3B005CB29B /* unsupported.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unsupported.tcl; sourceTree = "<group>"; };
F966BB9508F27A3B005CB29B /* xmfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.tcl; sourceTree = "<group>"; };
F966BB9608F27A3B005CB29B /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; };
F966BBBA08F27A3B005CB29B /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; };
@@ -2451,7 +2449,6 @@
F966BB7408F27A3A005CB29B /* menu.tcl */,
F966BB7508F27A3A005CB29B /* mkpsenc.tcl */,
F966BB7608F27A3A005CB29B /* msgbox.tcl */,
- F966BB8608F27A3A005CB29B /* obsolete.tcl */,
F966BB8708F27A3A005CB29B /* optMenu.tcl */,
F966BB8808F27A3A005CB29B /* palette.tcl */,
F966BB8908F27A3B005CB29B /* panedwindow.tcl */,
@@ -2465,7 +2462,6 @@
F966BB9208F27A3B005CB29B /* tk.tcl */,
F966BB9308F27A3B005CB29B /* tkfbox.tcl */,
F96888360AF787B3000797B5 /* ttk */,
- F966BB9408F27A3B005CB29B /* unsupported.tcl */,
F966BB9508F27A3B005CB29B /* xmfbox.tcl */,
);
path = library;
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c
index f16ab0d..8d5f727 100644
--- a/macosx/tkMacOSXClipboard.c
+++ b/macosx/tkMacOSXClipboard.c
@@ -126,8 +126,8 @@ TkSelGetSelection(
([[NSPasteboard generalPasteboard] changeCount] != changeCount);
if (dispPtr && (haveExternalClip || dispPtr->clipboardActive)
- && selection == dispPtr->clipboardAtom
- && (target == XA_STRING || target == dispPtr->utf8Atom)) {
+ && selection == dispPtr->clipboardAtom
+ && (target == XA_STRING || target == dispPtr->utf8Atom)) {
NSString *string = nil;
NSPasteboard *pb = [NSPasteboard generalPasteboard];
NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject:
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 978b9d6..ffaadd9 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -52,7 +52,7 @@ static void initColorTable()
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
darkAqua = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
- lightAqua = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
+ lightAqua = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
}
#endif
@@ -103,7 +103,7 @@ static void initColorTable()
name = (char *)ckalloc(length + 1);
strcpy(name, key.UTF8String);
name[0] = (char)toupper(UCHAR(name[0]));
- if (!strcmp(name, "WindowBackgroundColor")) {
+ if (!strcmp(name, "WindowBackgroundColor")) {
/*
* Avoid black windows on old systems.
@@ -192,8 +192,8 @@ TkMacOSXRGBPixel(
MacPixel p = {0};
p.pixel.colortype = rgbColor;
p.pixel.value = (unsigned int)(((red & 0xff) << 16) |
- ((green & 0xff) << 8) |
- (blue & 0xff));
+ ((green & 0xff) << 8) |
+ (blue & 0xff));
return p.ulong;
}
@@ -436,7 +436,7 @@ TkMacOSXInDarkMode(Tk_Window tkwin)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
- TkWindow *winPtr = (TkWindow*) tkwin;
+ TkWindow *winPtr = (TkWindow*) tkwin;
NSAppearanceName name;
NSView *view = nil;
if (winPtr && winPtr->privatePtr) {
@@ -611,6 +611,7 @@ TkpGetColor(
XColor color;
Colormap colormap = tkwin ? Tk_Colormap(tkwin) : noColormap;
NSView *view = nil;
+ Bool haveValidXColor = False;
static Bool initialized = NO;
if (!initialized) {
@@ -638,16 +639,22 @@ TkpGetColor(
p.pixel.colortype = entry->type;
p.pixel.value = (unsigned int)entry->index;
color.pixel = p.ulong;
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ NSAppearance *windowAppearance;
+ if (@available(macOS 10.14, *)) {
+ if (view) {
+ windowAppearance = [view effectiveAppearance];
+ } else {
+ windowAppearance = [NSApp effectiveAppearance];
+ }
+ }
+#endif
+
if (entry->type == semantic) {
CGFloat rgba[4];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
- NSAppearance *windowAppearance;
- if (view) {
- windowAppearance = [view effectiveAppearance];
- } else {
- windowAppearance = [NSApp effectiveAppearance];
- }
if ([windowAppearance name] == NSAppearanceNameDarkAqua) {
colormap = darkColormap;
} else {
@@ -671,13 +678,13 @@ TkpGetColor(
} else {
GetRGBA(entry, p.ulong, rgba);
}
-#else
+#else //MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
GetRGBA(entry, p.ulong, rgba);
-#endif
color.red = (unsigned short)(rgba[0] * 65535.0);
color.green = (unsigned short)(rgba[1] * 65535.0);
color.blue = (unsigned short)(rgba[2] * 65535.0);
- goto validXColor;
+#endif //MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ haveValidXColor = True;
} else if (SetCGColorComponents(entry, 0, &c)) {
const size_t n = CGColorGetNumberOfComponents(c);
const CGFloat *rgba = CGColorGetComponents(c);
@@ -695,15 +702,26 @@ TkpGetColor(
Tcl_Panic("CGColor with %d components", (int) n);
}
CGColorRelease(c);
- goto validXColor;
+ haveValidXColor = True;
+ }
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ if (@available(macOS 10.14, *)) {
+ // Not sure whether colormap should also be set for non-semantic color
+ if (haveValidXColor && entry->type == semantic) {
+ if ([windowAppearance name] == NSAppearanceNameDarkAqua) {
+ colormap = darkColormap;
+ } else {
+ colormap = lightColormap;
+ }
+ }
}
+#endif
}
}
- if (TkParseColor(display, colormap, name, &color) == 0) {
+ if (!haveValidXColor && TkParseColor(display, colormap, name, &color) == 0) {
return NULL;
}
-validXColor:
tkColPtr = (TkColor *)ckalloc(sizeof(TkColor));
tkColPtr->colormap = colormap;
tkColPtr->color = color;
diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h
index fd4881c..ab5a3b4 100644
--- a/macosx/tkMacOSXColor.h
+++ b/macosx/tkMacOSXColor.h
@@ -38,10 +38,6 @@ enum colorType {
rgbColor, /* The 24 bit value is an rgb color. */
clearColor, /* The unique rgba color with all channels 0. */
HIBrush, /* A HITheme brush color.*/
-#if TCL_MAJOR_VERSION < 9
- HIText, /* A HITheme text color (32-bit only). */
- HIBackground, /* A HITheme background color (32-bit only). */
-#endif
ttkBackground, /* A background color which indicates nesting level.*/
semantic, /* A semantic NSColor.*/
};
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index 4bde36a..60430be 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -379,8 +379,8 @@
#define DEF_MESSAGE_HIGHLIGHT NORMAL_FG
#define DEF_MESSAGE_HIGHLIGHT_WIDTH "0"
#define DEF_MESSAGE_JUSTIFY "left"
-#define DEF_MESSAGE_PADX "-1"
-#define DEF_MESSAGE_PADY "-1"
+#define DEF_MESSAGE_PADX NULL
+#define DEF_MESSAGE_PADY NULL
#define DEF_MESSAGE_RELIEF "flat"
#define DEF_MESSAGE_TAKE_FOCUS "0"
#define DEF_MESSAGE_TEXT ""
@@ -475,7 +475,7 @@
#define DEF_SCROLLBAR_BORDER_WIDTH "0"
#define DEF_SCROLLBAR_COMMAND ""
#define DEF_SCROLLBAR_CURSOR ""
-#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1"
+#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL
#define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG
#define DEF_SCROLLBAR_HIGHLIGHT NORMAL_FG
#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0"
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 2aaf4ba..8ebdde4 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -86,7 +86,7 @@ TkMacOSXInitCGDrawing(
}
if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit",
- (char *)&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
+ &cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
Tcl_ResetResult(interp);
}
cgAntiAliasLimit = limit;
@@ -96,11 +96,11 @@ TkMacOSXInitCGDrawing(
*/
if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel",
- (char *)&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
+ &useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame",
- (char *)&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
+ &useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
transparentColor = TkMacOSXClearPixel();
@@ -264,7 +264,8 @@ Tk_MacOSXGetCGContextForDrawable(
colorspace = CGColorSpaceCreateDeviceRGB();
bitmapInfo |= kCGImageAlphaPremultipliedFirst;
}
- macDraw->context = CGBitmapContextCreate(NULL, (unsigned)macDraw->size.width,
+ macDraw->context = CGBitmapContextCreate(NULL,
+ (unsigned)macDraw->size.width,
(unsigned)macDraw->size.height, bitsPerComponent, 0,
colorspace, bitmapInfo);
if (macDraw->context) {
@@ -283,7 +284,8 @@ Tk_MacOSXGetCGContextForDrawable(
*
* TkMacOSXDrawCGImage --
*
- * Draw CG image into drawable.
+ * Draw CG image into drawable. The entire image is used, and will
+ * be rescaled if its dimensions do not equal dstBounds.size.
*
* Results:
* None.
@@ -302,25 +304,11 @@ TkMacOSXDrawCGImage(
CGImageRef image,
unsigned long imageForeground,
unsigned long imageBackground,
- CGRect imageBounds,
- CGRect srcBounds,
CGRect dstBounds)
{
MacDrawable *macDraw = (MacDrawable *)d;
if (macDraw && context && image) {
- CGImageRef subImage = NULL;
-
- if (!CGRectEqualToRect(imageBounds, srcBounds)) {
- if (!CGRectContainsRect(imageBounds, srcBounds)) {
- TkMacOSXDbgMsg("Mismatch of sub CGImage bounds");
- }
- subImage = CGImageCreateWithImageInRect(image, CGRectOffset(
- srcBounds, -imageBounds.origin.x, -imageBounds.origin.y));
- if (subImage) {
- image = subImage;
- }
- }
dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff);
if (CGImageIsMask(image)) {
if (macDraw->flags & TK_IS_BW_PIXMAP) {
@@ -369,9 +357,6 @@ TkMacOSXDrawCGImage(
CGContextDrawImage(context, dstBounds, image);
CGContextRestoreGState(context);
#endif /* TK_MAC_DEBUG_IMAGE_DRAWING */
- if (subImage) {
- CFRelease(subImage);
- }
} else {
TkMacOSXDbgMsg("Drawing of empty CGImage requested");
}
@@ -434,16 +419,16 @@ XDrawLines(
}
}
- /*
- * In the case of closed polylines, the first and last points are the
- * same. We want miter or bevel join be rendered also at this point,
- * this needs telling CoreGraphics that the path is closed.
- */
+ /*
+ * In the case of closed polylines, the first and last points are the
+ * same. We want miter or bevel join be rendered also at this point,
+ * this needs telling CoreGraphics that the path is closed.
+ */
- if ((points[0].x == points[npoints-1].x) &&
- (points[0].y == points[npoints-1].y)) {
- CGContextClosePath(dc.context);
- }
+ if ((points[0].x == points[npoints-1].x) &&
+ (points[0].y == points[npoints-1].y)) {
+ CGContextClosePath(dc.context);
+ }
CGContextStrokePath(dc.context);
}
TkMacOSXRestoreDrawingContext(&dc);
@@ -1093,6 +1078,23 @@ XFillArcs(
* Results:
* Returns 0 if the scroll generated no additional damage. Otherwise, sets
* the region that needs to be repainted after scrolling and returns 1.
+ * When drawRect was in use, this function used the now deprecated
+ * scrollRect method of NSView. With the current updateLayer
+ * implementation, using a CGImage as the view's backing layer, we are
+ * able to use XCopyArea. But both implementations are incomplete.
+ * They return a damage area which is just the source rectangle minus
+ * destination rectangle. Other platforms, e.g. Windows, where
+ * this function is essentially provided by the windowing system,
+ * are able to add to the damage region the bounding rectangles of
+ * all subwindows which meet the source rectangle, even if they are
+ * contained in the destination rectangle. The information needed
+ * to do that is not available in this module, as far as I know.
+ *
+ * In fact, the Text widget is the only one which calls this
+ * function, and textDisp.c compensates for this defect by using
+ * macOS-specific code. This is possible because access to the
+ * list of all embedded windows in a Text widget is available in
+ * that module.
*
* Side effects:
* Scrolls the bits in the window.
@@ -1103,36 +1105,21 @@ XFillArcs(
int
TkScrollWindow(
Tk_Window tkwin, /* The window to be scrolled. */
- TCL_UNUSED(GC), /* GC for window to be scrolled. */
+ GC gc, /* GC for window to be scrolled. */
int x, int y, /* Position rectangle to be scrolled. */
int width, int height,
int dx, int dy, /* Distance rectangle should be moved. */
Region damageRgn) /* Region to accumulate damage in. */
{
Drawable drawable = Tk_WindowId(tkwin);
- MacDrawable *macDraw = (MacDrawable *)drawable;
- TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(macDraw);
HIShapeRef srcRgn, dstRgn;
HIMutableShapeRef dmgRgn = HIShapeCreateMutable();
- NSRect bounds, viewSrcRect, srcRect, dstRect;
+ NSRect srcRect, dstRect;
int result = 0;
- if (view) {
-
- /*
- * Get the scroll area in NSView coordinates (origin at bottom left).
- */
-
- bounds = [view bounds];
- viewSrcRect = NSMakeRect(macDraw->xOff + x,
- bounds.size.height - height - (macDraw->yOff + y),
- width, height);
-
- /*
- * Scroll the rectangle.
- */
-
- [view scrollRect:viewSrcRect by:NSMakeSize(dx, -dy)];
+ // Should behave more like TkScrollWindow on other platforms
+ if (XCopyArea(Tk_Display(tkwin), drawable, drawable, gc, x, y,
+ (unsigned)width, (unsigned)height, x+dx, y+dy) == Success) {
/*
* Compute the damage region, using Tk coordinates (origin at top left).
@@ -1237,14 +1224,19 @@ TkMacOSXSetupDrawingContext(
* Intersect the drawable's clipping region with the region stored in the
* X GC. If the resulting region is empty, don't do any drawing.
*/
-
+//#if 0 // disable clipping (almost works, but windows can open up blank)
dc.clipRgn = TkMacOSXGetClipRgn(d);
ClipToGC(d, gc, &dc.clipRgn);
if (dc.clipRgn && HIShapeIsEmpty(dc.clipRgn)) {
+ /*
+ * Things are probably not set up for drawing yet. Request a call to
+ * updateLayer and return failure.
+ */
canDraw = false;
+ [view setNeedsDisplay:YES];
goto end;
}
-
+//#endif //disable clipping
/*
* If the drawable already has a CGContext, use it. Otherwise, we must be
* drawing to a window and we use the current context of its ContentView.
@@ -1252,53 +1244,67 @@ TkMacOSXSetupDrawingContext(
dc.context = TkMacOSXGetCGContextForDrawable(d);
if (!dc.context) {
- NSRect drawingBounds, currentBounds;
dc.view = view;
- dc.context = GET_CGCONTEXT;
+ dc.context = view.tkLayerBitmapContext;
if (dc.clipRgn) {
CGRect clipBounds;
CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
.ty = [view bounds].size.height};
HIShapeGetBounds(dc.clipRgn, &clipBounds);
clipBounds = CGRectApplyAffineTransform(clipBounds, t);
- drawingBounds = NSRectFromCGRect(clipBounds);
- } else {
- drawingBounds = [view bounds];
}
/*
- * We can only draw into the NSView which is the current focusView.
- * When the current [NSView focusView] is nil, the CGContext for
- * [NSGraphicsContext currentContext] is nil. Otherwise the current
- * CGContext draws into the current focusView. An NSView is guaranteed
- * to be the focusView when its drawRect or setFrame methods are
- * running. Prior to OSX 10.14 it was also possible to call the
- * lockFocus method to force an NSView to become the current focusView.
- * But that method was deprecated in 10.14 and so is no longer used by
- * Tk. Instead, if the view is not the current focusView then we add
- * the drawing bounds to its dirty rectangle and return false. The
- * part of the view inside the drawing bounds will get redrawn during
- * the next call to its drawRect method.
+ * Mark the view as needing to be redisplayed, since we are drawing
+ * to its backing layer.
*/
- if (view != [NSView focusView]) {
- [view addTkDirtyRect:drawingBounds];
- canDraw = false;
- goto end;
- }
+ [view setTkNeedsDisplay:YES];
/*
- * Drawing will also fail when the view is the current focusView but
- * the clipping rectangle set by drawRect does not contain the clipping
- * region of our drawing context. (See bug [2a61eca3a8].) If part of
- * the drawing bounds will be clipped then we draw whatever we can, but
- * we also add the drawing bounds to the view's dirty rectangle so it
- * will get redrawn in the next call to its drawRect method.
+ * Workaround for an Apple bug.
+ *
+ * Without the block below, ttk frames, labelframes and labels do not
+ * get the correct background color on macOS 12.5 after the appearance
+ * changes. This function is only called when drawing, so we know that
+ * our view is the focus view. Even though the effective appearance of
+ * the view has been changed, the currentAppearance, i.e. the
+ * appearance that will be used for drawing, may not have been changed
+ * to match.
+ *
+ * Prior to macOS 12.0 the currentAppearance property of NSAppearance
+ * was settable. In macOS 12.0 currentAppearance was deprecated and
+ * replaced by the read-only property currentDrawingAppearance. The
+ * ttk color issues are fixed by setting the currentAppearance to
+ * the effectiveAppearance of the view. So we are forced to use this
+ * deprecated function until Apple fixes this.
+ *
+ * It is a mystery why this only affects the ttk widgets. A possible
+ * clue is that when drawing a ttk widget this function is called with
+ * a NULL gc, whereas the gc is non-null when it is called for drawing
+ * a Tk widget. This means that the CGContext setup below is not done
+ * for ttk widgets. Perhaps that setup triggers an update of the
+ * currentAppearance property, but that has not been verified.
*/
- currentBounds = NSRectFromCGRect(CGContextGetClipBoundingBox(dc.context));
- if (!NSContainsRect(currentBounds, drawingBounds)) {
- [view addTkDirtyRect:drawingBounds];
+ if (@available(macOS 12.0, *)) {
+ NSAppearance *current = NSAppearance.currentDrawingAppearance;
+ NSAppearance *effective = view.effectiveAppearance;
+ if( current != effective) {
+ // printf("Appearances are out of sync!\n");
+ // Deprecations be damned!
+ NSAppearance.currentAppearance = effective;
+ }
+ } else {
+ /*
+ *It is not clear if this is a problem before macos 12.0, but
+ * we might as well do the update anyway.
+ */
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+/* currentAppearance is not deprecated. */
+ NSAppearance.currentAppearance = view.effectiveAppearance;
+#endif
}
}
@@ -1324,6 +1330,7 @@ TkMacOSXSetupDrawingContext(
};
CGContextConcatCTM(dc.context, t);
}
+//#if 0 // disable clipping
if (dc.clipRgn) {
#ifdef TK_MAC_DEBUG_DRAWING
@@ -1369,6 +1376,8 @@ TkMacOSXSetupDrawingContext(
CGContextClipToRect(dc.context, r);
}
}
+//#endif //disable clipping
+
if (gc) {
static const CGLineCap cgCap[] = {
[CapNotLast] = kCGLineCapButt,
@@ -1438,6 +1447,8 @@ end:
dc.clipRgn = NULL;
}
*dcPtr = dc;
+ // The goal is to allow immediate drawing; canDraw == 0 should happen far less often.
+ if (0) fprintf(stderr, "tkmacosxsdc canDraw %d\n", canDraw);
return canDraw;
}
@@ -1524,10 +1535,13 @@ TkMacOSXGetClipRgn(
}
if (macDraw->drawRgn) {
+ // The drawRgn is the visRgn intersected with a rectangle which
+ // may be smaller than the widget bounds.
clipRgn = HIShapeCreateCopy(macDraw->drawRgn);
} else if (macDraw->visRgn) {
clipRgn = HIShapeCreateCopy(macDraw->visRgn);
}
+ // A NULL clipRgn does not allow any drawing at all.
return clipRgn;
}
@@ -1537,7 +1551,9 @@ TkMacOSXGetClipRgn(
* Tk_ClipDrawableToRect --
*
* Clip all drawing into the drawable d to the given rectangle. If width
- * or height are negative, reset to no clipping.
+ * or height are negative, reset to no clipping.bThis is called by the
+ * Text widget to display each DLine, and by the Canvas widget when it
+ * is updating a sub rectangle in the canvas.
*
* Results:
* None.
@@ -1566,7 +1582,10 @@ Tk_ClipDrawableToRect(
width, height);
HIShapeRef drawRgn = HIShapeCreateWithRect(&clipRect);
- if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
+ // When drawing a Text widget we can reuse the
+ // clipping region for different DLines, so we don't want to
+ // update unless necessary.
+ if (macDraw->winPtr && (macDraw->flags & TK_CLIP_INVALID)) {
TkMacOSXUpdateClipRgn(macDraw->winPtr);
}
if (macDraw->visRgn) {
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index ef4f44d..f95d5d1 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -850,12 +850,12 @@ EmbedStructureProc(
if (eventPtr->type == ConfigureNotify) {
/*
- * Send a ConfigureNotify to the embedded application.
- */
+ * Send a ConfigureNotify to the embedded application.
+ */
- if (containerPtr->embeddedPtr != NULL) {
- TkDoConfigureNotify(containerPtr->embeddedPtr);
- }
+ if (containerPtr->embeddedPtr != NULL) {
+ TkDoConfigureNotify(containerPtr->embeddedPtr);
+ }
if (containerPtr->embedded != None) {
/*
* Ignore errors, since the embedded application could have
diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c
index 4f36915..63493bc 100644
--- a/macosx/tkMacOSXEvent.c
+++ b/macosx/tkMacOSXEvent.c
@@ -35,7 +35,7 @@ enum {
switch ((NSInteger)type) {
case NSAppKitDefined:
- subtype = [theEvent subtype];
+ subtype = [theEvent subtype];
switch (subtype) {
/* Ignored at the moment. */
@@ -49,11 +49,11 @@ enum {
break;
case NSWindowMovedEventType:
break;
- case NSWindowWillMoveEventType:
- break;
+ case NSWindowWillMoveEventType:
+ break;
- default:
- break;
+ default:
+ break;
}
break; /* AppkitEvent. Return theEvent */
case NSKeyUp:
@@ -80,7 +80,7 @@ enum {
break; /* Mouse event. Return the processed event. */
#if 0
case NSSystemDefined:
- subtype = [theEvent subtype];
+ subtype = [theEvent subtype];
break;
case NSApplicationDefined: {
id win;
@@ -88,14 +88,14 @@ enum {
break;
}
case NSCursorUpdate:
- break;
+ break;
case NSEventTypeGesture:
case NSEventTypeMagnify:
case NSEventTypeRotate:
case NSEventTypeSwipe:
case NSEventTypeBeginGesture:
case NSEventTypeEndGesture:
- break;
+ break;
#endif
default:
diff --git a/macosx/tkMacOSXFileTypes.c b/macosx/tkMacOSXFileTypes.c
index 5df7ddd..acf2da9 100644
--- a/macosx/tkMacOSXFileTypes.c
+++ b/macosx/tkMacOSXFileTypes.c
@@ -26,9 +26,9 @@ without generating deprecation warnings.
#include "tkMacOSXPrivate.h"
#define CHARS_TO_OSTYPE(string) (OSType) string[0] << 24 | \
- (OSType) string[1] << 16 | \
- (OSType) string[2] << 8 | \
- (OSType) string[3]
+ (OSType) string[1] << 16 | \
+ (OSType) string[2] << 8 | \
+ (OSType) string[3]
MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) {
char string[5];
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index f9cd9bc..ad86305 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -27,6 +27,26 @@
*/
/*
+ * TclNumUtfChars() is the same as Tcl_NumUtfChars(), but counting
+ * in UTF-16 in stead of UTF-32. For Tcl 8.7 it's a little bit
+ * tricky to get this function, because we are compiling with
+ * TCL_UTF_MAX=4. Same for TclUtfAtIndex()
+ */
+#if TCL_MAJOR_VERSION < 9
+# undef TclNumUtfChars
+# undef TclUtfAtIndex
+# ifdef USE_TCL_STUBS
+# define TclNumUtfChars \
+ (tclStubsPtr->tcl_NumUtfChars) /* 312 */
+# define TclUtfAtIndex \
+ (tclStubsPtr->tcl_UtfAtIndex) /* 325 */
+# else
+# define TclNumUtfChars Tcl_NumUtfChars
+# define TclUtfAtIndex Tcl_UtfAtIndex
+# endif
+#endif
+
+/*
* The following structure represents our Macintosh-specific implementation
* of a font object.
*/
@@ -458,7 +478,7 @@ startOfClusterObjCmd(
if (stringArg == NULL) {
return TCL_ERROR;
}
- Tcl_Size ulen = TkGetCharLength(objv[1]);
+ Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len];
len = [S length];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) {
@@ -472,7 +492,7 @@ startOfClusterObjCmd(
/* The string contains codepoints > \uFFFF. Determine UTF-16 index */
Tcl_Size newIdx = 0;
for (Tcl_Size i = 0; i < idx; i++) {
- newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
+ newIdx += 1 + (((newIdx < len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00));
}
idx = newIdx;
}
@@ -515,7 +535,7 @@ endOfClusterObjCmd(
if (stringArg == NULL) {
return TCL_ERROR;
}
- Tcl_Size ulen = TkGetCharLength(objv[1]);
+ Tcl_Size ulen = Tcl_GetCharLength(objv[1]);
S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len];
len = [S length];
if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) {
@@ -1064,8 +1084,8 @@ TkpMeasureCharsInContext(
attributes:fontPtr->nsAttributes];
typesetter = CTTypesetterCreateWithAttributedString(
(CFAttributedStringRef)attributedString);
- start = Tcl_NumUtfChars(source, rangeStart);
- len = Tcl_NumUtfChars(source + rangeStart, rangeLength);
+ start = TclNumUtfChars(source, rangeStart);
+ len = TclNumUtfChars(source + rangeStart, rangeLength);
if (start > 0) {
range.length = start;
line = CTTypesetterCreateLine(typesetter, range);
@@ -1166,7 +1186,7 @@ TkpMeasureCharsInContext(
[attributedString release];
[string release];
length = ceil(width - offset);
- fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart;
+ fit = (TclUtfAtIndex(source, index) - source) - rangeStart;
done:
#ifdef TK_MAC_DEBUG_FONTS
TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d "
@@ -1365,8 +1385,8 @@ TkpDrawAngledCharsInContext(
-textX, -textY);
}
CGContextConcatCTM(context, t);
- start = Tcl_NumUtfChars(source, rangeStart);
- length = Tcl_NumUtfChars(source, rangeStart + rangeLength) - start;
+ start = TclNumUtfChars(source, rangeStart);
+ length = TclNumUtfChars(source, rangeStart + rangeLength) - start;
line = CTTypesetterCreateLine(typesetter, CFRangeMake(start, length));
if (start > 0) {
@@ -1534,7 +1554,7 @@ TkMacOSXUseAntialiasedText(
Tcl_ResetResult(interp);
}
if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext",
- (char *) &antialiasedTextEnabled,
+ &antialiasedTextEnabled,
TCL_LINK_INT) != TCL_OK) {
Tcl_ResetResult(interp);
}
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index 8e1fff5..0d07fdf 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -307,34 +307,34 @@ static const char getSdefProc[] = "::tk::mac::GetDynamicSdef";
/*
* This descriptor can be coerced to a file url. Construct a Tcl
* expression which passes the file path as a string argument to
- * ::tk::mac::DoScriptFile.
+ * ::tk::mac::DoScriptFile.
*/
if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeFileURL, &type,
- (Ptr) URLBuffer, URL_MAX_LENGTH, &actual)) {
- if (actual > 0) {
- URLBuffer[actual] = '\0';
- NSString *urlString = [NSString stringWithUTF8String:(char*)URLBuffer];
- NSURL *fileURL = [NSURL URLWithString:urlString];
- AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo));
- Tcl_DString *scriptFileCommand = &AEInfo->command;
- Tcl_DStringInit(scriptFileCommand);
- Tcl_DStringAppend(scriptFileCommand, scriptFileProc, TCL_INDEX_NONE);
- Tcl_DStringAppendElement(scriptFileCommand, [[fileURL path] UTF8String]);
- AEInfo->interp = _eventInterp;
- AEInfo->procedure = scriptFileProc;
- AEInfo->replyEvent = nil;
+ (Ptr) URLBuffer, URL_MAX_LENGTH, &actual)) {
+ if (actual > 0) {
+ URLBuffer[actual] = '\0';
+ NSString *urlString = [NSString stringWithUTF8String:(char*)URLBuffer];
+ NSURL *fileURL = [NSURL URLWithString:urlString];
+ AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo));
+ Tcl_DString *scriptFileCommand = &AEInfo->command;
+ Tcl_DStringInit(scriptFileCommand);
+ Tcl_DStringAppend(scriptFileCommand, scriptFileProc, TCL_INDEX_NONE);
+ Tcl_DStringAppendElement(scriptFileCommand, [[fileURL path] UTF8String]);
+ AEInfo->interp = _eventInterp;
+ AEInfo->procedure = scriptFileProc;
+ AEInfo->replyEvent = nil;
AEInfo->retryCount = 0;
- ProcessAppleEvent((void *)AEInfo);
- }
- }
+ ProcessAppleEvent((void *)AEInfo);
+ }
+ }
} else if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type,
NULL, 0, &actual)) {
- /*
- * The descriptor cannot be coerced to a file URL but can be coerced to
- * text. Construct a Tcl expression which passes the text as a string
- * argument to ::tk::mac::DoScriptText.
- */
+ /*
+ * The descriptor cannot be coerced to a file URL but can be coerced to
+ * text. Construct a Tcl expression which passes the text as a string
+ * argument to ::tk::mac::DoScriptText.
+ */
if (actual > 0) {
char *data = (char *)ckalloc(actual + 1);
@@ -350,23 +350,23 @@ static const char getSdefProc[] = "::tk::mac::GetDynamicSdef";
AEInfo->interp = _eventInterp;
AEInfo->procedure = scriptTextProc;
AEInfo->retryCount = 0;
- if (Tcl_FindCommand(AEInfo->interp, AEInfo->procedure, NULL, 0)) {
- AEInfo->replyEvent = replyEvent;
- ProcessAppleEvent(AEInfo);
- } else {
- AEInfo->replyEvent = nil;
- ProcessAppleEvent(AEInfo);
- }
+ if (Tcl_FindCommand(AEInfo->interp, AEInfo->procedure, NULL, 0)) {
+ AEInfo->replyEvent = replyEvent;
+ ProcessAppleEvent(AEInfo);
+ } else {
+ AEInfo->replyEvent = nil;
+ ProcessAppleEvent(AEInfo);
+ }
}
}
}
}
- (void)handleURLEvent:(NSAppleEventDescriptor*)event
- withReplyEvent:(NSAppleEventDescriptor*)replyEvent
+ withReplyEvent:(NSAppleEventDescriptor*)replyEvent
{
NSString* url = [[event paramDescriptorForKeyword:keyDirectObject]
- stringValue];
+ stringValue];
const char *cURL=[url UTF8String];
AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo));
Tcl_DString *launchCommand = &AEInfo->command;
@@ -456,18 +456,18 @@ static void ProcessAppleEvent(
Tcl_DStringLength(&AEInfo->command), TCL_EVAL_GLOBAL);
if (AEInfo->replyEvent && code >= 0) {
- Tcl_Size reslen;
- const char *result = Tcl_GetStringFromObj(Tcl_GetObjResult(AEInfo->interp),
- &reslen);
- if (code == TCL_OK) {
- AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
- keyDirectObject, typeChar, result, reslen);
- } else {
- AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
- keyErrorString, typeChar, result, reslen);
- AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
- keyErrorNumber, typeSInt32, (Ptr) &code, sizeof(int));
- }
+ Tcl_Size reslen;
+ const char *result = Tcl_GetStringFromObj(Tcl_GetObjResult(AEInfo->interp),
+ &reslen);
+ if (code == TCL_OK) {
+ AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
+ keyDirectObject, typeChar, result, reslen);
+ } else {
+ AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
+ keyErrorString, typeChar, result, reslen);
+ AEPutParamPtr((AppleEvent*)[AEInfo->replyEvent aeDesc],
+ keyErrorNumber, typeSInt32, (Ptr) &code, sizeof(int));
+ }
} else if (code != TCL_OK) {
Tcl_BackgroundException(AEInfo->interp, code);
}
@@ -537,8 +537,8 @@ TkMacOSXInitAppleEvents(
/*
* We do not load our sdef dynamically but this event handler
- * is required to silence error messages from inline execution
- * of AppleScript at the Objective-C level.
+ * is required to silence error messages from inline execution
+ * of AppleScript at the Objective-C level.
*/
[aeManager setEventHandler:NSApp
andSelector:@selector(handleGetSDEFEvent:withReplyEvent:)
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 30cfc60..488f029 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -19,6 +19,10 @@
#include "tkColor.h"
#include "xbytes.h"
+static CGImageRef CreateCGImageFromPixmap(Drawable pixmap);
+static CGImageRef CreateCGImageFromDrawableRect( Drawable drawable, int force_1x_scale,
+ int x, int y, unsigned int width, unsigned int height);
+
/* Pixel formats
*
* Tk uses the XImage structure defined in Xlib.h for storing images. The
@@ -510,8 +514,16 @@ TkMacOSXPutImage(
return BadDrawable;
}
if (dc.context) {
- CGRect bounds, srcRect, dstRect;
+ CGRect dstRect, srcRect = CGRectMake(src_x, src_y, width, height);
+ /*
+ * Whole image is copied before cropping. For performance,
+ * consider revising TkMacOSXCreateCGImageWithXImage() to accept
+ * source x/y/w/h and copy only the needed portion instead.
+ */
CGImageRef img = TkMacOSXCreateCGImageWithXImage(image, pixelFormat);
+ CGImageRef cropped = CGImageCreateWithImageInRect(img, srcRect);
+ CGImageRelease(img);
+ img = cropped;
/*
* The CGContext for a pixmap is RGB only, with A = 0.
@@ -521,12 +533,9 @@ TkMacOSXPutImage(
CGContextSetBlendMode(dc.context, kCGBlendModeSourceAtop);
}
if (img) {
- bounds = CGRectMake(0, 0, image->width, image->height);
- srcRect = CGRectMake(src_x, src_y, width, height);
dstRect = CGRectMake(dest_x, dest_y, width, height);
- TkMacOSXDrawCGImage(drawable, gc, dc.context,
- img, gc->foreground, gc->background,
- bounds, srcRect, dstRect);
+ TkMacOSXDrawCGImage(drawable, gc, dc.context, img,
+ gc->foreground, gc->background, dstRect);
CFRelease(img);
} else {
TkMacOSXDbgMsg("Invalid source drawable");
@@ -620,6 +629,11 @@ int TkpPutRGBAImage(
* with origin at the top left, as used by XImage and CGImage, not bottom
* left as used by NSView.
*
+ * If force_1x_scale is true, then the returned CGImage will be downscaled
+ * if necessary to have the requested width and height. Othewise, for
+ * windows on Retina displays, the width and height of the returned CGImage
+ * will be twice the requested width and height.
+ *
* Side effects:
* None
*
@@ -629,6 +643,7 @@ int TkpPutRGBAImage(
static CGImageRef
CreateCGImageFromDrawableRect(
Drawable drawable,
+ int force_1x_scale,
int x,
int y,
unsigned int width,
@@ -637,6 +652,7 @@ CreateCGImageFromDrawableRect(
MacDrawable *mac_drawable = (MacDrawable *)drawable;
CGContextRef cg_context = NULL;
CGImageRef cg_image = NULL, result = NULL;
+ CGFloat scaleFactor = 1.0;
if (mac_drawable->flags & TK_IS_PIXMAP) {
cg_context = TkMacOSXGetCGContextForDrawable(drawable);
CGContextRetain(cg_context);
@@ -646,18 +662,9 @@ CreateCGImageFromDrawableRect(
TkMacOSXDbgMsg("Invalid source drawable");
return NULL;
}
- NSSize size = view.frame.size;
- NSUInteger view_width = size.width, view_height = size.height;
- NSUInteger bytesPerPixel = 4,
- bytesPerRow = bytesPerPixel * view_width,
- bitsPerComponent = 8;
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- cg_context = CGBitmapContextCreate(NULL, view_width, view_height,
- bitsPerComponent, bytesPerRow, colorSpace,
- kCGImageAlphaPremultipliedLast |
- kCGBitmapByteOrder32Big);
- CFRelease(colorSpace);
- [view.layer renderInContext:cg_context];
+ scaleFactor = view.layer.contentsScale;
+ cg_context = ((TKContentView *)view).tkLayerBitmapContext;
+ CGContextRetain(cg_context);
}
if (cg_context) {
cg_image = CGBitmapContextCreateImage(cg_context);
@@ -666,8 +673,30 @@ CreateCGImageFromDrawableRect(
if (cg_image) {
CGRect rect = CGRectMake(x + mac_drawable->xOff, y + mac_drawable->yOff,
width, height);
+ rect = CGRectApplyAffineTransform(rect, CGAffineTransformMakeScale(scaleFactor, scaleFactor));
result = CGImageCreateWithImageInRect(cg_image, rect);
CGImageRelease(cg_image);
+ if (force_1x_scale && (scaleFactor != 1.0)) {
+ // See https://web.archive.org/web/20200219030756/http://blog.foundry376.com/2008/07/scaling-a-cgimage/#comment-200
+ // create context, keeping original image properties
+ CGColorSpaceRef colorspace = CGImageGetColorSpace(cg_image);
+ cg_context = CGBitmapContextCreate(NULL, width, height,
+ CGImageGetBitsPerComponent(cg_image),
+ //CGImageGetBytesPerRow(cg_image), // wastes space?
+ CGImageGetBitsPerPixel(cg_image) * width / 8,
+ colorspace,
+ CGImageGetAlphaInfo(cg_image));
+ CGColorSpaceRelease(colorspace);
+ if (cg_context) {
+ // draw image to context (resizing it)
+ CGContextDrawImage(cg_context, CGRectMake(0, 0, width, height),
+ cg_image);
+ // extract resulting image from context
+ result = CGBitmapContextCreateImage(cg_context);
+ CGContextRelease(cg_context);
+ }
+ CGImageRelease(cg_image);
+ }
}
return result;
}
@@ -799,7 +828,8 @@ XGetImage(
return NULL;
}
- cgImage = CreateCGImageFromDrawableRect(drawable, x, y, width, height);
+ // Request 1x-scale image for compatibility
+ cgImage = CreateCGImageFromDrawableRect(drawable, 1, x, y, width, height);
if (cgImage) {
bitmapRep = [NSBitmapImageRep alloc];
[bitmapRep initWithCGImage:cgImage];
@@ -890,9 +920,8 @@ XCopyArea(
int dest_y)
{
TkMacOSXDrawingContext dc;
- MacDrawable *srcDraw = (MacDrawable *)src;
CGImageRef img = NULL;
- CGRect bounds, srcRect, dstRect;
+ CGRect dstRect;
LastKnownRequestProcessed(display)++;
if (!width || !height) {
@@ -909,20 +938,13 @@ XCopyArea(
return BadDrawable;
}
- if (srcDraw->flags & TK_IS_PIXMAP) {
- img = CreateCGImageFromPixmap(src);
- } else if (TkMacOSXGetNSWindowForDrawable(src)) {
- img = CreateCGImageFromDrawableRect(src, src_x, src_y, width, height);
- } else {
- TkMacOSXDbgMsg("Invalid source drawable - neither window nor pixmap.");
- }
+ // Use unscaled source (TkMacOSXDrawCGImage() will implicitly downscale)
+ img = CreateCGImageFromDrawableRect(src, 0, src_x, src_y, width, height);
if (img) {
- bounds = CGRectMake(0, 0, srcDraw->size.width, srcDraw->size.height);
- srcRect = CGRectMake(src_x, src_y, width, height);
dstRect = CGRectMake(dest_x, dest_y, width, height);
TkMacOSXDrawCGImage(dst, gc, dc.context, img,
- gc->foreground, gc->background, bounds, srcRect, dstRect);
+ gc->foreground, gc->background, dstRect);
CFRelease(img);
} else {
TkMacOSXDbgMsg("Failed to construct CGImage.");
@@ -967,7 +989,7 @@ XCopyPlane(
TkMacOSXDrawingContext dc;
MacDrawable *srcDraw = (MacDrawable *)src;
MacDrawable *dstDraw = (MacDrawable *)dst;
- CGRect bounds, srcRect, dstRect;
+ CGRect srcRect, dstRect;
LastKnownRequestProcessed(display)++;
if (!width || !height) {
/* TkMacOSXDbgMsg("Drawing of empty area requested"); */
@@ -990,7 +1012,7 @@ XCopyPlane(
TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask;
unsigned long imageBackground = gc->background;
- if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP) {
+ if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP) {
srcRect = CGRectMake(src_x, src_y, width, height);
CGImageRef mask = CreateCGImageFromPixmap(
clipPtr->value.pixmap);
@@ -1033,13 +1055,9 @@ XCopyPlane(
CGImageRelease(submask);
CGImageRelease(subimage);
} else {
- bounds = CGRectMake(0, 0,
- srcDraw->size.width, srcDraw->size.height);
- srcRect = CGRectMake(src_x, src_y, width, height);
dstRect = CGRectMake(dest_x, dest_y, width, height);
TkMacOSXDrawCGImage(dst, gc, dc.context, img,
- gc->foreground, imageBackground, bounds,
- srcRect, dstRect);
+ gc->foreground, imageBackground, dstRect);
CGImageRelease(img);
}
} else {
@@ -1369,7 +1387,7 @@ TkMacOSXNSImageConfigureModel(
case NAME_SOURCE:
Tcl_SetObjResult(interp, Tcl_NewStringObj("Unknown named NSImage.\n"
"Try omitting ImageName, "
- "e.g. use NSCaution for NSImageNameCaution.", TCL_INDEX_NONE));
+ "e.g. use NSCaution for NSImageNameCaution.", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "SYSTEM", "BAD_VALUE", NULL);
goto errorExit;
case FILE_SOURCE:
@@ -1473,9 +1491,9 @@ TkMacOSXNSImageObjCmd(
objPtr = Tk_GetOptionValue(interp, (char *)modelPtr, optionTable,
objv[2], NULL);
if (objPtr == NULL) {
- goto error;
- }
- Tcl_SetObjResult(interp, objPtr);
+ goto error;
+ }
+ Tcl_SetObjResult(interp, objPtr);
break;
case CONFIGURE:
if (objc == 2) {
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 03a05fc..bbd41ee 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -41,8 +41,6 @@ static Tcl_ObjCmdProc TkMacOSVersionObjCmd;
@implementation TKApplication
@synthesize poolLock = _poolLock;
@synthesize macOSVersion = _macOSVersion;
-@synthesize isDrawing = _isDrawing;
-@synthesize isSigned = _isSigned;
@synthesize tkLiveResizeEnded = _tkLiveResizeEnded;
@synthesize tkPointerWindow = _tkPointerWindow;
- (void) setTkPointerWindow: (TkWindow *)winPtr
@@ -290,12 +288,6 @@ static Tcl_ObjCmdProc TkMacOSVersionObjCmd;
[NSApp setMacOSVersion: 10000*majorVersion + 100*minorVersion];
/*
- * We are not drawing right now.
- */
-
- [NSApp setIsDrawing:NO];
-
- /*
* Be our own delegate.
*/
@@ -394,7 +386,7 @@ static void closePanels(
[[NSFontPanel sharedFontPanel] orderOut:nil];
}
if ([NSColorPanel sharedColorPanelExists]) {
- [[NSColorPanel sharedColorPanel] orderOut:nil];
+ [[NSColorPanel sharedColorPanel] orderOut:nil];
}
}
@@ -431,6 +423,18 @@ TCL_NORETURN void TkpExitProc(
}
/*
+ * At this point it is too late to be looking up the Tk window associated
+ * to any NSWindows, but it can happen. This makes sure the answer is None
+ * if such a query is attempted.
+ */
+
+ for (TKWindow *w in [NSApp orderedWindows]) {
+ if ([w respondsToSelector: @selector (tkWindow)]) {
+ [w setTkWindow: None];
+ }
+ }
+
+ /*
* Tcl_Exit does not call Tcl_Finalize if there is an exit proc installed.
*/
@@ -471,7 +475,7 @@ TkpInit(
if (!initialized) {
struct stat st;
Bool shouldOpenConsole = NO;
- Bool stdinIsNullish = (!isatty(0) &&
+ Bool stdinIsNullish = (!isatty(0) &&
(fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0)));
/*
@@ -495,7 +499,7 @@ TkpInit(
if (Tcl_MacOSXOpenVersionedBundleResources(interp,
"com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX,
tkLibPath) != TCL_OK) {
- # if 0 /* This is not really an error. Wish still runs fine. */
+ # if 0 /* This is not really an error. Wish still runs fine. */
TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed");
# endif
}
@@ -517,40 +521,40 @@ TkpInit(
[TKApplication sharedApplication];
[pool drain];
- /*
- * WARNING: The finishLaunching method runs asynchronously. This
- * creates a race between the initialization of the NSApplication and
- * the initialization of Tk. If Tk wins the race bad things happen
- * with the root window (see below). If the NSApplication wins then an
- * AppleEvent created during launch, e.g. by dropping a file icon on
- * the application icon, will be delivered before the procedure meant
- * to to handle the AppleEvent has been defined. This is handled in
- * tkMacOSXHLEvents.c by scheduling a timer event to handle the
- * AppleEvent later, after the required procedure has been defined.
- */
+ /*
+ * WARNING: The finishLaunching method runs asynchronously. This
+ * creates a race between the initialization of the NSApplication and
+ * the initialization of Tk. If Tk wins the race bad things happen
+ * with the root window (see below). If the NSApplication wins then an
+ * AppleEvent created during launch, e.g. by dropping a file icon on
+ * the application icon, will be delivered before the procedure meant
+ * to to handle the AppleEvent has been defined. This is handled in
+ * tkMacOSXHLEvents.c by scheduling a timer event to handle the
+ * AppleEvent later, after the required procedure has been defined.
+ */
[NSApp _setup:interp];
[NSApp finishLaunching];
- /*
- * Create a Tk event source based on the Appkit event queue.
- */
+ /*
+ * Create a Tk event source based on the Appkit event queue.
+ */
Tk_MacOSXSetupTkNotifier();
/*
* If Tk initialization wins the race, the root window is mapped before
- * the NSApplication is initialized. This can cause bad things to
- * happen. The root window can open off screen with no way to make it
- * appear on screen until the app icon is clicked. This will happen if
- * a Tk application opens a modal window in its startup script (see
- * ticket 56a1823c73). In other cases, an empty root window can open
- * on screen and remain visible for a noticeable amount of time while
- * the Tk initialization finishes (see ticket d1989fb7cf). The call
- * below forces Tk to block until the Appkit event queue has been
- * created. This seems to be sufficient to ensure that the
- * NSApplication initialization wins the race, avoiding these bad
- * window behaviors.
+ * the NSApplication is initialized. This can cause bad things to
+ * happen. The root window can open off screen with no way to make it
+ * appear on screen until the app icon is clicked. This will happen if
+ * a Tk application opens a modal window in its startup script (see
+ * ticket 56a1823c73). In other cases, an empty root window can open
+ * on screen and remain visible for a noticeable amount of time while
+ * the Tk initialization finishes (see ticket d1989fb7cf). The call
+ * below forces Tk to block until the Appkit event queue has been
+ * created. This seems to be sufficient to ensure that the
+ * NSApplication initialization wins the race, avoiding these bad
+ * window behaviors.
*/
Tcl_DoOneEvent(TCL_WINDOW_EVENTS | TCL_DONT_WAIT);
@@ -675,7 +679,7 @@ TkpInit(
Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath",
TkMacOSXGetAppPathObjCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tk::mac::macOSVersion",
- TkMacOSVersionObjCmd, NULL, NULL);
+ TkMacOSVersionObjCmd, NULL, NULL);
MacSystrayInit(interp);
MacPrint_Init(interp);
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index a16eb42..42698ca 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -64,8 +64,8 @@ static NSUInteger textInputModifiers;
static NSMutableArray *nsEvArray = nil;
if (nsEvArray == nil) {
- nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1];
- processingCompose = NO;
+ nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1];
+ processingCompose = NO;
}
if (!winPtr) {
return theEvent;
@@ -80,7 +80,7 @@ static NSUInteger textInputModifiers;
if ([theEvent type] == NSKeyDown &&
[theEvent isARepeat] &&
[NSEvent keyRepeatDelay] < 0) {
- return theEvent;
+ return theEvent;
}
/*
@@ -311,7 +311,7 @@ static NSUInteger textInputModifiers;
Bool sendingIMEText = NO;
str = ([aString isKindOfClass: [NSAttributedString class]]) ?
- [aString string] : aString;
+ [aString string] : aString;
len = [str length];
if (NS_KEYLOG) {
@@ -426,7 +426,7 @@ static NSUInteger textInputModifiers;
(void)selRange;
str = ([aString isKindOfClass: [NSAttributedString class]]) ?
- [aString string] : aString;
+ [aString string] : aString;
if (focusWin) {
/*
@@ -636,12 +636,12 @@ setupXEvent(XEvent *xEvent, Tk_Window tkwin, NSUInteger modifiers)
display = Tk_Display(tkwin);
if (modifiers) {
state = (modifiers & NSAlphaShiftKeyMask ? LockMask : 0) |
- (modifiers & NSShiftKeyMask ? ShiftMask : 0) |
- (modifiers & NSControlKeyMask ? ControlMask : 0) |
- (modifiers & NSCommandKeyMask ? Mod1Mask : 0) |
- (modifiers & NSAlternateKeyMask ? Mod2Mask : 0) |
- (modifiers & NSNumericPadKeyMask ? Mod3Mask : 0) |
- (modifiers & NSFunctionKeyMask ? Mod4Mask : 0) ;
+ (modifiers & NSShiftKeyMask ? ShiftMask : 0) |
+ (modifiers & NSControlKeyMask ? ControlMask : 0) |
+ (modifiers & NSCommandKeyMask ? Mod1Mask : 0) |
+ (modifiers & NSAlternateKeyMask ? Mod2Mask : 0) |
+ (modifiers & NSNumericPadKeyMask ? Mod3Mask : 0) |
+ (modifiers & NSFunctionKeyMask ? Mod4Mask : 0) ;
}
memset(xEvent, 0, sizeof(XEvent));
xEvent->xany.serial = LastKnownRequestProcessed(display);
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index f02144f..f898496 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -268,7 +268,7 @@ UpdateKeymaps()
*/
for (index = 3; index >= 0; index--) {
- for (virt = 0; virt < 128; virt++) {
+ for (virt = 0; virt < 128; virt++) {
MacKeycode macKC;
macKC.v = (keycode_v) {.virt = virt, .o_s = index, .keychar = 0};
int modifiers = INDEX2CARBON(index);
@@ -288,7 +288,7 @@ UpdateKeymaps()
hPtr = Tcl_CreateHashEntry(&unichar2xvirtual,
INT2PTR(macKC.x.keychar), &dummy);
Tcl_SetHashValue(hPtr, INT2PTR(macKC.x.xvirtual));
- }
+ }
xvirtual2unichar[macKC.x.xvirtual] = macKC.x.keychar;
}
}
@@ -501,7 +501,7 @@ TkpGetString(
macKC.uint = eventPtr->xkey.keycode;
if (IS_PRINTABLE(macKC.v.keychar)) {
- length = TkUniCharToUtf(macKC.v.keychar, utfChars);
+ length = Tcl_UniCharToUtf(macKC.v.keychar, utfChars);
}
utfChars[length] = 0;
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 1908bb9..bf41d66 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -960,8 +960,6 @@ TkpPostMenu(
}
realWin = Tk_Parent(realWin);
}
- NSWindow *win = [realWinView window];
- NSView *view = [win contentView];
NSMenu *menu = (NSMenu *) menuPtr->platformData;
NSInteger itemIndex = index;
NSInteger numItems = [menu numberOfItems];
@@ -971,8 +969,8 @@ TkpPostMenu(
inPostMenu = true;
result = TkPreprocessMenu(menuPtr);
if (result != TCL_OK) {
- inPostMenu = false;
- return result;
+ inPostMenu = false;
+ return result;
}
if (itemIndex >= numItems) {
itemIndex = numItems - 1;
@@ -991,8 +989,9 @@ TkpPostMenu(
}
[menu popUpMenuPositioningItem:item
- atLocation:[win tkConvertPointFromScreen:location]
- inView:view];
+ atLocation:location
+ inView:nil
+ appearance:realWinView.effectiveAppearance];
inPostMenu = false;
return TCL_OK;
}
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index ac7befd..6d71ffc 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -173,7 +173,7 @@ TkpDisplayMenuButton(
butPtr->flags &= ~REDRAW_PENDING;
if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
+ return;
}
pixmap = (Pixmap) Tk_WindowId(tkwin);
@@ -191,7 +191,7 @@ TkpDisplayMenuButton(
*/
if (butPtr->highlightWidth < 3) {
- if (butPtr->flags & GOT_FOCUS) {
+ if (butPtr->flags & GOT_FOCUS) {
GC gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap);
TkMacOSXDrawSolidBorder(tkwin, gc, 0, butPtr->highlightWidth);
}
@@ -259,23 +259,23 @@ TkpComputeMenuButtonGeometry(
avgWidth = 0;
if (butPtr->image != NULL) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
- haveImage = 1;
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
} else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- haveImage = 1;
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
}
if (butPtr->text && strlen(butPtr->text) > 0) {
haveText = 1;
- Tk_FreeTextLayout(butPtr->textLayout);
- butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
- butPtr->text, TCL_INDEX_NONE, butPtr->wrapLength,
- butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
- txtWidth = butPtr->textWidth;
- txtHeight = butPtr->textHeight;
- avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
- Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ Tk_FreeTextLayout(butPtr->textLayout);
+ butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
+ butPtr->text, TCL_INDEX_NONE, butPtr->wrapLength,
+ butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
+ avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
}
/*
@@ -286,7 +286,7 @@ TkpComputeMenuButtonGeometry(
*/
if (haveImage && haveText) {
- switch ((enum compound) butPtr->compound) {
+ switch ((enum compound) butPtr->compound) {
case COMPOUND_TOP:
case COMPOUND_BOTTOM:
/*
@@ -315,33 +315,33 @@ TkpComputeMenuButtonGeometry(
break;
case COMPOUND_NONE:
break;
- }
+ }
- if (butPtr->width > 0) {
- width = butPtr->width;
- }
- if (butPtr->height > 0) {
- height = butPtr->height;
- }
+ if (butPtr->width > 0) {
+ width = butPtr->width;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height;
+ }
} else {
- if (haveImage) { /* Image only */
- if (butPtr->width > 0) {
- width = butPtr->width;
- }
- if (butPtr->height > 0) {
- height = butPtr->height;
- }
- } else { /* Text only */
- width = txtWidth;
- height = txtHeight;
- if (butPtr->width > 0) {
- width = butPtr->width * avgWidth + 2*butPtr->padX;
- }
- if (butPtr->height > 0) {
- height = butPtr->height * fm.linespace + 2*butPtr->padY;
- }
- }
+ if (haveImage) { /* Image only */
+ if (butPtr->width > 0) {
+ width = butPtr->width;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height;
+ }
+ } else { /* Text only */
+ width = txtWidth;
+ height = txtHeight;
+ if (butPtr->width > 0) {
+ width = butPtr->width * avgWidth + 2*butPtr->padX;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height * fm.linespace + 2*butPtr->padY;
+ }
+ }
}
butPtr->inset = highlightWidth + butPtr->borderWidth;
@@ -381,30 +381,30 @@ DrawMenuButtonImageAndText(
int fullWidth = 0, fullHeight = 0;
if (tkwin == NULL || !Tk_IsMapped(tkwin)) {
- return;
+ return;
}
DrawParams *dpPtr = &mbPtr->drawParams;
pixmap = (Pixmap) Tk_WindowId(tkwin);
if (butPtr->image != NULL) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
- haveImage = 1;
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
} else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- haveImage = 1;
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
}
haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
- int x = 0, y = 0;
+ int x = 0, y = 0;
- textXOffset = 0;
- textYOffset = 0;
- fullWidth = 0;
- fullHeight = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
- switch ((enum compound) butPtr->compound) {
+ switch ((enum compound) butPtr->compound) {
case COMPOUND_TOP:
case COMPOUND_BOTTOM:
/*
@@ -435,7 +435,7 @@ DrawMenuButtonImageAndText(
}
fullWidth = butPtr->textWidth + butPtr->padX + width;
fullHeight = (height > butPtr->textHeight ? height :
- butPtr->textHeight);
+ butPtr->textHeight);
textYOffset = (fullHeight - butPtr->textHeight)/2;
imageYOffset = (fullHeight - height)/2;
break;
@@ -446,7 +446,7 @@ DrawMenuButtonImageAndText(
fullWidth = (width > butPtr->textWidth ? width : butPtr->textWidth);
fullHeight = (height > butPtr->textHeight ? height :
- butPtr->textHeight);
+ butPtr->textHeight);
textXOffset = (fullWidth - butPtr->textWidth) / 2;
imageXOffset = (fullWidth - width) / 2;
textYOffset = (fullHeight - butPtr->textHeight) / 2;
@@ -456,54 +456,54 @@ DrawMenuButtonImageAndText(
break;
}
- TkComputeAnchor(butPtr->anchor, tkwin,
- butPtr->padX + butPtr->inset, butPtr->padY + butPtr->inset,
- fullWidth, fullHeight, &x, &y);
- imageXOffset = LEFT_INSET;
- imageYOffset += y;
- textYOffset -= 1;
+ TkComputeAnchor(butPtr->anchor, tkwin,
+ butPtr->padX + butPtr->inset, butPtr->padY + butPtr->inset,
+ fullWidth, fullHeight, &x, &y);
+ imageXOffset = LEFT_INSET;
+ imageYOffset += y;
+ textYOffset -= 1;
- if (butPtr->image != NULL) {
+ if (butPtr->image != NULL) {
Tk_RedrawImage(butPtr->image, 0, 0, width,
- height, pixmap, imageXOffset, imageYOffset);
- } else {
- XSetClipOrigin(butPtr->display, dpPtr->gc,
- imageXOffset, imageYOffset);
- XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
- 0, 0, (unsigned int) width, (unsigned int) height,
- imageXOffset, imageYOffset, 1);
- XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
- }
-
- Tk_DrawTextLayout(butPtr->display, pixmap,
- dpPtr->gc, butPtr->textLayout,
- x + textXOffset, y + textYOffset, 0, -1);
- Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc,
- butPtr->textLayout, x + textXOffset, y + textYOffset,
- butPtr->underline);
+ height, pixmap, imageXOffset, imageYOffset);
+ } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc,
+ imageXOffset, imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
+ 0, 0, (unsigned int) width, (unsigned int) height,
+ imageXOffset, imageYOffset, 1);
+ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
+ }
+
+ Tk_DrawTextLayout(butPtr->display, pixmap,
+ dpPtr->gc, butPtr->textLayout,
+ x + textXOffset, y + textYOffset, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc,
+ butPtr->textLayout, x + textXOffset, y + textYOffset,
+ butPtr->underline);
} else {
int x, y;
- if (haveImage) {
- TkComputeAnchor(butPtr->anchor, tkwin,
- butPtr->padX + butPtr->borderWidth,
- butPtr->padY + butPtr->borderWidth,
- width, height, &x, &y);
+ if (haveImage) {
+ TkComputeAnchor(butPtr->anchor, tkwin,
+ butPtr->padX + butPtr->borderWidth,
+ butPtr->padY + butPtr->borderWidth,
+ width, height, &x, &y);
imageXOffset = LEFT_INSET;
imageYOffset += y;
if (butPtr->image != NULL) {
Tk_RedrawImage(butPtr->image, 0, 0, width, height,
pixmap, imageXOffset, imageYOffset);
- } else {
- XSetClipOrigin(butPtr->display, dpPtr->gc, x, y);
- XCopyPlane(butPtr->display, butPtr->bitmap,
+ } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc, x, y);
+ XCopyPlane(butPtr->display, butPtr->bitmap,
pixmap, dpPtr->gc,
0, 0, (unsigned int) width,
(unsigned int) height,
imageXOffset, imageYOffset, 1);
- XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
- }
- } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
+ }
+ } else {
textXOffset = LEFT_INSET;
TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
butPtr->textWidth, butPtr->textHeight, &x, &y);
@@ -537,7 +537,7 @@ TkMacOSXDrawMenuButton(
MacMenuButton *mbPtr, /* Mac menubutton. */
TCL_UNUSED(GC), /* The GC we are drawing into - not used */
Pixmap pixmap) /* The pixmap we are drawing into - needed for the
- * bevel button */
+ * bevel button */
{
TkMenuButton *butPtr = (TkMenuButton *) mbPtr;
TkWindow *winPtr = (TkWindow *) butPtr->tkwin;
@@ -552,23 +552,23 @@ TkMacOSXDrawMenuButton(
Tk_Width(butPtr->tkwin), Tk_Height(butPtr->tkwin));
if (useNewerHITools == 1) {
- HIRect contHIRec;
- static HIThemeButtonDrawInfo hiinfo;
+ HIRect contHIRec;
+ static HIThemeButtonDrawInfo hiinfo;
- MenuButtonBackgroundDrawCB(mbPtr, 32, true);
+ MenuButtonBackgroundDrawCB(mbPtr, 32, true);
if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) {
return;
}
- hiinfo.version = 0;
- hiinfo.state = mbPtr->drawinfo.state;
- hiinfo.kind = mbPtr->btnkind;
- hiinfo.value = mbPtr->drawinfo.value;
- hiinfo.adornment = mbPtr->drawinfo.adornment;
- hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent();
- if (hiinfo.animation.time.start == 0) {
- hiinfo.animation.time.start = hiinfo.animation.time.current;
- }
+ hiinfo.version = 0;
+ hiinfo.state = mbPtr->drawinfo.state;
+ hiinfo.kind = mbPtr->btnkind;
+ hiinfo.value = mbPtr->drawinfo.value;
+ hiinfo.adornment = mbPtr->drawinfo.adornment;
+ hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent();
+ if (hiinfo.animation.time.start == 0) {
+ hiinfo.animation.time.start = hiinfo.animation.time.current;
+ }
/*
* To avoid menubuttons with white text on a white background, we
@@ -581,10 +581,10 @@ TkMacOSXDrawMenuButton(
hiinfo.state = kThemeStateInactive;
}
- HIThemeDrawButton(&cntrRect, &hiinfo, dc.context,
+ HIThemeDrawButton(&cntrRect, &hiinfo, dc.context,
kHIThemeOrientationNormal, &contHIRec);
TkMacOSXRestoreDrawingContext(&dc);
- MenuButtonContentDrawCB(mbPtr->btnkind, &mbPtr->drawinfo,
+ MenuButtonContentDrawCB(mbPtr->btnkind, &mbPtr->drawinfo,
mbPtr, 32, true);
} else {
if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) {
@@ -623,11 +623,11 @@ MenuButtonBackgroundDrawCB (
Pixmap pixmap;
if (tkwin == NULL || !Tk_IsMapped(tkwin)) {
- return;
+ return;
}
pixmap = (Pixmap) Tk_WindowId(tkwin);
Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
}
/*
@@ -658,7 +658,7 @@ MenuButtonContentDrawCB (
Tk_Window tkwin = butPtr->tkwin;
if (tkwin == NULL || !Tk_IsMapped(tkwin)) {
- return;
+ return;
}
DrawMenuButtonImageAndText(butPtr);
}
@@ -749,22 +749,22 @@ TkMacOSXComputeMenuButtonParams(
drawinfo->state = kThemeStateInactive;
if ((mbPtr->flags & ACTIVE) == 0) {
- if (butPtr->state == STATE_DISABLED) {
- drawinfo->state = kThemeStateUnavailableInactive;
- } else {
- drawinfo->state = kThemeStateInactive;
- }
+ if (butPtr->state == STATE_DISABLED) {
+ drawinfo->state = kThemeStateUnavailableInactive;
+ } else {
+ drawinfo->state = kThemeStateInactive;
+ }
} else if (butPtr->state == STATE_DISABLED) {
- drawinfo->state = kThemeStateUnavailable;
+ drawinfo->state = kThemeStateUnavailable;
} else {
- drawinfo->state = kThemeStateActive;
+ drawinfo->state = kThemeStateActive;
}
drawinfo->adornment = kThemeAdornmentNone;
if (butPtr->highlightWidth >= 3) {
- if ((butPtr->flags & GOT_FOCUS)) {
- drawinfo->adornment |= kThemeAdornmentFocus;
- }
+ if ((butPtr->flags & GOT_FOCUS)) {
+ drawinfo->adornment |= kThemeAdornmentFocus;
+ }
}
drawinfo->adornment |= kThemeAdornmentArrowDoubleArrow;
}
@@ -795,12 +795,12 @@ TkMacOSXComputeMenuButtonDrawParams(
((butPtr->image != NULL) || (butPtr->bitmap != None));
dpPtr->border = butPtr->normalBorder;
if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {
- dpPtr->gc = butPtr->disabledGC;
+ dpPtr->gc = butPtr->disabledGC;
} else if (butPtr->state == STATE_ACTIVE) {
- dpPtr->gc = butPtr->activeTextGC;
- dpPtr->border = butPtr->activeBorder;
+ dpPtr->gc = butPtr->activeTextGC;
+ dpPtr->border = butPtr->activeBorder;
} else {
- dpPtr->gc = butPtr->normalTextGC;
+ dpPtr->gc = butPtr->normalTextGC;
}
}
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index b1b8bad..b717352 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -116,18 +116,18 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
_defaultWindowsMenuItems = [_defaultWindowsMenuItems
arrayByAddingObjectsFromArray:
[NSArray arrayWithObjects:
- [NSMenuItem separatorItem],
+ [NSMenuItem separatorItem],
[NSMenuItem itemWithTitle:@"Show Previous Tab"
- action:@selector(selectPreviousTab:)
- target:nil
+ action:@selector(selectPreviousTab:)
+ target:nil
keyEquivalent:@"\t"
- keyEquivalentModifierMask:
+ keyEquivalentModifierMask:
NSControlKeyMask|NSShiftKeyMask],
- [NSMenuItem itemWithTitle:@"Show Next Tab"
- action:@selector(selectNextTab:)
- target:nil
+ [NSMenuItem itemWithTitle:@"Show Next Tab"
+ action:@selector(selectNextTab:)
+ target:nil
keyEquivalent:@"\t"
- keyEquivalentModifierMask:NSControlKeyMask],
+ keyEquivalentModifierMask:NSControlKeyMask],
[NSMenuItem itemWithTitle:@"Move Tab To New Window"
action:@selector(moveTabToNewWindow:)
target:nil],
@@ -135,7 +135,7 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
action:@selector(mergeAllWindows:)
target:nil],
[NSMenuItem separatorItem],
- nil]];
+ nil]];
}
_defaultWindowsMenuItems = [_defaultWindowsMenuItems arrayByAddingObject:
[NSMenuItem itemWithTitle:@"Bring All to Front"
@@ -193,7 +193,7 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
}
return haveDemo;
} else {
- return [super validateUserInterfaceItem:anItem];
+ return [super validateUserInterfaceItem:anItem];
}
}
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 83d2cd2..062a125 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -504,8 +504,9 @@ enum {
state |= Tk_GetButtonMask(Button1);
}
if (eventType == NSMouseEntered) {
- Tk_UpdatePointer((Tk_Window) [NSApp tkPointerWindow],
- global.x, global.y, state);
+ Tk_Window new_win = Tk_CoordsToWindow(global.x, global.y,
+ (Tk_Window) [NSApp tkPointerWindow]);
+ Tk_UpdatePointer(new_win, global.x, global.y, state);
} else if (eventType == NSMouseExited) {
if ([NSApp tkDragTarget]) {
Tk_UpdatePointer((Tk_Window) [NSApp tkDragTarget],
@@ -883,9 +884,9 @@ TkpWarpPointer(
CGWarpMouseCursorPosition(pt);
if (dispPtr->warpWindow) {
- TkGenerateButtonEventForXPointer(Tk_WindowId(dispPtr->warpWindow));
+ TkGenerateButtonEventForXPointer(Tk_WindowId(dispPtr->warpWindow));
} else {
- TkGenerateButtonEventForXPointer(None);
+ TkGenerateButtonEventForXPointer(None);
}
}
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 0927024..f353380 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -16,34 +16,6 @@
#include "tkMacOSXPrivate.h"
#include "tkMacOSXInt.h"
#include "tkMacOSXConstants.h"
-#if TCL_MAJOR_VERSION < 9
-#undef Tcl_MacOSXNotifierAddRunLoopMode
-#ifdef USE_TCL_STUBS
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Little hack to eliminate the need for "tclInt.h" here:
- Just copy a small portion of TclIntPlatStubs, just
- enough to make it work. See [600b72bfbc] */
-typedef struct TclIntPlatStubs {
- int magic;
- void *hooks;
- void (*dummy[19]) (void); /* dummy entries 0-18, not used */
- void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
-} TclIntPlatStubs;
-extern const TclIntPlatStubs *tclIntPlatStubsPtr;
-#ifdef __cplusplus
-}
-#endif
-#define Tcl_MacOSXNotifierAddRunLoopMode \
- (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
-#elif TCL_MINOR_VERSION < 7
- extern void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode);
-# define Tcl_MacOSXNotifierAddRunLoopMode TclMacOSXNotifierAddRunLoopMode
-#else
- extern void Tcl_MacOSXNotifierAddRunLoopMode(const void *runLoopMode);
-#endif
-#endif
#import <objc/objc-auto.h>
/* This is not used for anything at the moment. */
@@ -338,12 +310,12 @@ TkMacOSXNotifyExitHandler(
* This static function is meant to be run as an idle task. It attempts
* to redraw all views which have the tkNeedsDisplay property set to YES.
* This relies on a feature of [NSApp nextEventMatchingMask: ...] which
- * is undocumented, namely that it sometimes blocks and calls drawRect
+ * is undocumented, namely that it sometimes blocks and calls updateLayer
* for all views that need display before it returns. We call it with
* deQueue=NO so that it will not change anything on the AppKit event
* queue, because we only want the side effect that it runs drawRect. The
* only times when any NSViews have the needsDisplay property set to YES
- * are during execution of this function or in the addTkDirtyRect method
+ * are during execution of this function or in the setFrameSize method
* of TKContentView.
*
* The reason for running this function as an idle task is to try to
@@ -370,7 +342,7 @@ void
TkMacOSXDrawAllViews(
void *clientData)
{
- int count = 0, *dirtyCount = (int *)clientData;
+ int count = 0, *dirtyCount = (int *)clientData;
for (NSWindow *window in [NSApp windows]) {
if ([[window contentView] isMemberOfClass:[TKContentView class]]) {
@@ -380,7 +352,6 @@ TkMacOSXDrawAllViews(
if (dirtyCount) {
continue;
}
- [[view layer] setNeedsDisplayInRect:[view tkDirtyRect]];
[view setNeedsDisplay:YES];
}
} else {
@@ -390,26 +361,15 @@ TkMacOSXDrawAllViews(
if (dirtyCount) {
*dirtyCount = count;
}
+
+ /*
+ * Trigger calls to updateLayer methods for the views flagged above.
+ */
+
[NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast]
inMode:GetRunLoopMode(TkMacOSXGetModalSession())
dequeue:NO];
- for (NSWindow *window in [NSApp windows]) {
- if ([[window contentView] isMemberOfClass:[TKContentView class]]) {
- TKContentView *view = [window contentView];
-
- /*
- * If we did not run drawRect, we set needsDisplay back to NO.
- * Note that if drawRect did run it may have added to Tk's dirty
- * rect, due to attempts to draw outside of drawRect's dirty rect.
- */
-
- if ([view needsDisplay]) {
- [view setNeedsDisplay: NO];
- }
- }
- }
- [NSApp setNeedsToDraw:NO];
}
/*
@@ -476,11 +436,11 @@ TkMacOSXEventsSetupProc(
*/
NSEvent *currentEvent =
- [NSApp nextEventMatchingMask:NSAnyEventMask
+ [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast]
inMode:GetRunLoopMode(TkMacOSXGetModalSession())
dequeue:NO];
- if ((currentEvent) || [NSApp needsToDraw] ) {
+ if ((currentEvent)) {
Tcl_SetMaxBlockTime(&zeroBlockTime);
Tcl_DeleteTimerHandler(ticker);
ticker = NULL;
diff --git a/macosx/tkMacOSXPrint.c b/macosx/tkMacOSXPrint.c
index ee30e1f..ac29714 100644
--- a/macosx/tkMacOSXPrint.c
+++ b/macosx/tkMacOSXPrint.c
@@ -92,8 +92,8 @@ StartPrint(
/* Check for proper number of arguments. */
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "file");
- return TCL_ERROR;
+ Tcl_WrongNumArgs(interp, 1, objv, "file");
+ return TCL_ERROR;
}
fileName = [NSString stringWithUTF8String: Tcl_GetString(objv[1])];
@@ -105,20 +105,20 @@ StartPrint(
status = PMCreateSession( & printSession);
if (status != noErr) {
- NSLog(@ "Error creating print session.");
- return TCL_ERROR;
+ NSLog(@ "Error creating print session.");
+ return TCL_ERROR;
}
status = PMCreatePrintSettings( & printSettings);
if (status != noErr) {
- NSLog(@ "Error creating print settings.");
- return TCL_ERROR;
+ NSLog(@ "Error creating print settings.");
+ return TCL_ERROR;
}
status = PMSessionDefaultPrintSettings(printSession, printSettings);
if (status != noErr) {
- NSLog(@ "Error creating default print settings.");
- return TCL_ERROR;
+ NSLog(@ "Error creating default print settings.");
+ return TCL_ERROR;
}
printSession = (PMPrintSession)[printInfo PMPrintSession];
@@ -163,25 +163,25 @@ FinishPrint(
* otherwise printing will occur regardless of value.
*/
if (buttonValue == NSModalResponseCancel) {
- return noErr;
+ return noErr;
}
status = PMCreateSession( & printSession);
if (status != noErr) {
- NSLog(@ "Error creating print session.");
- return status;
+ NSLog(@ "Error creating print session.");
+ return status;
}
status = PMCreatePrintSettings( & printSettings);
if (status != noErr) {
- NSLog(@ "Error creating print settings.");
- return status;
+ NSLog(@ "Error creating print settings.");
+ return status;
}
status = PMSessionDefaultPrintSettings(printSession, printSettings);
if (status != noErr) {
- NSLog(@ "Error creating default print settings.");
- return status;
+ NSLog(@ "Error creating default print settings.");
+ return status;
}
printSession = (PMPrintSession)[printInfo PMPrintSession];
@@ -191,81 +191,81 @@ FinishPrint(
/*Handle print operation.*/
if (buttonValue == NSModalResponseOK) {
- if (urlFile == NULL) {
- NSLog(@ "Could not get file to print.");
- return noErr;
- }
-
- fileName = file;
-
- CFURLRef printURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlFile, kCFURLPOSIXPathStyle, false);
-
- PMPrinter currentPrinter;
- PMDestinationType printDestination;
-
- /*Get the intended destination.*/
- status = PMSessionGetDestinationType(printSession, printSettings, & printDestination);
-
- /*Destination is printer. Send file to printer.*/
- if (status == noErr && printDestination == kPMDestinationPrinter) {
-
- status = PMSessionGetCurrentPrinter(printSession, & currentPrinter);
- if (status == noErr) {
- CFArrayRef mimeTypes;
- status = PMPrinterGetMimeTypes(currentPrinter, printSettings, & mimeTypes);
- if (status == noErr && mimeTypes != NULL) {
- mimeType = CFSTR("application/pdf");
- if (CFArrayContainsValue(mimeTypes, CFRangeMake(0, CFArrayGetCount(mimeTypes)), mimeType)) {
- status = PMPrinterPrintWithFile(currentPrinter, printSettings, pageFormat, mimeType, printURL);
- CFRelease(urlFile);
- return status;
- }
- }
- }
- }
-
- /* Destination is file. Determine how to handle. */
- if (status == noErr && printDestination == kPMDestinationFile) {
- CFURLRef outputLocation = NULL;
-
- status = PMSessionCopyDestinationLocation(printSession, printSettings, & outputLocation);
- if (status == noErr) {
- /*Get the source file and target destination, convert to strings.*/
- CFStringRef sourceFile = CFURLCopyFileSystemPath(printURL, kCFURLPOSIXPathStyle);
- CFStringRef savePath = CFURLCopyFileSystemPath(outputLocation, kCFURLPOSIXPathStyle);
- NSString * sourcePath = (NSString * ) sourceFile;
- NSString * finalPath = (NSString * ) savePath;
- NSString * pathExtension = [finalPath pathExtension];
- NSFileManager * fileManager = [NSFileManager defaultManager];
+ if (urlFile == NULL) {
+ NSLog(@ "Could not get file to print.");
+ return noErr;
+ }
+
+ fileName = file;
+
+ CFURLRef printURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlFile, kCFURLPOSIXPathStyle, false);
+
+ PMPrinter currentPrinter;
+ PMDestinationType printDestination;
+
+ /*Get the intended destination.*/
+ status = PMSessionGetDestinationType(printSession, printSettings, & printDestination);
+
+ /*Destination is printer. Send file to printer.*/
+ if (status == noErr && printDestination == kPMDestinationPrinter) {
+
+ status = PMSessionGetCurrentPrinter(printSession, & currentPrinter);
+ if (status == noErr) {
+ CFArrayRef mimeTypes;
+ status = PMPrinterGetMimeTypes(currentPrinter, printSettings, & mimeTypes);
+ if (status == noErr && mimeTypes != NULL) {
+ mimeType = CFSTR("application/pdf");
+ if (CFArrayContainsValue(mimeTypes, CFRangeMake(0, CFArrayGetCount(mimeTypes)), mimeType)) {
+ status = PMPrinterPrintWithFile(currentPrinter, printSettings, pageFormat, mimeType, printURL);
+ CFRelease(urlFile);
+ return status;
+ }
+ }
+ }
+ }
+
+ /* Destination is file. Determine how to handle. */
+ if (status == noErr && printDestination == kPMDestinationFile) {
+ CFURLRef outputLocation = NULL;
+
+ status = PMSessionCopyDestinationLocation(printSession, printSettings, & outputLocation);
+ if (status == noErr) {
+ /*Get the source file and target destination, convert to strings.*/
+ CFStringRef sourceFile = CFURLCopyFileSystemPath(printURL, kCFURLPOSIXPathStyle);
+ CFStringRef savePath = CFURLCopyFileSystemPath(outputLocation, kCFURLPOSIXPathStyle);
+ NSString * sourcePath = (NSString * ) sourceFile;
+ NSString * finalPath = (NSString * ) savePath;
+ NSString * pathExtension = [finalPath pathExtension];
+ NSFileManager * fileManager = [NSFileManager defaultManager];
NSError * error = nil;
- /*
+ /*
* Is the target file a PDF? If so, copy print file
* to output location.
*/
- if ([pathExtension isEqualToString: @ "pdf"]) {
+ if ([pathExtension isEqualToString: @ "pdf"]) {
/*Make sure no file conflict exists.*/
if ([fileManager fileExistsAtPath: finalPath]) {
[fileManager removeItemAtPath: finalPath error: &error];
}
- if ([fileManager fileExistsAtPath: sourcePath]) {
- error = nil;
- [fileManager copyItemAtPath: sourcePath toPath: finalPath error: & error];
- }
+ if ([fileManager fileExistsAtPath: sourcePath]) {
+ error = nil;
+ [fileManager copyItemAtPath: sourcePath toPath: finalPath error: & error];
+ }
return status;
- }
-
- /*
- * Is the target file PostScript? If so, run print file
- * through CUPS filter to convert back to PostScript.
- */
-
- if ([pathExtension isEqualToString: @ "ps"]) {
- char source[5012];
- char target[5012];
- [sourcePath getCString: source maxLength: (sizeof source) encoding: NSUTF8StringEncoding];
- [finalPath getCString: target maxLength: (sizeof target) encoding: NSUTF8StringEncoding];
+ }
+
+ /*
+ * Is the target file PostScript? If so, run print file
+ * through CUPS filter to convert back to PostScript.
+ */
+
+ if ([pathExtension isEqualToString: @ "ps"]) {
+ char source[5012];
+ char target[5012];
+ [sourcePath getCString: source maxLength: (sizeof source) encoding: NSUTF8StringEncoding];
+ [finalPath getCString: target maxLength: (sizeof target) encoding: NSUTF8StringEncoding];
/*Make sure no file conflict exists.*/
if ([fileManager fileExistsAtPath: finalPath]) {
[fileManager removeItemAtPath: finalPath error: &error];
@@ -290,39 +290,39 @@ FinishPrint(
}
}
- /* Destination is preview. Open file in default application for PDF. */
- if ((status == noErr) && (printDestination == kPMDestinationPreview)) {
- CFStringRef urlpath = CFURLCopyFileSystemPath(printURL, kCFURLPOSIXPathStyle);
- NSString * path = (NSString * ) urlpath;
- NSURL * url = [NSURL fileURLWithPath: path];
- NSWorkspace * ws = [NSWorkspace sharedWorkspace];
- [ws openURL: url];
- status = noErr;
- return status;
- }
-
- /*
- * If destination is not printer, file or preview,
- * we do not support it. Display alert.
- */
+ /* Destination is preview. Open file in default application for PDF. */
+ if ((status == noErr) && (printDestination == kPMDestinationPreview)) {
+ CFStringRef urlpath = CFURLCopyFileSystemPath(printURL, kCFURLPOSIXPathStyle);
+ NSString * path = (NSString * ) urlpath;
+ NSURL * url = [NSURL fileURLWithPath: path];
+ NSWorkspace * ws = [NSWorkspace sharedWorkspace];
+ [ws openURL: url];
+ status = noErr;
+ return status;
+ }
+
+ /*
+ * If destination is not printer, file or preview,
+ * we do not support it. Display alert.
+ */
if (((status == noErr) && (printDestination != kPMDestinationPreview)) || ((status == noErr) && (printDestination != kPMDestinationFile)) || ((status == noErr) && (printDestination != kPMDestinationPrinter))) {
- NSAlert * alert = [[[NSAlert alloc] init] autorelease];
- [alert addButtonWithTitle: @ "OK"];
+ NSAlert * alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle: @ "OK"];
- [alert setMessageText: @ "Unsupported Printing Operation"];
- [alert setInformativeText: @ "This printing operation is not supported."];
- [alert setAlertStyle: NSAlertStyleInformational];
- [alert runModal];
- return status;
- }
+ [alert setMessageText: @ "Unsupported Printing Operation"];
+ [alert setInformativeText: @ "This printing operation is not supported."];
+ [alert setAlertStyle: NSAlertStyleInformational];
+ [alert runModal];
+ return status;
+ }
}
/* Return because cancel button was clicked. */
if (buttonValue == NSModalResponseCancel) {
- PMRelease(printSession);
- return status;
+ PMRelease(printSession);
+ return status;
}
return status;
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index de230da..5143515 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -166,7 +166,7 @@ typedef union MacKeycode_t {
#define ON_KEYPAD(virt) ((virt >= 0x41) && (virt <= 0x5C))
#define IS_PRINTABLE(keychar) ((keychar >= 0x20) && (keychar != 0x7f) && \
- ((keychar < 0xF700) || keychar >= 0xF8FF))
+ ((keychar < 0xF700) || keychar >= 0xF8FF))
/*
* An "index" is 2-bit bitfield showing the state of the Option and Shift
@@ -240,14 +240,14 @@ MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr);
MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window);
MODULE_SCOPE void TkMacOSXDrawCGImage(Drawable d, GC gc, CGContextRef context,
CGImageRef image, unsigned long imageForeground,
- unsigned long imageBackground, CGRect imageBounds,
- CGRect srcBounds, CGRect dstBounds);
+ unsigned long imageBackground, CGRect dstBounds);
MODULE_SCOPE int TkMacOSXSetupDrawingContext(Drawable d, GC gc,
TkMacOSXDrawingContext *dcPtr);
MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
TkMacOSXDrawingContext *dcPtr);
MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel,
CGContextRef context);
+MODULE_SCOPE void TkMacOSXRedrawViewIdleTask(void *clientData);
#define TkMacOSXGetTkWindow(window) ((TkWindow *)Tk_MacOSXGetTkWindow(window))
#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow *)Tk_MacOSXGetNSWindowForDrawable(drawable))
#define TkMacOSXGetNSViewForDrawable(macWin) ((NSView *)Tk_MacOSXGetNSViewForDrawable((Drawable)(macWin)))
@@ -320,9 +320,6 @@ VISIBILITY_HIDDEN
}
@property int poolLock;
@property int macOSVersion;
-@property Bool isDrawing;
-@property Bool needsToDraw;
-@property Bool isSigned;
@property Bool tkLiveResizeEnded;
/*
@@ -392,7 +389,7 @@ VISIBILITY_HIDDEN
- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
- (void)handleURLEvent: (NSAppleEventDescriptor*)event
- withReplyEvent: (NSAppleEventDescriptor*)replyEvent;
+ withReplyEvent: (NSAppleEventDescriptor*)replyEvent;
@end
VISIBILITY_HIDDEN
@@ -411,6 +408,7 @@ VISIBILITY_HIDDEN
}
@property Bool tkNeedsDisplay;
@property NSRect tkDirtyRect;
+@property CGContextRef tkLayerBitmapContext;
@end
@interface TKContentView(TKKeyEvent)
@@ -423,6 +421,7 @@ VISIBILITY_HIDDEN
- (void) clearTkDirtyRect;
- (void) generateExposeEvents: (NSRect) rect;
- (void) tkToolbarButton: (id) sender;
+- (void) resetTkLayerBitmapContext;
@end
@interface NSWindow(TKWm)
@@ -467,6 +466,14 @@ VISIBILITY_HIDDEN
- (NSMenuItem *)itemInSupermenu;
@end
+// Need undocumented appearance: argument
+@interface NSMenu(TKMenu)
+- (BOOL)popUpMenuPositioningItem:(NSMenuItem *)item
+ atLocation:(NSPoint)location
+ inView:(NSView *)view
+ appearance:(NSAppearance *)appearance;
+@end
+
@interface NSMenuItem(TKUtils)
+ (id)itemWithSubmenu:(NSMenu *)submenu;
+ (id)itemWithTitle:(NSString *)title submenu:(NSMenu *)submenu;
@@ -522,18 +529,11 @@ VISIBILITY_HIDDEN
*
* TKNSString --
*
- * When Tcl is compiled with TCL_UTF_MAX = 3 (the default for 8.6) it cannot
- * deal directly with UTF-8 encoded non-BMP characters, since their UTF-8
- * encoding requires 4 bytes. Instead, when using these versions of Tcl, Tk
- * uses the CESU-8 encoding internally. This encoding is similar to UTF-8
- * except that it allows encoding surrogate characters as 3-byte sequences
- * using the same algorithm which UTF-8 uses for non-surrogates. This means
- * that a non-BMP character is encoded as a string of length 6. Apple's
- * NSString class does not provide a constructor which accepts a CESU-8 encoded
+ * Tcl uses modified UTF-8 as internal encoding. Apple's NSString class
+ * does not provide a constructor which accepts a modified UTF-8 encoded
* byte sequence as initial data. So we add a new class which does provide
* such a constructor. It also has a DString property which is a DString whose
- * string pointer is a byte sequence encoding the NSString with the current Tcl
- * internal encoding, namely UTF-8 for Tcl8.7+ or CESU-8 otherwise.
+ * string pointer is a byte sequence encoding the NSString with modified UTF-8.
*
*---------------------------------------------------------------------------
*/
diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c
index 96a61b8..38ff385 100644
--- a/macosx/tkMacOSXScale.c
+++ b/macosx/tkMacOSXScale.c
@@ -169,10 +169,10 @@ TkpDisplayScale(
Tcl_Preserve(scalePtr);
if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) {
Tcl_Preserve(interp);
- if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->format,
- scalePtr->value) < 0) {
- string[TCL_DOUBLE_SPACE - 1] = '\0';
- }
+ if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->format,
+ scalePtr->value) < 0) {
+ string[TCL_DOUBLE_SPACE - 1] = '\0';
+ }
Tcl_DStringInit(&buf);
Tcl_DStringAppend(&buf, scalePtr->command, TCL_INDEX_NONE);
Tcl_DStringAppend(&buf, " ", TCL_INDEX_NONE);
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index a420898..1d4ffec 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -56,32 +56,37 @@ XDestroyWindow(
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *)window;
+ TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(macWin);
+ //fprintf(stderr, "XDestroyWindow: %s with parent %s\n",
+ // Tk_PathName(macWin->winPtr),
+ // Tk_PathName(macWin->winPtr->parentPtr));
/*
* Remove any dangling pointers that may exist if the window we are
* deleting is being tracked by the grab code.
*/
- TkPointerDeadWindow(macWin->winPtr);
TkMacOSXSelDeadWindow(macWin->winPtr);
+ TkPointerDeadWindow(macWin->winPtr);
macWin->toplevel->referenceCount--;
if (!Tk_IsTopLevel(macWin->winPtr)) {
- TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macWin->winPtr->parentPtr != NULL) {
TkMacOSXInvalClipRgns((Tk_Window)macWin->winPtr->parentPtr);
+ Tcl_CancelIdleCall(TkMacOSXRedrawViewIdleTask, (void *) view);
+ Tcl_DoWhenIdle(TkMacOSXRedrawViewIdleTask, (void *) view);
}
if (macWin->visRgn) {
CFRelease(macWin->visRgn);
- macWin->visRgn = NULL;
+ macWin->visRgn = NULL;
}
if (macWin->aboveVisRgn) {
CFRelease(macWin->aboveVisRgn);
- macWin->aboveVisRgn = NULL;
+ macWin->aboveVisRgn = NULL;
}
if (macWin->drawRgn) {
CFRelease(macWin->drawRgn);
- macWin->drawRgn = NULL;
+ macWin->drawRgn = NULL;
}
if (macWin->toplevel->referenceCount == 0) {
@@ -93,15 +98,15 @@ XDestroyWindow(
}
if (macWin->visRgn) {
CFRelease(macWin->visRgn);
- macWin->visRgn = NULL;
+ macWin->visRgn = NULL;
}
if (macWin->aboveVisRgn) {
CFRelease(macWin->aboveVisRgn);
- macWin->aboveVisRgn = NULL;
+ macWin->aboveVisRgn = NULL;
}
if (macWin->drawRgn) {
CFRelease(macWin->drawRgn);
- macWin->drawRgn = NULL;
+ macWin->drawRgn = NULL;
}
macWin->view = nil;
macWin->winPtr->privatePtr = NULL;
@@ -147,11 +152,10 @@ XMapWindow(
return BadWindow;
}
MacDrawable *macWin = (MacDrawable *)window;
- TkWindow *winPtr = macWin->winPtr;
- NSWindow *win = TkMacOSXGetNSWindowForDrawable(window);
static Bool initialized = NO;
NSPoint mouse = [NSEvent mouseLocation];
int x = mouse.x, y = TkMacOSXZeroScreenHeight() - mouse.y;
+ //fprintf(stderr, "XMapWindow: %s\n", Tk_PathName(macWin->winPtr));
/*
* Under certain situations it's possible for this function to be called
@@ -165,29 +169,44 @@ XMapWindow(
TkMacOSXMakeRealWindowExist(macWin->toplevel->winPtr);
}
+ TkWindow *winPtr = macWin->winPtr;
+ NSWindow *win = TkMacOSXGetNSWindowForDrawable(window);
+ TKContentView *view = [win contentView];
LastKnownRequestProcessed(display)++;
if (Tk_IsTopLevel(winPtr)) {
if (!Tk_IsEmbedded(winPtr)) {
- TKContentView *view = [win contentView];
/*
- * We want to activate Tk when a toplevel is mapped but we must not
- * supply YES here. This is because during Tk initialization the
- * root window is mapped before applicationDidFinishLaunching
- * returns. Forcing the app to activate too early can make the menu
- * bar unresponsive.
+ * We want to activate Tk when a toplevel is mapped but we can't
+ * always specify activateIgnoringOtherApps to be YES. This is
+ * because during Tk initialization the root window is mapped
+ * before applicationDidFinishLaunching returns. Forcing the app to
+ * activate too early can make the menu bar unresponsive.
*/
TkMacOSXApplyWindowAttributes(winPtr, win);
[win setExcludedFromWindowsMenu:NO];
[NSApp activateIgnoringOtherApps:initialized];
- [view addTkDirtyRect: [view bounds]];
if (initialized) {
if ([win canBecomeKeyWindow]) {
[win makeKeyAndOrderFront:NSApp];
} else {
[win orderFrontRegardless];
}
+
+ /*
+ * Delay for up to 20 milliseconds until the toplevel has
+ * actually become the highest toplevel. This is to ensure
+ * that the Visibility event occurs after the toplevel is
+ * visible.
+ */
+
+ for (int try = 0; try < 20; try++) {
+ if ([[NSApp orderedWindows] firstObject] == win) {
+ break;
+ }
+ [NSThread sleepForTimeInterval:.001];
+ }
}
/*
@@ -208,9 +227,7 @@ XMapWindow(
*/
TkMacOSXInvalClipRgns(contWinPtr);
- TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
}
- TkMacOSXInvalClipRgns((Tk_Window)winPtr);
} else {
/*
@@ -222,14 +239,13 @@ XMapWindow(
}
/*
- * Mark the toplevel as needing to be redrawn, unless the window is being
- * mapped while drawing is taking place.
+ * If a geometry manager is mapping hundreds of windows we
+ * don't want to redraw the view hundreds of times, so do
+ * it in an idle task.
*/
- TKContentView *view = [win contentView];
- if (view != [NSView focusView]) {
- [view addTkDirtyRect:[view bounds]];
- }
+ Tcl_CancelIdleCall(TkMacOSXRedrawViewIdleTask, (void *) view);
+ Tcl_DoWhenIdle(TkMacOSXRedrawViewIdleTask, (void *) view);
/*
* Generate VisibilityNotify events for window and all mapped children.
@@ -253,7 +269,8 @@ XMapWindow(
*
* NotifyVisibility --
*
- * Recursively called helper proc for XMapWindow().
+ * Helper for XMapWindow(). Generates VisibilityNotify events
+ * for the window and all of its descendants.
*
* Results:
* None.
@@ -308,7 +325,6 @@ XUnmapWindow(
{
MacDrawable *macWin = (MacDrawable *)window;
TkWindow *winPtr = macWin->winPtr;
- TkWindow *parentPtr = winPtr->parentPtr;
NSWindow *win = TkMacOSXGetNSWindowForDrawable(window);
if (!window) {
@@ -353,22 +369,12 @@ XUnmapWindow(
} else {
/*
- * Rebuild the visRgn clip region for the parent so it will be allowed
+ * Rebuild the clip regions for the parent so it will be allowed
* to draw in the space from which this subwindow was removed and then
* redraw the window.
*/
- if (parentPtr && parentPtr->privatePtr->visRgn) {
- TkMacOSXInvalidateViewRegion(
- TkMacOSXGetNSViewForDrawable(parentPtr->window),
- parentPtr->privatePtr->visRgn);
- }
- TkMacOSXInvalClipRgns((Tk_Window)parentPtr);
- TkMacOSXUpdateClipRgn(parentPtr);
- }
- TKContentView *view = [win contentView];
- if (view != [NSView focusView]) {
- [view addTkDirtyRect:[view bounds]];
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr->parentPtr);
}
return Success;
}
@@ -408,7 +414,6 @@ XResizeWindow(
[(TKWindow *)w tkLayoutChanged];
} else {
NSRect r = [w contentRectForFrameRect:[w frame]];
-
r.origin.y += r.size.height - height;
r.size.width = width;
r.size.height = height;
@@ -739,15 +744,10 @@ XConfigureWindow(
NSView *view = TkMacOSXGetNSViewForDrawable(macWin);
if (view) {
- TkMacOSXInvalClipRgns((Tk_Window)winPtr->parentPtr);
- TkpRedrawWidget((Tk_Window)winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
}
}
-#if 0
- TkGenWMMoveRequestEvent(macWin->winPtr,
- macWin->winPtr->changes.x, macWin->winPtr->changes.y);
-#endif
return Success;
}
@@ -964,6 +964,7 @@ TkMacOSXUpdateClipRgn(
}
}
+// Unused and misspelled stub function
/*
*----------------------------------------------------------------------
*
@@ -992,6 +993,11 @@ TkMacOSXVisableClipRgn(
return (Region) HIShapeCreateMutableCopy(winPtr->privatePtr->visRgn);
}
+#if 0
+//This code is not currently used. But it shows how to iterate over the
+//rectangles in a region described by an HIShape. Probably we want to
+//replace the current dirtyRect by such a region.
+
/*
*----------------------------------------------------------------------
*
@@ -1029,9 +1035,13 @@ InvalViewRect(
break;
case kHIShapeEnumerateRect:
dirtyRect = NSRectFromCGRect(CGRectApplyAffineTransform(*rect, t));
- [view addTkDirtyRect:dirtyRect];
+ // Cannot rely on addTkDirtyRect: to force redrawing.
+ //MC This is the only place where the rect is not the view bounds.
+ //And it kills liveResize.
+ //[view generateExposeEvents:dirtyRect];
break;
}
+ [view generateExposeEvents:[view bounds]];
return noErr;
}
@@ -1046,22 +1056,34 @@ TkMacOSXInvalidateViewRegion(
InvalViewRect, view);
}
}
+#endif
/*
*----------------------------------------------------------------------
*
* TkMacOSXInvalidateWindow --
*
- * This function invalidates a window and (optionally) its children.
+ * This stub function redraws the part of the toplevel window
+ * covered by a given Tk window. (Except currently it redraws
+ * the entire toplevel.)
*
* Results:
* None.
*
* Side effects:
- * Damage is created.
+ * The window is redrawn.
*
*----------------------------------------------------------------------
*/
+void
+TkMacOSXRedrawViewIdleTask(
+ void *clientData)
+{
+ TKContentView *view = (TKContentView *) clientData;
+ // fprintf(stderr, "idle redraw for %p\n", view);
+ [view generateExposeEvents:[view bounds]];
+ [view setTkNeedsDisplay:YES];
+}
void
TkMacOSXInvalidateWindow(
@@ -1072,11 +1094,16 @@ TkMacOSXInvalidateWindow(
#ifdef TK_MAC_DEBUG_CLIP_REGIONS
TkMacOSXDbgMsg("%s", macWin->winPtr->pathName);
#endif
- if (macWin->flags & TK_CLIP_INVALID) {
- TkMacOSXUpdateClipRgn(macWin->winPtr);
+ TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(macWin);
+ TkWindow *winPtr = macWin->winPtr;
+ Tk_Window tkwin = (Tk_Window) winPtr;
+ Tk_Window parent = (Tk_Window) winPtr->parentPtr;
+ TkMacOSXInvalClipRgns(tkwin);
+ if ((flag == TK_PARENT_WINDOW) && parent){
+ TkMacOSXInvalClipRgns(parent);
}
- TkMacOSXInvalidateViewRegion(TkMacOSXGetNSViewForDrawable(macWin),
- (flag == TK_WINDOW_ONLY) ? macWin->visRgn : macWin->aboveVisRgn);
+ [view generateExposeEvents:[view bounds]];
+ [view setTkNeedsDisplay:YES];
}
/*
@@ -1105,17 +1132,19 @@ Tk_MacOSXGetNSWindowForDrawable(
if (!macWin || macWin->flags & TK_IS_PIXMAP) {
result = nil;
+
} else if (macWin->toplevel && macWin->toplevel->winPtr &&
macWin->toplevel->winPtr->wmInfoPtr &&
macWin->toplevel->winPtr->wmInfoPtr->window) {
result = macWin->toplevel->winPtr->wmInfoPtr->window;
+
} else if (macWin->winPtr && macWin->winPtr->wmInfoPtr &&
macWin->winPtr->wmInfoPtr->window) {
result = macWin->winPtr->wmInfoPtr->window;
+
} else if (macWin->toplevel && (macWin->toplevel->flags & TK_EMBEDDED)) {
TkWindow *contWinPtr = (TkWindow *)Tk_GetOtherWindow((Tk_Window)macWin->toplevel->winPtr);
-
- if (contWinPtr) {
+ if (contWinPtr && contWinPtr->privatePtr) {
result = TkMacOSXGetNSWindowForDrawable((Drawable)contWinPtr->privatePtr);
}
}
diff --git a/macosx/tkMacOSXSysTray.c b/macosx/tkMacOSXSysTray.c
index 76186cc..99ffc9b 100644
--- a/macosx/tkMacOSXSysTray.c
+++ b/macosx/tkMacOSXSysTray.c
@@ -205,7 +205,7 @@ MacSystrayObjCmd(
static const char *modifyOptions[] =
{"image", "text", "b1_callback", "b3_callback", NULL};
typedef enum {TRAY_IMAGE, TRAY_TEXT, TRAY_B1_CALLBACK, TRAY_B3_CALLBACK
- } modifyOptionsEnum;
+ } modifyOptionsEnum;
if ([NSApp macOSVersion] < 101000) {
Tcl_AppendResult(interp,
@@ -329,9 +329,9 @@ MacSystrayObjCmd(
break;
}
- /*
- * Modify the text for the tooltip.
- */
+ /*
+ * Modify the text for the tooltip.
+ */
case TRAY_TEXT: {
NSString *tooltip = [NSString stringWithUTF8String:Tcl_GetString(objv[3])];
@@ -345,9 +345,9 @@ MacSystrayObjCmd(
break;
}
- /*
- * Modify the proc for the callback.
- */
+ /*
+ * Modify the proc for the callback.
+ */
case TRAY_B1_CALLBACK: {
[statusItem setB1Callback : objv[3]];
@@ -365,14 +365,14 @@ MacSystrayObjCmd(
/*
* Set all properties to nil, and release statusItem.
*/
- [statusItem setImagewithImage: nil];
- [statusItem setTextwithString: nil];
- [statusItem setB1Callback : NULL];
- [statusItem setB3Callback : NULL];
- [statusItem release];
- *info = NULL;
- statusItem = NULL;
- break;
+ [statusItem setImagewithImage: nil];
+ [statusItem setTextwithString: nil];
+ [statusItem setB1Callback : NULL];
+ [statusItem setB3Callback : NULL];
+ [statusItem release];
+ *info = NULL;
+ statusItem = NULL;
+ break;
}
}
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index 0e0b06b..b36c283 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -140,6 +140,8 @@ MenuBarHeightObjCmd(
* Returns true if and only if the NSView of the drawable is the
* current focusView, which on 10.14 and newer systems can only be the
* case when within [NSView drawRect].
+ * NOTE: This is no longer needed when we use updateLayer instead
+ * of drawRect. Now it always returns True.
*
* Side effects:
* None
@@ -151,21 +153,8 @@ MODULE_SCOPE Bool
TkTestLogDisplay(
Drawable drawable)
{
- MacDrawable *macWin = (MacDrawable *)drawable;
- NSWindow *win = nil;
- if (macWin->toplevel && macWin->toplevel->winPtr &&
- macWin->toplevel->winPtr->wmInfoPtr &&
- macWin->toplevel->winPtr->wmInfoPtr->window) {
- win = macWin->toplevel->winPtr->wmInfoPtr->window;
- } else if (macWin->winPtr && macWin->winPtr->wmInfoPtr &&
- macWin->winPtr->wmInfoPtr->window) {
- win = macWin->winPtr->wmInfoPtr->window;
- }
- if (win) {
- return ([win contentView] == [NSView focusView]);
- } else {
- return True;
- }
+ (void) drawable;
+ return True;
}
/*
@@ -209,8 +198,8 @@ PressButtonObjCmd(
}
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "x y");
- return TCL_ERROR;
+ Tcl_WrongNumArgs(interp, 1, objv, "x y");
+ return TCL_ERROR;
}
for (i = 1; i < objc; i++) {
if (Tcl_GetIntFromObj(interp,objv[i],&value) != TCL_OK) {
@@ -308,8 +297,8 @@ MoveMouseObjCmd(
}
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "x y");
- return TCL_ERROR;
+ Tcl_WrongNumArgs(interp, 1, objv, "x y");
+ return TCL_ERROR;
}
for (i = 1; i < objc; i++) {
if (Tcl_GetIntFromObj(interp,objv[i],&value) != TCL_OK) {
@@ -370,12 +359,12 @@ InjectKeyEventObjCmd(
if (objc < 3) {
wrongArgs:
- Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?");
- return TCL_ERROR;
+ Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?");
+ return TCL_ERROR;
}
if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
- sizeof(char *), "option", 0, &index) != TCL_OK) {
- return TCL_ERROR;
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
}
type = types[index];
if (Tcl_GetIntFromObj(interp, objv[2], &keysym) != TCL_OK) {
@@ -387,37 +376,37 @@ InjectKeyEventObjCmd(
macKC.uint = XKeysymToKeycode(NULL, keysym);
for (i = 3; i < objc; i++) {
if (Tcl_GetIndexFromObjStruct(interp, objv[i], argStrings,
- sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
- return TCL_ERROR;
- }
- switch ((enum args) index) {
+ sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ switch ((enum args) index) {
case KEYEVENT_SHIFT:
mods |= NSShiftKeyMask;
- break;
+ break;
case KEYEVENT_CONTROL:
mods |= NSControlKeyMask;
- break;
+ break;
case KEYEVENT_OPTION:
mods |= NSAlternateKeyMask;
- break;
+ break;
case KEYEVENT_COMMAND:
mods |= NSCommandKeyMask;
- break;
+ break;
case KEYEVENT_FUNCTION:
mods |= NSFunctionKeyMask;
- break;
+ break;
case KEYEVENT_X:
if (++i >= objc) {
- goto wrongArgs;
- }
+ goto wrongArgs;
+ }
if (Tcl_GetIntFromObj(interp,objv[i], &x) != TCL_OK) {
return TCL_ERROR;
}
break;
case KEYEVENT_Y:
if (++i >= objc) {
- goto wrongArgs;
- }
+ goto wrongArgs;
+ }
if (Tcl_GetIntFromObj(interp,objv[i], &y) != TCL_OK) {
return TCL_ERROR;
}
@@ -445,7 +434,7 @@ InjectKeyEventObjCmd(
}
keyEvent = [NSEvent keyEventWithType:type
location:NSMakePoint(x, y)
- modifierFlags:mods
+ modifierFlags:mods
timestamp:GetCurrentEventTime()
windowNumber:0
context:nil
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index e261bee..2915af1 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -150,7 +150,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
}
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window
- defaultFrame:(NSRect)newFrame
+ defaultFrame:(NSRect)newFrame
{
(void)window;
@@ -244,7 +244,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
[view viewDidChangeEffectiveAppearance];
}
#endif
- [view addTkDirtyRect:[view bounds]];
+ [view setTkNeedsDisplay:YES];
Tcl_CancelIdleCall(TkMacOSXDrawAllViews, NULL);
Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
}
@@ -256,7 +256,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
TkWindow *winPtr = TkMacOSXGetTkWindow(w);
if (winPtr) {
- while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
}
}
@@ -284,9 +284,11 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
NSWindow *w = [notification object];
TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+#if 0
if (winPtr) {
- //Tk_UnmapWindow((Tk_Window)winPtr);
+ Tk_UnmapWindow((Tk_Window)winPtr);
}
+#endif
}
#endif /* TK_MAC_DEBUG_NOTIFICATIONS */
@@ -396,7 +398,7 @@ static void RefocusGrabWindow(void *data) {
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender
- hasVisibleWindows:(BOOL)flag
+ hasVisibleWindows:(BOOL)flag
{
(void)sender;
(void)flag;
@@ -473,31 +475,11 @@ static void RefocusGrabWindow(void *data) {
*
*----------------------------------------------------------------------
*/
-
+//XXXXX This stub is not used with CGImage drawing.
int
TkpWillDrawWidget(Tk_Window tkwin) {
- int result;
- if (tkwin) {
- TkWindow *winPtr = (TkWindow *)tkwin;
- TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(
- (Drawable)winPtr->privatePtr);
- result = ([NSApp isDrawing] && view == [NSView focusView]);
-#if 0
- printf("TkpWillDrawWidget: %s %d %d \n", Tk_PathName(tkwin),
- [NSApp isDrawing], (view == [NSView focusView]));
- if (!result) {
- NSRect dirtyRect;
- TkMacOSXWinNSBounds(winPtr, view, &dirtyRect);
- printf("TkpAppCanDraw: dirtyRect for %s is %s\n",
- Tk_PathName(tkwin),
- NSStringFromRect(dirtyRect).UTF8String);
- [view addTkDirtyRect:dirtyRect];
- }
-#endif
- } else {
- result = [NSApp isDrawing];
- }
- return result;
+ (void) tkwin;
+ return false;
}
/*
@@ -527,11 +509,14 @@ GenerateUpdates(
TkWindow *childPtr;
XEvent event;
CGRect bounds, damageBounds;
+ NSView *view = TkMacOSXGetNSViewForDrawable((Drawable)winPtr->privatePtr);
TkMacOSXWinCGBounds(winPtr, &bounds);
+#if 0
if (!CGRectIntersectsRect(bounds, *updateBounds)) {
return 0;
}
+#endif
/*
* Compute the bounding box of the area that the damage occurred in.
@@ -548,7 +533,11 @@ GenerateUpdates(
event.xexpose.width = damageBounds.size.width;
event.xexpose.height = damageBounds.size.height;
event.xexpose.count = 0;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ if ([view inLiveResize]) {
+ Tk_HandleEvent(&event);
+ } else {
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ }
#ifdef TK_MAC_DEBUG_DRAWING
TKLog(@"Exposed %p {{%d, %d}, {%d, %d}}", event.xany.window, event.xexpose.x,
@@ -970,22 +959,10 @@ ConfigureRestrictProc(
{
self = [super initWithFrame:frame];
if (self) {
- /*
- * The layer must exist before we set wantsLayer to YES.
- */
-
- self.layer = [CALayer layer];
self.wantsLayer = YES;
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay;
self.layer.contentsGravity = self.layer.contentsAreFlipped ?
kCAGravityTopLeft : kCAGravityBottomLeft;
-
- /*
- * Nothing gets drawn at all if the layer does not have a delegate.
- * Currently, we do not implement any methods of the delegate, however.
- */
-
- self.layer.delegate = (id) self;
trackingArea = [[NSTrackingArea alloc]
initWithRect:[self bounds]
options:(NSTrackingMouseEnteredAndExited |
@@ -995,18 +972,38 @@ ConfigureRestrictProc(
NSTrackingActiveAlways)
owner:self
userInfo:nil];
- [self addTrackingArea:trackingArea];
+ [self addTrackingArea:trackingArea];
}
return self;
}
-/*
- * We will just use drawRect.
- */
-
- (BOOL) wantsUpdateLayer
{
- return NO;
+ return YES;
+}
+- (void) updateLayer {
+ CGContextRef context = self.tkLayerBitmapContext;
+ if (context) {
+ /*
+ * Create a CGImage by copying (probably using copy-on-write) the
+ * bitmap data of the CGBitmapContext that we have been using for
+ * drawing. Then render that CGImage into the CALayer of this view by
+ * assigning a reference to the CGImage to the contents property of the
+ * layer. This will cause all drawing done since the last call to this
+ * function to become visible.
+ */
+
+ CGImageRef newImg = CGBitmapContextCreateImage(context);
+ self.layer.contents = (__bridge id) newImg;
+ CGImageRelease(newImg); // will quickly leak memory if this is missing
+
+ /*
+ * Run any pending widget display procs as part of the update.
+ */
+
+ while(Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
+ [self setTkNeedsDisplay:NO];
+ }
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
@@ -1021,6 +1018,9 @@ ConfigureRestrictProc(
*/
self.layer.contentsScale = self.window.screen.backingScaleFactor;
+ [self resetTkLayerBitmapContext];
+ // need to redraw
+ [self generateExposeEvents: self.bounds];
}
#endif
@@ -1028,84 +1028,39 @@ ConfigureRestrictProc(
{
_tkNeedsDisplay = YES;
_tkDirtyRect = NSUnionRect(_tkDirtyRect, rect);
- [NSApp setNeedsToDraw:YES];
- [self setNeedsDisplay:YES];
- [[self layer] setNeedsDisplay];
}
- (void) clearTkDirtyRect
{
_tkNeedsDisplay = NO;
_tkDirtyRect = NSZeroRect;
- [NSApp setNeedsToDraw:NO];
-}
-
-- (void) drawRect: (NSRect) rect
-{
- (void)rect;
-
-#ifdef TK_MAC_DEBUG_DRAWING
- TkWindow *winPtr = TkMacOSXGetTkWindow([self window]);
- if (winPtr) {
- fprintf(stderr, "drawRect: drawing %s in %s\n",
- Tk_PathName(winPtr), NSStringFromRect(rect).UTF8String);
- }
-#endif
-
- /*
- * We do not allow recursive calls to drawRect, but we only log them on OSX
- * > 10.13, where they should never happen.
- */
-
- if ([NSApp isDrawing]) {
- if ([NSApp macOSVersion] > 101300) {
- TKLog(@"WARNING: a recursive call to drawRect was aborted.");
- }
- return;
- }
-
- [NSApp setIsDrawing: YES];
- [self clearTkDirtyRect];
- [self generateExposeEvents:rect];
- [NSApp setIsDrawing:NO];
-
-#ifdef TK_MAC_DEBUG_DRAWING
- fprintf(stderr, "drawRect: done.\n");
-#endif
}
-(void) setFrameSize: (NSSize)newsize
{
+ NSSize oldsize = self.bounds.size;
[super setFrameSize: newsize];
+ if ((newsize.width == 1 && newsize.height == 1) ||
+ (oldsize.width == 0 && oldsize.height == 0)) {
+ return;
+ }
NSWindow *w = [self window];
TkWindow *winPtr = TkMacOSXGetTkWindow(w);
Tk_Window tkwin = (Tk_Window)winPtr;
- if (![self inLiveResize] &&
- [w respondsToSelector: @selector (tkLayoutChanged)]) {
- [(TKWindow *)w tkLayoutChanged];
- }
-
if (winPtr) {
- unsigned int width = (unsigned int)newsize.width;
- unsigned int height=(unsigned int)newsize.height;
+ unsigned int width = (unsigned int) newsize.width;
+ unsigned int height= (unsigned int) newsize.height;
void *oldArg;
Tk_RestrictProc *oldProc;
/*
- * This can be called from outside the Tk event loop. Since it calls
- * Tcl_DoOneEvent, we need to make sure we don't clobber the
- * AutoreleasePool set up by the caller.
+ * This function can be re-entered, so we need to make sure we don't
+ * clobber any AutoreleasePool set up by the caller.
*/
[NSApp _lockAutoreleasePool];
- /*
- * Disable Tk drawing until the window has been completely configured.
- */
-
- TkMacOSXSetDrawingEnabled(winPtr, 0);
-
/*
* Generate and handle a ConfigureNotify event for the new size.
*/
@@ -1113,24 +1068,31 @@ ConfigureRestrictProc(
TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height,
TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY);
oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg);
+ while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
Tk_RestrictEvents(oldProc, oldArg, &oldArg);
+
/*
- * Now that Tk has configured all subwindows, create the clip regions.
+ * Update Tk's window data for the new size.
*/
- TkMacOSXSetDrawingEnabled(winPtr, 1);
- TkMacOSXInvalClipRgns(tkwin);
- TkMacOSXUpdateClipRgn(winPtr);
+ if ([w respondsToSelector: @selector (tkLayoutChanged)]) {
+ [(TKWindow *)w tkLayoutChanged];
+ }
- /*
- * Generate and process expose events to redraw the window. To avoid
- * crashes, only do this if we are being called from drawRect. See
- * ticket [1fa8c3ed8d].
- */
+ /*
+ * Reset the cgimage layer and redraw the entire content view.
+ */
+
+ [self viewDidChangeBackingProperties];
+
+ /*
+ * In live resize we seem to need to draw a second time to
+ * avoid artifacts.
+ */
- if([NSApp isDrawing] || [self inLiveResize]) {
- [self generateExposeEvents: [self bounds]];
+ if ([self inLiveResize]) {
+ [self generateExposeEvents:self.bounds];
}
/*
@@ -1138,7 +1100,14 @@ ConfigureRestrictProc(
*/
[NSApp _unlockAutoreleasePool];
+
}
+
+ /*
+ * Request a call to updateLayer.
+ */
+
+ [self setNeedsDisplay:YES];
}
/*
@@ -1150,53 +1119,62 @@ ConfigureRestrictProc(
- (void) generateExposeEvents: (NSRect) rect
{
- unsigned long serial;
- int updatesNeeded;
CGRect updateBounds;
TkWindow *winPtr = TkMacOSXGetTkWindow([self window]);
void *oldArg;
Tk_RestrictProc *oldProc;
- if (!winPtr) {
+ static int reentered = 0;
+
+ if (!winPtr ||
+ (winPtr->flags & (TK_ALREADY_DEAD)) ||
+ !Tk_IsMapped(winPtr)) {
return;
}
+ if (reentered) {
+ /*
+ * When in liveResize an event loop gets run below to
+ * immediately process displayProcs while the resize is being
+ * done. Those can cause calls to this function, leading to
+ * crashes or very poor performance. The reentered flag is
+ * used to detect this.
+ */
+ //fprintf(stderr, "Recursive call to generateExposeEvents\n");
+ return;
+ }
+ reentered = 1;
+
/*
* Generate Tk Expose events. All of these events will share the same
* serial number.
*/
-
- updateBounds = NSRectToCGRect(rect);
+ if ([self inLiveResize]) {
+ updateBounds = [self bounds];
+ } else {
+ updateBounds = NSRectToCGRect(rect);
+ }
updateBounds.origin.y = ([self bounds].size.height - updateBounds.origin.y
- updateBounds.size.height);
- updatesNeeded = GenerateUpdates(&updateBounds, winPtr);
- if (updatesNeeded) {
-
- serial = LastKnownRequestProcessed(Tk_Display(winPtr));
-
+ if ( GenerateUpdates(&updateBounds, winPtr)) {
/*
- * Use the ExposeRestrictProc to process only the expose events. This
- * will create idle drawing tasks, which we handle before we return.
+ * Use the ExposeRestrictProc to process the expose events we just
+ * generated. This will create idle drawing tasks, which we handle
+ * before we return in the case of a live resize.
*/
-
- oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg);
- while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {};
- Tk_RestrictEvents(oldProc, oldArg, &oldArg);
+ unsigned int serial = LastKnownRequestProcessed(Tk_Display(winPtr));
+ oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg);
+ while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {};
+ Tk_RestrictEvents(oldProc, NULL, &oldArg);
/*
- * Starting with OSX 10.14, which uses Core Animation to draw windows,
- * all drawing must be done within the drawRect method. (The CGContext
- * which draws to the backing CALayer is created by the NSView before
- * calling drawRect, and destroyed when drawRect returns. Drawing done
- * with the current CGContext outside of the drawRect method has no
- * effect.)
- *
- * Fortunately, Tk schedules all drawing to be done while Tcl is idle.
- * So to run any display procs which were scheduled by the expose
- * events we process all idle events before returning.
+ * During a LiveResize we process all idle tasks generated by the
+ * expose events to redraw the window while it is being resized.
*/
-
- while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
+ if ([self inLiveResize]) {
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
+ }
}
+ reentered = 0;
}
/*
@@ -1242,7 +1220,7 @@ static const char *const accentNames[] = {
}
NSString *accent = [preferences stringForKey:@"AppleAccentColor"];
NSArray *words = [[preferences stringForKey:@"AppleHighlightColor"]
- componentsSeparatedByString: @" "];
+ componentsSeparatedByString: @" "];
NSString *highlight = [words count] > 3 ? [words objectAtIndex:3] : nil;
const char *accentName = accent ? accentNames[1 + accent.intValue] : defaultColor;
const char *highlightName = highlight ? highlight.UTF8String: defaultColor;
@@ -1251,6 +1229,7 @@ static const char *const accentNames[] = {
effectiveAppearanceName.UTF8String, accentName,
highlightName);
Tk_SendVirtualEvent(tkwin, "AppearanceChanged", Tcl_NewStringObj(data, TCL_INDEX_NONE));
+ [self generateExposeEvents:self.bounds];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
@@ -1352,6 +1331,32 @@ static const char *const accentNames[] = {
return [super validRequestorForSendType:sendType returnType:returnType];
}
+-(void) resetTkLayerBitmapContext {
+ static CGColorSpaceRef colorspace = NULL;
+ if (colorspace == NULL) {
+ colorspace = CGColorSpaceCreateDeviceRGB();
+ CGColorSpaceRetain(colorspace);
+ }
+ CGContextRef newCtx = CGBitmapContextCreate(
+ NULL, self.layer.contentsScale * self.frame.size.width,
+ self.layer.contentsScale * self.frame.size.height, 8, 0, colorspace,
+ kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipLast // will also need to specify this when capturing
+ );
+ CGContextScaleCTM(newCtx, self.layer.contentsScale, self.layer.contentsScale);
+#if 0
+ fprintf(stderr, "rTkLBC %.1f %s %p %p %ld\n", (float)self.layer.contentsScale,
+ NSStringFromSize(self.frame.size).UTF8String, colorspace, newCtx,
+ self.tkLayerBitmapContext ?
+ (long)CFGetRetainCount(self.tkLayerBitmapContext) : INT_MIN);
+ fprintf(stderr, "rTkLBC %p %ld\n", self.tkLayerBitmapContext,
+ (long)(self.tkLayerBitmapContext ?
+ CFGetRetainCount(self.tkLayerBitmapContext) : LONG_MIN));
+#endif
+ // The context is also released in TkWmDeadWindow.
+ CGContextRelease(self.tkLayerBitmapContext);
+ self.tkLayerBitmapContext = newCtx;
+}
+
@end
/*
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 2f134f7..fbea56b 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -112,7 +112,7 @@ static const struct {
.forceOnAttrs = kWindowNoTitleBarAttribute |
kWindowDoesNotCycleAttribute,
.flags = WM_TOPMOST,
- .styleMask = 0},
+ .styleMask = 0},
[kSheetWindowClass] = {
.validAttrs = kWindowResizableAttribute,
.forceOnAttrs = kWindowNoTitleBarAttribute |
@@ -291,6 +291,7 @@ static void syncLayout(NSWindow *macWindow)
contentRect.size.width;
wmPtr->parentHeight = winPtr->changes.height + frameRect.size.height -
contentRect.size.height;
+ TkMacOSXInvalClipRgns((Tk_Window)winPtr);
}
}
#endif
@@ -587,6 +588,8 @@ static void placeAsTab(TKWindow *macWindow) {
- (void) tkLayoutChanged
{
syncLayout(self);
+ [[self contentView] setNeedsDisplay:YES];
+ Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
}
@end
@@ -606,6 +609,8 @@ static void placeAsTab(TKWindow *macWindow) {
- (void) tkLayoutChanged
{
syncLayout(self);
+ [[self contentView] setNeedsDisplay:YES];
+ Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
@@ -621,7 +626,7 @@ static void placeAsTab(TKWindow *macWindow) {
#endif
- (NSSize)windowWillResize:(NSWindow *)sender
- toSize:(NSSize)frameSize
+ toSize:(NSSize)frameSize
{
NSRect currentFrame = [sender frame];
TkWindow *winPtr = TkMacOSXGetTkWindow(sender);
@@ -818,30 +823,29 @@ FrontWindowAtPoint(
int y)
{
NSPoint p = NSMakePoint(x, TkMacOSXZeroScreenHeight() - y);
- NSArray *windows = [NSApp orderedWindows];
- TkWindow *winPtr = NULL;
- for (NSWindow *w in windows) {
- winPtr = TkMacOSXGetTkWindow(w);
+ for (NSWindow *w in [NSApp orderedWindows]) {
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
if (winPtr) {
- WmInfo *wmPtr = winPtr->wmInfoPtr;
NSRect windowFrame = [w frame];
- NSRect contentFrame = [w frame];
+ NSRect contentFrame = windowFrame;
- contentFrame.size.height = [[w contentView] frame].size.height;
/*
* For consistency with other platforms, points in the
* title bar are not considered to be contained in the
* window.
*/
- if ((wmPtr->hints.initial_state == NormalState ||
- wmPtr->hints.initial_state == ZoomState)) {
- if (NSMouseInRect(p, contentFrame, NO)) {
- return winPtr;
- } else if (NSMouseInRect(p, windowFrame, NO)) {
- return NULL;
- }
+ contentFrame.size.height = [[w contentView] frame].size.height;
+ if (NSMouseInRect(p, contentFrame, NO)) {
+ return winPtr;
+ } else if (NSMouseInRect(p, windowFrame, NO)) {
+ /*
+ * The pointer is in the title bar of the highest NSWindow
+ * containing it, and therefore it should not be considered
+ * to be contained in any Tk window.
+ */
+ return NULL;
}
}
}
@@ -1100,12 +1104,15 @@ TkWmUnmapWindow(
*
* This procedure is invoked when a top-level window is about to be
* deleted. It cleans up the wm-related data structures for the window.
+ * If the dead window contains the pointer, TkUpdatePointer is called
+ * to tell Tk which window will be the new pointer window.
*
* Results:
* None.
*
* Side effects:
- * The WmInfo structure for winPtr gets freed up.
+ * The WmInfo structure for winPtr gets freed. Tk's cached pointer
+ * window may change.
*
*----------------------------------------------------------------------
*/
@@ -1114,13 +1121,15 @@ void
TkWmDeadWindow(
TkWindow *winPtr) /* Top-level window that's being deleted. */
{
+ TkWindow *winPtr2;
+ NSWindow *w;
WmInfo *wmPtr = winPtr->wmInfoPtr, *wmPtr2;
- TKWindow *deadNSWindow;
-
- if (wmPtr == NULL) {
- return;
+ TKWindow *deadNSWindow = NULL;
+ if (Tk_WindowId(winPtr) == None) {
+ fprintf(stderr, "TkWmDeadWindow: no window id\n");
+ } else {
+ deadNSWindow = (TKWindow *)TkMacOSXGetNSWindowForDrawable(Tk_WindowId(winPtr));
}
-
/*
*If the dead window is a transient, remove it from the container's list.
*/
@@ -1172,11 +1181,10 @@ TkWmDeadWindow(
for (Transient *transientPtr = wmPtr->transientPtr;
transientPtr != NULL; transientPtr = transientPtr->nextPtr) {
- TkWindow *winPtr2 = transientPtr->winPtr;
- TkWindow *containerPtr = (TkWindow *)TkMacOSXGetContainer(winPtr2);
-
+ TkWindow *containerPtr = (TkWindow *)TkMacOSXGetContainer(
+ transientPtr->winPtr);
if (containerPtr == winPtr) {
- wmPtr2 = winPtr2->wmInfoPtr;
+ wmPtr2 = transientPtr->winPtr->wmInfoPtr;
wmPtr2->container = NULL;
}
}
@@ -1188,29 +1196,48 @@ TkWmDeadWindow(
ckfree(transientPtr);
}
- deadNSWindow = (TKWindow *)wmPtr->window;
-
/*
* Remove references to the Tk window from the mouse event processing
- * state which is recorded in the NSApplication object.
+ * state which is recorded in the NSApplication object and notify Tk
+ * of the new pointer window.
*/
- if (winPtr == [NSApp tkPointerWindow]) {
- NSWindow *w;
- NSPoint mouse = [NSEvent mouseLocation];
- [NSApp setTkPointerWindow:nil];
- for (w in [NSApp orderedWindows]) {
- if (w == deadNSWindow) {
- continue;
- }
- if (NSPointInRect(mouse, [w frame])) {
- TkWindow *winPtr2 = TkMacOSXGetTkWindow(w);
- int x = mouse.x, y = TkMacOSXZeroScreenHeight() - mouse.y;
- [NSApp setTkPointerWindow:winPtr2];
- Tk_UpdatePointer((Tk_Window) winPtr2, x, y,
- [NSApp tkButtonState]);
- break;
- }
+ NSPoint mouse = [NSEvent mouseLocation];
+ [NSApp setTkPointerWindow:nil];
+ winPtr2 = NULL;
+
+ for (w in [NSApp orderedWindows]) {
+ if (w == deadNSWindow || w == NULL) {
+ continue;
+ }
+ winPtr2 = TkMacOSXGetTkWindow(w);
+ if (winPtr2 == NULL) {
+ continue;
+ }
+ if (NSPointInRect(mouse, [w frame])) {
+ [NSApp setTkPointerWindow: winPtr2];
+ break;
+ }
+ }
+ if (winPtr2) {
+ /*
+ * We now know which toplevel will contain the pointer when the window
+ * is destroyed. We need to know which Tk window within the
+ * toplevel will contain the pointer.
+ */
+ NSPoint local = [w tkConvertPointFromScreen: mouse];
+ int top_x = floor(local.x),
+ top_y = floor(w.frame.size.height - local.y);
+ int root_x = floor(mouse.x),
+ root_y = floor(TkMacOSXZeroScreenHeight() - mouse.y);
+ int win_x, win_y;
+ Tk_Window target = Tk_TopCoordsToWindow((Tk_Window) winPtr2, top_x, top_y, &win_x, &win_y);
+ /*
+ * A non-toplevel window can have a NULL parent while it is in the process of
+ * being destroyed. We should not call Tk_UpdatePointer in that case.
+ */
+ if (Tk_Parent(target) != NULL || Tk_IsTopLevel(target)) {
+ Tk_UpdatePointer(target, root_x, root_y, [NSApp tkButtonState]);
}
}
@@ -1223,9 +1250,9 @@ TkWmDeadWindow(
if (deadNSWindow && !Tk_IsEmbedded(winPtr)) {
NSWindow *parent = [deadNSWindow parentWindow];
[deadNSWindow setTkWindow:None];
- if (winPtr->window) {
- ((MacDrawable *)winPtr->window)->view = nil;
- }
+ if (winPtr->window) {
+ ((MacDrawable *)winPtr->window)->view = nil;
+ }
wmPtr->window = NULL;
if (parent) {
@@ -1262,9 +1289,10 @@ TkWmDeadWindow(
* set tkEventTarget to NULL when there is no window to send Tk events to.
*/
TkWindow *newTkEventTarget = NULL;
+ winPtr2 = NULL;
- for (NSWindow *w in [NSApp orderedWindows]) {
- TkWindow *winPtr2 = TkMacOSXGetTkWindow(w);
+ for (w in [NSApp orderedWindows]) {
+ winPtr2 = TkMacOSXGetTkWindow(w);
BOOL isOnScreen;
if (!winPtr2 || !winPtr2->wmInfoPtr) {
@@ -1290,6 +1318,14 @@ TkWmDeadWindow(
[NSApp _setKeyWindow:nil];
[NSApp _setMainWindow:nil];
}
+
+ /*
+ * Avoid redrawing the view after it is released.
+ */
+
+ TKContentView *deadView = [deadNSWindow contentView];
+ Tcl_CancelIdleCall(TkMacOSXRedrawViewIdleTask,(void *) deadView);
+ CGContextRelease(deadView.tkLayerBitmapContext);
[deadNSWindow close];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
@@ -1749,7 +1785,7 @@ WmSetAttribute(
} else if (![macWindow isKindOfClass: [NSPanel class]] &&
styleMaskBits[index].allowed == NSWindowClass_panel) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "styleMask bit \"%s\" can only be used with an NSPanel",
+ "styleMask bit \"%s\" can only be used with an NSPanel",
styleMaskBits[index].bitname));
Tcl_SetErrorCode(interp, "TK", "INVALID_STYLEMASK_BIT", NULL);
return TCL_ERROR;
@@ -1794,15 +1830,15 @@ WmSetAttribute(
fprintf(stderr, "Current styleMask: %lx\n", [macWindow styleMask]);
fprintf(stderr, "Setting styleMask to %lx\n", styleMaskValue);
#endif
- macWindow.styleMask = (unsigned long) styleMaskValue;
+ macWindow.styleMask = (unsigned long) styleMaskValue;
NSRect newFrame = [macWindow frame];
int heightDiff = newFrame.size.height - oldFrame.size.height;
int newHeight = heightDiff < 0 ? newFrame.size.height :
newFrame.size.height - heightDiff;
[(TKWindow *)macWindow tkLayoutChanged];
if (heightDiff) {
- //Calling XMoveResizeWindow twice is a hack to force a relayout
- //of the window.
+ // Calling XMoveResizeWindow twice is a hack to force a relayout
+ // of the window.
XMoveResizeWindow(winPtr->display, winPtr->window,
winPtr->changes.x, winPtr->changes.y,
newFrame.size.width, newHeight - 1);
@@ -2390,8 +2426,7 @@ WmDeiconifyCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- NSWindow *win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
-
+ NSWindow *win = nil;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
@@ -2410,11 +2445,17 @@ WmDeiconifyCmd(
return TCL_ERROR;
}
+ if (winPtr->window) {
+ win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ }
TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
ZoomState : NormalState);
- [win setExcludedFromWindowsMenu:NO];
- TkMacOSXApplyWindowAttributes(winPtr, win);
- [win orderFront:NSApp];
+ if (win) {
+ [win setExcludedFromWindowsMenu:NO];
+ TkMacOSXApplyWindowAttributes(winPtr, win);
+ [win orderFront:NSApp];
+ [[win contentView] setTkNeedsDisplay:YES];
+ }
if (wmPtr->icon) {
Tk_UnmapWindow((Tk_Window)wmPtr->icon);
}
@@ -2439,7 +2480,6 @@ WmDeiconifyCmd(
}
}
- [[win contentView] setNeedsDisplay:YES];
Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
return TCL_OK;
}
@@ -2541,19 +2581,18 @@ WmForgetCmd(
macWin->toplevel->referenceCount++;
macWin->flags &= ~TK_HOST_EXISTS;
- TkWmDeadWindow(winPtr);
RemapWindows(winPtr, (MacDrawable *)winPtr->parentPtr->window);
- /*
- * Make sure wm no longer manages this window
- */
- Tk_ManageGeometry(frameWin, NULL, NULL);
+ /*
+ * Make sure wm no longer manages this window
+ */
+ Tk_ManageGeometry(frameWin, NULL, NULL);
winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
/*
- * Flags (above) must be cleared before calling TkMapTopFrame (below).
- */
+ * Flags (above) must be cleared before calling TkMapTopFrame (below).
+ */
TkMapTopFrame(frameWin);
} else {
@@ -2632,11 +2671,13 @@ WmGeometryCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- NSWindow *win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ NSWindow *win = nil;
char xSign = '+', ySign = '+';
int width, height, x = wmPtr->x, y= wmPtr->y;
char *argv3;
-
+ if (winPtr && winPtr->window) {
+ win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ }
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
return TCL_ERROR;
@@ -3382,18 +3423,23 @@ WmIconwindowCmd(
return TCL_ERROR;
}
if (wmPtr->icon != NULL) {
+ NSWindow *win = nil;
TkWindow *oldIcon = (TkWindow *)wmPtr->icon;
- WmInfo *wmPtr3 = oldIcon->wmInfoPtr;
- NSWindow *win = TkMacOSXGetNSWindowForDrawable(oldIcon->window);
-
+ if (winPtr && winPtr->window) {
+ win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ }
/*
* The old icon should be withdrawn.
*/
-
- TkpWmSetState(oldIcon, WithdrawnState);
+ if (oldIcon) {
+ WmInfo *wmPtr3 = oldIcon->wmInfoPtr;
+ TkpWmSetState(oldIcon, WithdrawnState);
+ if (wmPtr3) {
+ wmPtr3->iconFor = NULL;
+ }
+ }
[win orderOut:NSApp];
- [win setExcludedFromWindowsMenu:YES];
- wmPtr3->iconFor = NULL;
+ [win setExcludedFromWindowsMenu:YES];
}
Tk_MakeWindowExist(tkwin2);
wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
@@ -3488,6 +3534,7 @@ WmManageCmd(
} else if (Tk_IsTopLevel(frameWin)) {
/* Already managed by wm - ignore it */
}
+ Tk_ManageGeometry((Tk_Window)winPtr, &wmMgrType, NULL);
return TCL_OK;
}
@@ -3626,7 +3673,11 @@ WmOverrideredirectCmd(
{
Bool boolValue;
XSetWindowAttributes atts;
- TKWindow *win = (TKWindow *)TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ NSWindow *win = nil;
+ if (winPtr && winPtr->window) {
+ win = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ }
+
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
@@ -4311,12 +4362,12 @@ WmTransientCmd(
RemoveTransient(winPtr);
containerPtr = (TkWindow*) container;
while (!Tk_TopWinHierarchy(containerPtr)) {
- /*
- * Ensure that the container window is actually a Tk toplevel.
- */
+ /*
+ * Ensure that the container window is actually a Tk toplevel.
+ */
- containerPtr = containerPtr->parentPtr;
- }
+ containerPtr = containerPtr->parentPtr;
+ }
Tk_MakeWindowExist((Tk_Window)containerPtr);
if (wmPtr->iconFor != NULL) {
@@ -5216,7 +5267,7 @@ Tk_GetRootCoords(
*/
winPtr = otherPtr;
- continue;
+ continue;
}
winPtr = winPtr->parentPtr;
}
@@ -5619,6 +5670,15 @@ Tk_MoveToplevelWindow(
*
*----------------------------------------------------------------------
*/
+#define PRINT_STACK \
+ for (NSWindow *w in [NSApp orderedWindows]) { \
+ TkWindow *winPtr2 = TkMacOSXGetTkWindow(w); \
+ if (winPtr2) { \
+ fprintf(stderr, "%s ", Tk_PathName(winPtr2)); \
+ } \
+ } \
+ fprintf(stderr, "\n"); \
+ fflush(stderr)
void
TkWmRestackToplevel(
@@ -5676,8 +5736,14 @@ TkWmRestackToplevel(
* Just let the Mac window manager deal with all the subtleties of keeping
* track of off-screen windows, etc.
*/
-
+#if 0
+ fprintf(stderr, "window order: "); PRINT_STACK;
+#endif
[macWindow orderWindow:macAboveBelow relativeTo:otherNumber];
+#if 0
+ fprintf(stderr, "new window order: "); PRINT_STACK;
+#endif
+#undef PRINT_STACK
}
/*
@@ -6027,7 +6093,7 @@ Tk_Window
TkMacOSXGetContainer(
TkWindow *winPtr)
{
- if (winPtr->wmInfoPtr != NULL) {
+ if (Tk_PathName(winPtr)) {
return (Tk_Window)winPtr->wmInfoPtr->container;
}
return NULL;
@@ -6072,7 +6138,7 @@ TkMacOSXGetXWindow(
* void*.
*
* Results:
- * A Tk_Window, or NULL if the NSWindow is not associated with
+ * A Tk_Window, or None if the NSWindow is not associated with
* any Tk window.
*
* Side effects:
@@ -6088,13 +6154,12 @@ Tk_MacOSXGetTkWindow(
Window window = None;
if ([(NSWindow *)w respondsToSelector: @selector (tkWindow)]) {
window = [(TKWindow *)w tkWindow];
- }
- if (window) {
TkDisplay *dispPtr = TkGetDisplayList();
- return Tk_IdToWindow(dispPtr->display, window);
- } else {
- return NULL;
+ if (window && dispPtr && dispPtr->display) {
+ return Tk_IdToWindow(dispPtr->display, window);
+ }
}
+ return NULL;
}
/*
@@ -6119,7 +6184,10 @@ MODULE_SCOPE int
TkMacOSXIsWindowZoomed(
TkWindow *winPtr)
{
- NSWindow *macWindow = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ NSWindow *macWindow = nil;
+ if (winPtr && winPtr->window) {
+ macWindow = TkMacOSXGetNSWindowForDrawable(winPtr->window);
+ }
return [macWindow isZoomed];
}
@@ -6240,7 +6308,7 @@ TkUnsupported1ObjCmd(
case TKMWS_APPEARANCE:
if ([NSApp macOSVersion] < 100900) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "Window appearances did not exist until OSX 10.9.", TCL_INDEX_NONE));
+ "Window appearances did not exist until OSX 10.9.", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "WINDOWSTYLE", "APPEARANCE", NULL);
return TCL_ERROR;
}
@@ -6794,7 +6862,7 @@ TkMacOSXMakeRealWindowExist(
}
if ((styleMask & (NSTexturedBackgroundWindowMask|NSHUDWindowMask)) &&
!(styleMask & NSDocModalWindowMask)) {
- /*
+ /*
* Workaround for [Bug 2824538]: Textured windows are draggable from
* opaque content.
*/
@@ -6832,9 +6900,11 @@ TkMacOSXMakeRealWindowExist(
*
* TkpRedrawWidget --
*
- * Mark the bounding rectangle of this widget as needing display so the
- * widget will be drawn by [NSView drawRect:]. If this is called within
- * the drawRect method, do nothing.
+ * This is a stub called only from tkTextDisp.c. It was introduced
+ * to deal with an issue in macOS 10.14 and is not needed
+ * even for that OS with updateLayer in use. It would add the widget bounds
+ * to the dirtyRect, which is not currently used, and set the
+ * TkNeedsDisplay flag. Now it is a no-op.
*
* Results:
* None.
@@ -6847,15 +6917,16 @@ TkMacOSXMakeRealWindowExist(
void
TkpRedrawWidget(Tk_Window tkwin) {
+ (void) tkwin;
+#if 0
TkWindow *winPtr = (TkWindow *)tkwin;
- NSWindow *w;
+ NSWindow *w = nil;
Rect tkBounds;
NSRect bounds;
- if ([NSApp isDrawing]) {
- return;
+ if (winPtr && winPtr->window) {
+ w = TkMacOSXGetNSWindowForDrawable(winPtr->window);
}
- w = TkMacOSXGetNSWindowForDrawable(winPtr->window);
if (w) {
TKContentView *view = [w contentView];
TkMacOSXWinBounds(winPtr, &tkBounds);
@@ -6864,7 +6935,9 @@ TkpRedrawWidget(Tk_Window tkwin) {
tkBounds.right - tkBounds.left,
tkBounds.bottom - tkBounds.top);
[view addTkDirtyRect:bounds];
+ [view setNeedsDisplay:YES];
}
+#endif
}
@@ -6980,21 +7053,22 @@ TkpGetWrapperWindow(
*----------------------------------------------------------------------
*/
-void
+int
TkpWmSetState(
TkWindow *winPtr, /* Toplevel window to operate on. */
int state) /* One of IconicState, ZoomState, NormalState,
* or WithdrawnState. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- NSWindow *macWin;
+ NSWindow *macWin = nil;
wmPtr->hints.initial_state = state;
if (wmPtr->flags & WM_NEVER_MAPPED) {
- return;
+ goto setStateEnd;
+ }
+ if (winPtr && winPtr->window) {
+ macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window);
}
-
- macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window);
/*
* Make sure windows are updated before the state change. As an exception,
@@ -7035,6 +7109,8 @@ TkpWmSetState(
*/
while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
+setStateEnd:
+ return 1;
}
/*
@@ -7179,7 +7255,10 @@ TkpChangeFocus(
* didn't originally belong to topLevelPtr's
* application. */
{
- if (winPtr->atts.override_redirect) {
+ if (!winPtr ||
+ (winPtr->flags & TK_ALREADY_DEAD) ||
+ !Tk_IsMapped(winPtr) ||
+ winPtr->atts.override_redirect) {
return 0;
}
@@ -7568,9 +7647,9 @@ ApplyContainerOverrideChanges(
wmPtr->attributes &= ~kWindowNoActivatesAttribute;
if ([NSApp macOSVersion] == 100600) {
styleMask = NSTitledWindowMask |
- NSClosableWindowMask |
- NSMiniaturizableWindowMask |
- NSResizableWindowMask;
+ NSClosableWindowMask |
+ NSMiniaturizableWindowMask |
+ NSResizableWindowMask;
} else {
styleMask |= NSTitledWindowMask;
}
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 5c29253..322b225 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -865,6 +865,14 @@ XSetIconName(
return Success;
}
+Bool
+XFilterEvent(
+ TCL_UNUSED(XEvent *),
+ TCL_UNUSED(Window))
+{
+ return 0;
+}
+
int
XForceScreenSaver(
Display* display,
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index 7a89fa7..2d8d3da 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -214,9 +214,9 @@ static GrayPalette LookupGrayPalette(
{
const PaletteStateTable *entry = design->palettes;
while ((state & entry->onBits) != entry->onBits ||
- (~state & entry->offBits) != entry->offBits)
+ (~state & entry->offBits) != entry->offBits)
{
- ++entry;
+ ++entry;
}
return isDark ? entry->dark : entry->light;
}
@@ -356,12 +356,12 @@ static void GetBackgroundColorRGBA(
rgba[i] -= Ttk_ContrastDelta*contrast / 255.0;
}
}
- if (save && winPtr->privatePtr) {
- winPtr->privatePtr->flags |= TTK_HAS_CONTRASTING_BG;
- for (int i = 0; i < 4; i++) {
- winPtr->privatePtr->fillRGBA[i] = rgba[i];
- }
- }
+ if (save && winPtr->privatePtr) {
+ winPtr->privatePtr->flags |= TTK_HAS_CONTRASTING_BG;
+ for (int i = 0; i < 4; i++) {
+ winPtr->privatePtr->fillRGBA[i] = rgba[i];
+ }
+ }
}
}
@@ -931,8 +931,8 @@ DrawHelpSymbol(
NSColor *foreground = state & TTK_STATE_DISABLED ?
[NSColor disabledControlTextColor] : [NSColor controlTextColor];
NSDictionary *attrs = @{
- NSForegroundColorAttributeName : foreground,
- NSFontAttributeName : font
+ NSForegroundColorAttributeName : foreground,
+ NSFontAttributeName : font
};
NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString:@"?"
@@ -1505,10 +1505,10 @@ DrawTab(
if (!(state & TTK_STATE_SELECTED)) {
DrawGrayButton(context, bounds, &tabDesign, state, tkwin);
- /*
- * Draw a separator line on the left side of the tab if it
- * not first.
- */
+ /*
+ * Draw a separator line on the left side of the tab if it
+ * not first.
+ */
if (!(state & TTK_STATE_FIRST)) {
CGContextSaveGState(context);
@@ -1653,20 +1653,20 @@ static void ButtonElementMinSize(
if (params->heightMetric != NoThemeMetric) {
ChkErr(GetThemeMetric, params->heightMetric, minHeight);
- /*
- * The theme height does not include the 1-pixel border around
- * the button, although it does include the 1-pixel shadow at
- * the bottom.
- */
+ /*
+ * The theme height does not include the 1-pixel border around
+ * the button, although it does include the 1-pixel shadow at
+ * the bottom.
+ */
*minHeight += 2;
- /*
- * For buttons with labels the minwidth must be 0 to force the
- * correct text layout. For example, a non-zero value will cause the
- * text to be left justified, no matter what -anchor setting is used in
- * the style.
- */
+ /*
+ * For buttons with labels the minwidth must be 0 to force the
+ * correct text layout. For example, a non-zero value will cause the
+ * text to be left justified, no matter what -anchor setting is used in
+ * the style.
+ */
if (params->widthMetric != NoThemeMetric) {
ChkErr(GetThemeMetric, params->widthMetric, minWidth);
@@ -1700,10 +1700,10 @@ static void ButtonElementSize(
return;
case TkGradientButton:
*paddingPtr = Ttk_MakePadding(1, 1, 1, 1);
- /* Fall through. */
+ /* Fall through. */
case kThemeArrowButton:
case kThemeRoundButtonHelp:
- return;
+ return;
/* Buttons which are sized like PushButtons but unknown to HITheme. */
case TkRoundedRectButton:
case TkRecessedButton:
@@ -1711,7 +1711,7 @@ static void ButtonElementSize(
info.kind = kThemePushButton;
break;
default:
- break;
+ break;
}
/*
@@ -2152,14 +2152,14 @@ static void EntryElementDraw(
.isFocused = state & TTK_STATE_FOCUS,
};
- /*
- * Earlier versions of the Aqua theme ignored the -fieldbackground
- * option and used the -background as if it were -fieldbackground.
- * Here we are enabling -fieldbackground. For backwards
- * compatibility, if -fieldbackground is set to the default color and
- * -background is set to a different color then we use -background as
- * -fieldbackground.
- */
+ /*
+ * Earlier versions of the Aqua theme ignored the -fieldbackground
+ * option and used the -background as if it were -fieldbackground.
+ * Here we are enabling -fieldbackground. For backwards
+ * compatibility, if -fieldbackground is set to the default color and
+ * -background is set to a different color then we use -background as
+ * -fieldbackground.
+ */
if (0 != strcmp(Tcl_GetString(e->fieldbackgroundObj), defaultBG)) {
backgroundPtr =
@@ -2480,7 +2480,7 @@ static void TrackElementDraw(
double from = 0, to = 100, value = 0, fraction, max;
CGRect bounds = BoxToRect(d, b);
- TtkGetOrientFromObj(NULL, elem->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation);
Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from);
Tcl_GetDoubleFromObj(NULL, elem->toObj, &to);
Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value);
@@ -2622,7 +2622,7 @@ static void PbarElementDraw(
int isIndeterminate = !strcmp("indeterminate",
Tcl_GetString(pbar->modeObj));
- TtkGetOrientFromObj(NULL, pbar->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation);
Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum);
Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
@@ -2697,7 +2697,7 @@ static void TroughElementSize(
Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL;
SInt32 thickness = 15;
- TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &thickness);
if (orientation == TTK_ORIENT_HORIZONTAL) {
*minHeight = thickness;
@@ -2725,7 +2725,7 @@ static void TroughElementDraw(
CGRect bounds = BoxToRect(d, b);
GrayColor bgGray;
- TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
if (orientation == TTK_ORIENT_HORIZONTAL) {
bounds = CGRectInset(bounds, 0, 1);
} else {
@@ -2761,7 +2761,7 @@ static void ThumbElementSize(
ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord;
Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL;
- TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
if (orientation == TTK_ORIENT_VERTICAL) {
*minHeight = 18;
*minWidth = 8;
@@ -2782,7 +2782,7 @@ static void ThumbElementDraw(
ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord;
Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL;
- TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
+ Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation);
/*
* In order to make ttk scrollbars work correctly it is necessary to be
@@ -2828,14 +2828,14 @@ static void ThumbElementDraw(
CGRect troughBounds = {{macWin->xOff, macWin->yOff},
{Tk_Width(tkwin), Tk_Height(tkwin)}};
- /*
- * The info struct has integer fields, which will be converted to
- * floats in the drawing routine. All of values provided in the info
- * struct, namely min, max, value, and viewSize are only defined up to
- * an arbitrary scale factor. To avoid roundoff error we scale so
- * that the viewSize is a large float which is smaller than the
- * largest int.
- */
+ /*
+ * The info struct has integer fields, which will be converted to
+ * floats in the drawing routine. All of values provided in the info
+ * struct, namely min, max, value, and viewSize are only defined up to
+ * an arbitrary scale factor. To avoid roundoff error we scale so
+ * that the viewSize is a large float which is smaller than the
+ * largest int.
+ */
HIThemeTrackDrawInfo info = {
.version = 0,
@@ -2941,7 +2941,7 @@ static void SeparatorElementDraw(
CGRect bounds = BoxToRect(d, b);
const HIThemeSeparatorDrawInfo info = {
.version = 0,
- /* Separator only supports kThemeStateActive, kThemeStateInactive */
+ /* Separator only supports kThemeStateActive, kThemeStateInactive */
.state = Ttk_StateTableLookup(ThemeStateTable,
state & TTK_STATE_BACKGROUND),
};
@@ -3004,7 +3004,7 @@ static void SizegripElementDraw(
CGRect bounds = BoxToRect(d, b);
HIThemeGrowBoxDrawInfo info = {
.version = 0,
- /* Grow box only supports kThemeStateActive, kThemeStateInactive */
+ /* Grow box only supports kThemeStateActive, kThemeStateInactive */
.state = Ttk_StateTableLookup(ThemeStateTable,
state & TTK_STATE_BACKGROUND),
.kind = kHIThemeGrowBoxKindNormal,
@@ -3295,10 +3295,10 @@ static void TreeHeaderElementDraw(
BEGIN_DRAWING(d)
if ([NSApp macOSVersion] > 100800) {
- /*
- * Compensate for the padding added in TreeHeaderElementSize, so
- * the larger heading will be drawn at the top of the widget.
- */
+ /*
+ * Compensate for the padding added in TreeHeaderElementSize, so
+ * the larger heading will be drawn at the top of the widget.
+ */
bounds.origin.y -= 4;
DrawListHeader(bounds, dc.context, tkwin, state);
@@ -3484,13 +3484,13 @@ TTK_LAYOUT("TSpinbox",
TTK_LAYOUT("TEntry",
TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER,
- TTK_GROUP("Entry.padding", TTK_FILL_BOTH,
+ TTK_GROUP("Entry.padding", TTK_FILL_BOTH,
TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))
/* Searchbox */
TTK_LAYOUT("Searchbox",
TTK_GROUP("Searchbox.field", TTK_FILL_BOTH|TTK_BORDER,
- TTK_GROUP("Entry.padding", TTK_FILL_BOTH,
+ TTK_GROUP("Entry.padding", TTK_FILL_BOTH,
TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))
/* Progress bars -- track only */
diff --git a/macosx/ttkMacOSXTheme.h b/macosx/ttkMacOSXTheme.h
index 1e2b7ae..2092b02 100644
--- a/macosx/ttkMacOSXTheme.h
+++ b/macosx/ttkMacOSXTheme.h
@@ -561,7 +561,7 @@ static ThemeFrameParams
#define CHECK_RADIUS(radius, bounds) \
if ((radius) > (bounds).size.width / 2 || (radius) > (bounds).size.height / 2) { \
- return; \
+ return; \
}
/*
diff --git a/tests/bevel.tcl b/tests/bevel.tcl
index 4af60f3..3287ed2 100644
--- a/tests/bevel.tcl
+++ b/tests/bevel.tcl
@@ -128,9 +128,9 @@ foreach i {1 2 3} {
font configure TkFixedFont -size 20
.t.t tag configure sol100 -relief solid -borderwidth 100 \
- -foreground red -font TkFixedFont
+ -foreground red -font TkFixedFont
.t.t tag configure sol12 -relief solid -borderwidth 12 \
- -foreground red -font TkFixedFont
+ -foreground red -font TkFixedFont
.t.t tag configure big -font TkFixedFont
set ind [.t.t index end]
diff --git a/tests/bind.test b/tests/bind.test
index a99876d..5421e62 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -2225,7 +2225,7 @@ test bind-16.46 {ExpandPercents procedure} -setup {
bind all <Key> $savedBind(All)
unset savedBind
} -result {0 1 2}
-test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87} -setup {
+test bind-16.47 {ExpandPercents procedure} -constraints aquaOrWin32 -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
focus -force .t.f
@@ -6038,7 +6038,7 @@ test bind-28.11 {keysym names, gcedilla} -body {
} -cleanup {
destroy .t.f
} -result <Key-gcedilla>
-test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -constraints {deprecated needsTcl87} -body {
+test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -constraints deprecated -body {
frame .t.f -class Test -width 150 -height 100
bind .t.f <Greek_IOTAdiaeresis> foo
bind .t.f
@@ -6059,7 +6059,7 @@ test bind-28.14 {keysym names, Emoji} -body {
} -cleanup {
destroy .t.f
} -result "<Key-\U1F44D>"
-test bind-28.15 {keysym names, Emoji} -constraints needsTcl87 -body {
+test bind-28.15 {keysym names, Emoji} -body {
frame .t.f -class Test -width 150 -height 100
bind .t.f <👍> foo
bind .t.f
diff --git a/tests/butGeom2.tcl b/tests/butGeom2.tcl
index 844f912..f92b23a 100644
--- a/tests/butGeom2.tcl
+++ b/tests/butGeom2.tcl
@@ -35,13 +35,13 @@ pack .t.anchorLabel .t.control.left.f -in .t.control.left -side top -anchor w
foreach opt {activebackground activeforeground background disabledforeground foreground highlightbackground highlightcolor } {
#button .t.color-$opt -text $opt -command "config -$opt \[tk_chooseColor]"
menubutton .t.color-$opt -text $opt -menu .t.color-$opt.m -indicatoron 1 \
- -relief raised -bd 2
+ -relief raised -bd 2
menu .t.color-$opt.m -tearoff 0
.t.color-$opt.m add command -label Red -command "config -$opt red"
.t.color-$opt.m add command -label Green -command "config -$opt green"
.t.color-$opt.m add command -label Blue -command "config -$opt blue"
.t.color-$opt.m add command -label Other... \
- -command "config -$opt \[tk_chooseColor]"
+ -command "config -$opt \[tk_chooseColor]"
pack .t.color-$opt -in .t.control.left.f -fill x
}
diff --git a/tests/button.test b/tests/button.test
index 91fcf49..3479fc0 100644
--- a/tests/button.test
+++ b/tests/button.test
@@ -1744,7 +1744,7 @@ test button-1.177 {configuration option: "overrelief" for button} -setup {
} -cleanup {
destroy .b
} -result {}
-test button-1.178 {configuration option: "overrelief" for button} -constraints needsTcl87 -setup {
+test button-1.178 {configuration option: "overrelief" for button} -setup {
button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
pack .b
update
@@ -1763,7 +1763,7 @@ test button-1.179 {configuration option: "overrelief" for checkbutton} -setup {
} -cleanup {
destroy .c
} -result {}
-test button-1.180 {configuration option: "overrelief" for checkbutton} -constraints needsTcl87 -setup {
+test button-1.180 {configuration option: "overrelief" for checkbutton} -setup {
checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
pack .c
update
@@ -1782,7 +1782,7 @@ test button-1.181 {configuration option: "overrelief" for radiobutton} -setup {
} -cleanup {
destroy .r
} -result {}
-test button-1.182 {configuration option: "overrelief" for radiobutton} -constraints needsTcl87 -setup {
+test button-1.182 {configuration option: "overrelief" for radiobutton} -setup {
radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
pack .r
update
diff --git a/tests/canvImg.test b/tests/canvImg.test
index 0acc735..bf532fe 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -172,7 +172,7 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
update
# On MacOS we need to wait for the test image display procedure to run.
while {"timed out" ni $y && [lindex $y end 1] ne "display"} {
- vwait y
+ vwait y
}
after cancel $timer
list $x $y [.c bbox i1]
diff --git a/tests/canvas.test b/tests/canvas.test
index c06e0d2..e75ab36 100644
--- a/tests/canvas.test
+++ b/tests/canvas.test
@@ -558,6 +558,13 @@ test canvas-11.3 {canvas poly dchars, bug 3291543} {
.c dchars 1 2 end
.c coords 1
} {}
+test canvas-11.4 {canvas line dchars crash with -arrows, bug 51ece3786f} {
+ # This would crash
+ destroy .c
+ canvas .c
+ .c create line 10 10 100 100 -arrow last
+ .c dchars 1 0 1
+} {}
test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup {
destroy .c
diff --git a/tests/clrpick.test b/tests/clrpick.test
index 69470d3..afecb95 100644
--- a/tests/clrpick.test
+++ b/tests/clrpick.test
@@ -149,7 +149,7 @@ test clrpick-2.1 {tk_chooseColor command} -constraints {
} -body {
ToPressButton . ok
tk_chooseColor -title "Press Ok $verylongstring" -initialcolor #404040 \
- -parent .
+ -parent .
} -result {#404040}
test clrpick-2.2 {tk_chooseColor command} -constraints {
nonUnixUserInteraction colorsLeftover
diff --git a/tests/cluster.test b/tests/cluster.test
index be889c3..1ef9424 100644
--- a/tests/cluster.test
+++ b/tests/cluster.test
@@ -122,7 +122,7 @@ test cluster-4.7 {::tk::startOfPreviousWord} -body {
test cluster-4.8 {::tk::startOfPreviousWord} -body {
::tk::startOfPreviousWord "ab cd" {}
} -result {}
-test cluster-4.9 {::tk::startOfPreviousWord} -constraints needsTcl87 -body {
+test cluster-4.9 {::tk::startOfPreviousWord} -body {
::tk::startOfPreviousWord "ab cd" end-1
} -result 0
diff --git a/tests/config.test b/tests/config.test
index 50f95e3..5621e92 100644
--- a/tests/config.test
+++ b/tests/config.test
@@ -458,14 +458,14 @@ test config-4.28 {DoObjConfig - string table} -constraints testobjconfig -body {
killTables
} -returnCodes ok
test config-4.29 {DoObjConfig - invalid string table} -constraints {
- testobjconfig needsTcl87
+ testobjconfig
} -body {
testobjconfig alltypes .foo -stringtable foo
} -cleanup {
killTables
} -returnCodes error -result {bad stringtable "foo": must be one, two, three, four, or ""}
test config-4.29a {DoObjConfig - invalid string table} -constraints {
- testobjconfig needsTcl87
+ testobjconfig
} -body {
testobjconfig alltypes .foo -stringtable2 foo
} -cleanup {
@@ -780,7 +780,7 @@ test config-4.70 {DoObjConfig - relief} -constraints testobjconfig -body {
killTables
} -returnCodes ok -result flat
test config-4.71 {DoObjConfig - invalid relief} -constraints {
- testobjconfig needsTcl87
+ testobjconfig
} -body {
testobjconfig alltypes .foo -relief foo
} -cleanup {
@@ -874,7 +874,7 @@ test config-4.84 {DoObjConfig - justify} -constraints testobjconfig -body {
} -cleanup {
killTables
} -returnCodes ok -result center
-test config-4.85 {DoObjConfig - invalid justify} -constraints {testobjconfig needsTcl87} -body {
+test config-4.85 {DoObjConfig - invalid justify} -constraints testobjconfig -body {
testobjconfig alltypes .foo -justify foo
} -cleanup {
killTables
@@ -916,7 +916,7 @@ test config-4.90 {DoObjConfig - anchor} -constraints testobjconfig -body {
} -returnCodes ok -result center
test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body {
testobjconfig alltypes .foo -anchor foo
-} -constraints needsTcl87 -cleanup {
+} -cleanup {
killTables
} -returnCodes error -result {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, center, or ""}
test config-4.92 {DoObjConfig - new anchor} -constraints testobjconfig -body {
diff --git a/tests/constraints.tcl b/tests/constraints.tcl
index 91256a8..8cc1a18 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -189,13 +189,8 @@ namespace eval tk {
# It takes care of the following timing details of pointer warping:
#
# a. Allow pointer warping to happen if it was scheduled for execution at
- # idle time.
- # - In Tk releases 8.6 and older, pointer warping is scheduled for
- # execution at idle time
- # - In release 8.7 and newer this happens synchronously if $w refers to the
- # whole screen or if the -when option to [event generate] is "now".
- # The namespace variable idle_pointer_warping records which of these is
- # the case.
+ # idle time. This happens synchronously if $w refers to the
+ # whole screen or if the -when option to [event generate] is "now".
#
# b. Work around a race condition associated with OS notification of
# mouse motion on Windows.
@@ -238,12 +233,8 @@ namespace eval tk {
# to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not
# the whole screen.
#
- variable idle_pointer_warping [expr {[package provide tk] != ""}]
proc controlPointerWarpTiming {{duration 50}} {
- variable idle_pointer_warping
- if {$idle_pointer_warping} {
- update idletasks ;# see a. above
- }
+ update idletasks ;# see a. above
if {[tk windowingsystem] eq "win32"} {
after $duration ;# see b. above
}
@@ -273,8 +264,7 @@ testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)]
testConstraint noExceed [expr {
![testConstraint unix] || [catch {font actual "\{xyz"}]
}]
-testConstraint deprecated [expr {![package vsatisfies [package provide Tcl] 8.7-] || ![::tk::build-info no-deprecate]}]
-testConstraint needsTcl87 [package vsatisfies [package provide Tcl] 8.7-]
+testConstraint deprecated [expr {![::tk::build-info no-deprecate]}]
# constraint for running a test on all windowing system except aqua
# where the test fails due to a known bug
diff --git a/tests/event.test b/tests/event.test
index c56d4d8..b43f2d3 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -265,6 +265,7 @@ test event-2.5(keypress) {type into text widget and then delete some text} -setu
test event-2.6(keypress) {type into text widget, triple click,
hit Delete key, and then type some more} -setup {
deleteWindows
+ update idletasks
} -body {
set t [toplevel .t]
set e [text $t.e]
@@ -843,9 +844,9 @@ test event-9.1 {enter . window by destroying a toplevel - bug b1d115fa60} -setup
test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} -setup {
set iconified false
if {[winfo ismapped .]} {
- wm iconify .
- update
- set iconified true
+ wm iconify .
+ update
+ set iconified true
}
} -body {
toplevel .top1
@@ -869,12 +870,318 @@ test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60}
} -cleanup {
deleteWindows ; # destroy all children of ".", this already includes .top1
if {$iconified} {
- wm deiconify .
- update
+ wm deiconify .
+ update
}
} -result {.top1}
+proc waitForWindowEvent {w event {timeout 1000}} {
+# This proc is intended to overcome latency of windowing system
+# notifications when toplevel windows are involved. These latencies vary
+# considerably with the window manager in use, with the system load,
+# with configured scheduling priorities for processes, etc ...
+# Waiting for the corresponding window events evades the trouble that is
+# associated with the alternative: waiting or halting the Tk process for a
+# fixed amount of time (using "after ms"). With the latter strategy it's
+# always a gamble how much waiting time is enough on an end user's system.
+# It also leads to long fixed waiting times in order to be on the safe side.
+
+ variable _windowEvent
+
+ # Use counter as a unique ID to prevent subsequent waits
+ # from interfering with each other.
+ set counter [incr _windowEvent(counter)]
+ set _windowEvent($counter) 1
+ set savedBinding [bind $w $event]
+ bind $w $event [list +waitForWindowEvent.signal $counter]
+ set afterID [after $timeout [list set _windowEvent($counter) -1]]
+ vwait _windowEvent($counter)
+ set late [expr {$_windowEvent($counter) == -1}]
+ bind $w $event $savedBinding
+ unset _windowEvent($counter)
+ if {$late} {
+ puts stderr "wait for $event event on $w timed out (> $timeout ms)"
+ } else {
+ after cancel $afterID
+ }
+}
+proc waitForWindowEvent.signal {counter} {
+# Helper proc that records the triggering of a window event.
+ incr ::_windowEvent($counter)
+}
+
+proc create_and_pack_frames {{w {}}} {
+ frame $w.f1 -bg blue -width 200 -height 200
+ pack propagate $w.f1 0
+ frame $w.f1.f2 -bg yellow -width 100 -height 100
+ pack $w.f1.f2 $w.f1 -side bottom -anchor se
+ update idletasks
+}
+
+proc setup_win_mousepointer {w} {
+# Position the window and the mouse pointer as an initial state for some tests.
+# The so-called "pointer window" is the $w window that will now contain the mouse pointer.
+ wm geometry . +700+400; # root window out of our way - must not cover windows from event-9.1*
+ toplevel $w
+ pack propagate $w 0
+ wm geometry $w 300x300+100+100
+ tkwait visibility $w
+ update; # service remaining screen drawing events (e.g. <Expose>)
+ set pointerWin [winfo containing [winfo pointerx $w] [winfo pointery $w]]
+ event generate $w <Motion> -warp 1 -x 250 -y 250
+ if {($pointerWin ne $w) && ([tk windowingsystem] ne "aqua")} {
+ waitForWindowEvent $w <Enter>
+ } else {
+ controlPointerWarpTiming
+ }
+}
+
+test event-9.11 {pointer window container = parent} -setup {
+ setup_win_mousepointer .one
+ wm withdraw .one
+ create_and_pack_frames .one
+ wm deiconify .one
+ tkwait visibility .one.f1.f2
+ _pause 200; # needed for Windows
+ update idletasks; # finish display of window
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .one.f1.f2
+ update
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyInferior .one.f1|}
+
+test event-9.12 {pointer window container != parent} -setup {
+ setup_win_mousepointer .one
+ wm withdraw .one
+ create_and_pack_frames .one
+ pack propagate .one.f1.f2 0
+ pack [frame .one.g -bg orange -width 80 -height 80] -anchor se -side bottom -in .one.f1.f2
+ wm deiconify .one
+ tkwait visibility .one.g
+ event generate .one <Motion> -warp 1 -x 250 -y 250
+ _pause 200; # needed for Windows
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .one.g
+ update
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyNonlinearVirtual .one.f1|<Enter> NotifyNonlinear .one.f1.f2|}
+
+test event-9.13 {pointer window is a toplevel, toplevel destination} -setup {
+ setup_win_mousepointer .one
+ toplevel .two
+ wm geometry .two 300x300+150+150
+ wm withdraw .two
+ wm deiconify .two
+ waitForWindowEvent .two <Enter>
+ update idletasks; # finish displaying windows
+ set result |
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .two
+ waitForWindowEvent .one <Enter>
+ update
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyNonlinear .one|}
+
+test event-9.14 {pointer window is a toplevel, tk internal destination} -setup {
+ setup_win_mousepointer .one
+ wm withdraw .one
+ create_and_pack_frames .one
+ toplevel .two
+ wm geometry .two 300x300+150+150
+ wm withdraw .two
+ wm deiconify .one
+ wm deiconify .two
+ waitForWindowEvent .two <Enter>
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .two
+ waitForWindowEvent .one.f1.f2 <Enter>
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyNonlinearVirtual .one|<Enter> NotifyNonlinearVirtual .one.f1|<Enter> NotifyNonlinear .one.f1.f2|}
+
+test event-9.15 {pointer window is a toplevel, destination is screen root} -setup {
+ setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test)
+# destroy .one
+ toplevel .two
+ wm geometry .two 300x300+150+150
+ wm deiconify .two
+ waitForWindowEvent .two <Enter>
+ update idletasks; # finish displaying .two
+ event generate .two <Motion> -warp 1 -x 275 -y 275
+ controlPointerWarpTiming
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .two
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|}
+
+test event-9.16 {Successive destructions (pointer window + parent), single generation of crossing events} -setup {
+ # Tests correctness of overwriting the dead window struct in
+ # TkPointerDeadWindow() and subsequent reading in GenerateEnterLeave().
+ setup_win_mousepointer .one
+ wm withdraw .one
+ create_and_pack_frames .one
+ wm deiconify .one
+ tkwait visibility .one.f1.f2
+ update idletasks; # finish displaying window
+ _pause 200; # needed for Windows
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .one.f1
+ update
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyInferior .one|}
+
+test event-9.17 {Successive destructions (pointer window + parent), separate crossing events} -setup {
+ # Tests correctness of overwriting the dead window struct in
+ # TkPointerDeadWindow() and subsequent reading in GenerateEnterLeave().
+ setup_win_mousepointer .one
+ wm withdraw .one
+ create_and_pack_frames .one
+ wm deiconify .one
+ tkwait visibility .one.f1.f2
+ update idletasks; # finish displaying window
+ _pause 200; # needed for Windows
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .one.f1.f2
+ update; # make sure window is gone
+ destroy .one.f1
+ update; # make sure window is gone
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyInferior .one.f1|<Enter> NotifyInferior .one|}
+
+test event-9.18 {Successive destructions (pointer window + ancestors including its toplevel), destination is non-root toplevel} -setup {
+ setup_win_mousepointer .one
+ toplevel .two
+ pack propagate .two 0
+ wm geometry .two 300x300+100+100
+ create_and_pack_frames .two
+ wm deiconify .two
+ waitForWindowEvent .two.f1.f2 <Enter>
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .two
+ waitForWindowEvent .one <Enter>
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ unset result
+} -result {|<Enter> NotifyNonlinear .one|}
+
+test event-9.19 {Successive destructions (pointer window + ancestors including its toplevel), destination is internal window, bypass root win} -setup {
+ setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test)
+# destroy .one
+ toplevel .two
+ pack propagate .two 0
+ wm geometry .two 300x300+100+100
+ create_and_pack_frames .two
+ wm deiconify .two
+ toplevel .three
+ pack propagate .three 0
+ wm geometry .three 300x300+110+110
+ create_and_pack_frames .three
+ wm deiconify .three
+ waitForWindowEvent .three.f1.f2 <Enter>
+ update idletasks; # finish displaying windows
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .three
+ waitForWindowEvent .two.f1.f2 <Enter>
+ update idletasks; #finish destroying .two
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ destroy .one
+ destroy .two
+ unset result
+} -result {|<Enter> NotifyNonlinearVirtual .two|<Enter> NotifyNonlinearVirtual .two.f1|<Enter> NotifyNonlinear .two.f1.f2|}
+
+test event-9.20 {Successive destructions (pointer window + ancestors including its toplevel), destination is screen root} -setup {
+ setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test)
+ destroy .one
+ toplevel .two
+ pack propagate .two 0
+ wm geometry .two 300x300+100+100
+ create_and_pack_frames .two
+ wm deiconify .two
+ waitForWindowEvent .two.f1.f2 <Enter>
+ set result "|"
+} -body {
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
+ destroy .two
+ update idletasks; #finish destroying .two
+ set result
+} -cleanup {
+ bind all <Leave> {}
+ bind all <Enter> {}
+ unset result
+} -result {|}
+
# cleanup
+# macOS sometimes has trouble deleting the test window,
+# causing a failure in focus.test.
+_pause 200;
+deleteWindows
update
unset -nocomplain keypress_lookup
rename _init_keypress_lookup {}
@@ -883,6 +1190,8 @@ rename _keypress {}
rename _pause {}
rename _text_ind_to_x_y {}
rename _get_selection {}
+rename create_and_pack_frames {}
+rename setup_win_mousepointer {}
cleanupTests
return
diff --git a/tests/focus.test b/tests/focus.test
index 03563bc..17cdd58 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -43,10 +43,8 @@ proc focusSetupAlt {} {
# the X server and possibly also the window manager.
proc focusClear {} {
- global x;
- after 200 {set x 1}
- tkwait variable x
- dobg {focus -force .; update}
+ dobg {after 200; focus -force .; update}
+ after 400
update
}
diff --git a/tests/font.test b/tests/font.test
index ca38269..4c1f0de 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -2434,15 +2434,15 @@ test font-47.2 {Bug 3049518 - Canvas} -body {
set twidth [font measure MyFont $text]
set theight [font metrics MyFont -linespace]
set circid [$c create polygon \
- 15 15 \
- [expr {15 + $twidth}] 15 \
- [expr {15 + $twidth}] [expr {15 + $theight}] \
- 15 [expr {15 + $theight}] \
- -width 1 -joinstyle round -smooth true -fill {} -outline blue]
+ 15 15 \
+ [expr {15 + $twidth}] 15 \
+ [expr {15 + $twidth}] [expr {15 + $theight}] \
+ 15 [expr {15 + $theight}] \
+ -width 1 -joinstyle round -smooth true -fill {} -outline blue]
pack $c -fill both -expand 1 -side top
update
- # Lamda test functions
+ # Lambda test functions
set circle_text {{w user_data text circ} {
if {[winfo class $w] ne "Canvas"} {
puts "Wrong widget type: $w"
@@ -2468,6 +2468,7 @@ test font-47.2 {Bug 3049518 - Canvas} -body {
apply $circle_text $c FontChanged $textid $circid
update
bind $c <<TkWorldChanged>> [list apply $circle_text %W %d $textid $circid]
+ update idletasks
# Begin test:
set results {}
diff --git a/tests/image.test b/tests/image.test
index c7b6511..cdac20d 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -370,10 +370,6 @@ test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
foo changed 5 6 7 8 30 15
update idletasks
update
- # On MacOS we need to wait for the test image display procedure to run.
- while {"timed out" ni $x && [lindex $x end 1] ne "display"} {
- vwait x
- }
after cancel $timer
return $x
} -cleanup {
diff --git a/tests/imgPPM.test b/tests/imgPPM.test
index dfabd62..2458107 100644
--- a/tests/imgPPM.test
+++ b/tests/imgPPM.test
@@ -56,8 +56,7 @@ test imgPPM-1.8 {FileReadPPM procedure} -body {
} -returnCodes error -result {error reading PPM image file "test.ppm": not enough data}
test imgPPM-1.9 {FileReadPPM procedure} -body {
put test.ppm "P6\n5 4\n150\n012345678901234567890123456789012345678901234567890123456789"
- list [image create photo p1 -file test.ppm] \
- [image width p1] [image height p1]
+ list [image create photo p1 -file test.ppm] [image width p1] [image height p1]
} -returnCodes ok -result {p1 5 4}
@@ -67,7 +66,7 @@ test imgPPM-2.1 {FileWritePPM procedure} -setup {
put test.ppm "P6\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
image create photo p1 -file test.ppm
list [catch {p1 write not_a_dir/bar/baz/gorp} msg] [string tolower $msg] \
- [string tolower $errorCode]
+ [string tolower $errorCode]
} -cleanup {
image delete p1
} -result {1 {couldn't open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}}
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index cfc8c61..0a2cf7f 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -51,12 +51,6 @@
# ImgGetPhoto: no tests
# Tk_PhotoGetImage no tests
# ImgPostscriptPhoto no tests
-# Tk_PhotoPutBlock_NoComposite no tests, probably none needed
-# Tk_PhotoPutZoomedBlock_NoComposite no tests, probably none needed
-# Tk_PhotoExpand_Panic no tests, probably none needed
-# Tk_PhotoPutBlock_Panic no tests, probably none needed
-# Tk_PhotoPutZoomedBlock_Panic no tests, probably none needed
-# Tk_PhotoSetSize_Panic no tests, probably none needed
# Tk_PhotoGetMetadata: imgPhoto-21.*
# Tk_PhotoSetMetadata: imgPhoto-22.*
#--------------------------------------------------------------------------
diff --git a/tests/menu.test b/tests/menu.test
index 31d8c80..72369b5 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -1833,10 +1833,10 @@ test menu-3.71 {MenuWidgetCmd procedure, "index end" option, bug [f3cd942e9e]} -
destroy .m1
} -body {
menu .m1
- expr {[.m1 index "end"] in [list {} none]}
+ .m1 index "end"
} -cleanup {
destroy .m1
-} -result 1
+} -result {}
test menu-4.1 {TkInvokeMenu: disabled} -setup {
@@ -4099,7 +4099,40 @@ test menu-39.2 {use-after-free fix - bug 1797555fff} -setup {
destroy .t
} -result {}
-test menu-40.1 {identifiers - auto generated} -setup {
+test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup {
+} -constraints {pressbutton} -body {
+ set done false
+ event generate {} <Motion> -x 100 -y 100
+ toplevel .t
+ menu .t.m
+ .t.m add command -command {puts Marco} -label Marco
+ .t.m add command -command {puts Polo} -label Polo
+ after 1000 {.t.m post 500 500}
+ after 2000 {destroy .t}
+ after 2500 {pressbutton 530 510}
+ after 3000 {set done true}
+ tkwait variable done
+}
+
+test menu-40.2 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup {
+} -constraints {movemouse} -body {
+ set done false
+ event generate {} <Motion> -x 100 -y 100
+ toplevel .t
+ menu .t.m
+ .t.m add command -command {puts Marco} -label Marco
+ .t.m add command -command {puts Polo} -label Polo
+ after 1000 {.t.m post 500 500}
+ after 2000 {movemouse 530 510}
+ after 3000 {destroy .t}
+ after 3500 {movemouse 530 530}
+ after 4000 pressbutton 530 530
+ after 4500 {set done true}
+ tkwait variable done
+ pressbutton 530 510
+}
+
+test menu-41.1 {identifiers - auto generated} -setup {
destroy .m
} -body {
menu .m
@@ -4107,7 +4140,7 @@ test menu-40.1 {identifiers - auto generated} -setup {
} -cleanup {
destroy .m
} -result {e001 e002 e003}
-test menu-40.2 {identifiers - out of sequence} -setup {
+test menu-41.2 {identifiers - out of sequence} -setup {
destroy .m
} -body {
menu .m -tearoff 0
@@ -4118,7 +4151,7 @@ test menu-40.2 {identifiers - out of sequence} -setup {
} -cleanup {
destroy .m
} -result {1 0 2}
-test menu-40.3 {identifiers - out of sequence with tearoff} -setup {
+test menu-41.3 {identifiers - out of sequence with tearoff} -setup {
destroy .m
} -body {
menu .m -tearoff 1
@@ -4129,7 +4162,7 @@ test menu-40.3 {identifiers - out of sequence with tearoff} -setup {
} -cleanup {
destroy .m
} -result {2 1 3}
-test menu-40.4 {identifiers - entry id} -setup {
+test menu-41.4 {identifiers - entry id} -setup {
destroy .m
} -body {
menu .m -tearoff 1
@@ -4140,7 +4173,7 @@ test menu-40.4 {identifiers - entry id} -setup {
} -cleanup {
destroy .m
} -result {{} e002 e001 e003}
-test menu-40.5 {identifiers - assigned} -setup {
+test menu-41.5 {identifiers - assigned} -setup {
destroy .m
} -body {
menu .m
@@ -4148,7 +4181,7 @@ test menu-40.5 {identifiers - assigned} -setup {
} -cleanup {
destroy .m
} -result {cmd1 cmd2 cmd3}
-test menu-40.6 {identifiers - mixed} -setup {
+test menu-41.6 {identifiers - mixed} -setup {
destroy .m
} -body {
menu .m
@@ -4156,7 +4189,7 @@ test menu-40.6 {identifiers - mixed} -setup {
} -cleanup {
destroy .m
} -result {e001 cmd2 e002}
-test menu-40.7 {identifiers - conflict} -setup {
+test menu-41.7 {identifiers - conflict} -setup {
destroy .m
} -body {
menu .m
@@ -4164,7 +4197,7 @@ test menu-40.7 {identifiers - conflict} -setup {
} -cleanup {
destroy .m
} -result {e002 e001 e003}
-test menu-40.8 {identifiers - clone of complete menu} -setup {
+test menu-41.8 {identifiers - clone of complete menu} -setup {
destroy .m1 .m2
} -body {
menu .m1 -tearoff 0
@@ -4176,7 +4209,7 @@ test menu-40.8 {identifiers - clone of complete menu} -setup {
} -cleanup {
destroy .m1 .m2
} -result {1 0 2}
-test menu-40.9 {identifiers - modify after cloning} -setup {
+test menu-41.9 {identifiers - modify after cloning} -setup {
destroy .m1 .m2
} -body {
menu .m1 -tearoff 0
@@ -4188,7 +4221,7 @@ test menu-40.9 {identifiers - modify after cloning} -setup {
} -cleanup {
destroy .m1 .m2
} -result {1 0 2}
-test menu-40.10 {identifiers - modify clone} -setup {
+test menu-41.10 {identifiers - modify clone} -setup {
destroy .m1 .m2
} -body {
menu .m1 -tearoff 0
@@ -4200,7 +4233,7 @@ test menu-40.10 {identifiers - modify clone} -setup {
} -cleanup {
destroy .m1 .m2
} -result {1 0 2}
-test menu-40.11 {identifiers - entrycget by id} -setup {
+test menu-41.11 {identifiers - entrycget by id} -setup {
destroy .m
} -body {
menu .m
@@ -4211,7 +4244,7 @@ test menu-40.11 {identifiers - entrycget by id} -setup {
} -cleanup {
destroy .m
} -result {1 2 3}
-test menu-40.12 {identifiers - delete by id} -setup {
+test menu-41.12 {identifiers - delete by id} -setup {
destroy .m
} -body {
menu .m
@@ -4229,7 +4262,7 @@ test menu-40.12 {identifiers - delete by id} -setup {
} -cleanup {
destroy .m
} -result {e001 e002 cmd9}
-test menu-40.13 {identifiers - duplicate} -setup {
+test menu-41.13 {identifiers - duplicate} -setup {
destroy .m
} -body {
menu .m
@@ -4239,7 +4272,7 @@ test menu-40.13 {identifiers - duplicate} -setup {
} -cleanup {
destroy .m
} -returnCodes error -result {entry "foo" already exists}
-test menu-40.14 {identifiers - reserved word} -setup {
+test menu-41.14 {identifiers - reserved word} -setup {
destroy .m
} -body {
menu .m -tearoff 0
@@ -4251,39 +4284,6 @@ test menu-40.14 {identifiers - reserved word} -setup {
destroy .m
} -result {2}
-test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup {
-} -constraints {pressbutton} -body {
- set done false
- event generate {} <Motion> -x 100 -y 100
- toplevel .t
- menu .t.m
- .t.m add command -command {puts Marco} -label Marco
- .t.m add command -command {puts Polo} -label Polo
- after 1000 {.t.m post 500 500}
- after 2000 {destroy .t}
- after 2500 {pressbutton 530 510}
- after 3000 {set done true}
- tkwait variable done
-}
-
-test menu-40.2 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup {
-} -constraints {movemouse} -body {
- set done false
- event generate {} <Motion> -x 100 -y 100
- toplevel .t
- menu .t.m
- .t.m add command -command {puts Marco} -label Marco
- .t.m add command -command {puts Polo} -label Polo
- after 1000 {.t.m post 500 500}
- after 2000 {movemouse 530 510}
- after 3000 {destroy .t}
- after 3500 {movemouse 530 530}
- after 4000 pressbutton 530 530
- after 4500 {set done true}
- tkwait variable done
- pressbutton 530 510
-}
-
# cleanup
imageFinish
deleteWindows
diff --git a/tests/menuDraw.test b/tests/menuDraw.test
index 02111ab..2cafc31 100644
--- a/tests/menuDraw.test
+++ b/tests/menuDraw.test
@@ -558,7 +558,7 @@ test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup {
menu .m1
.m1 add command -label "foo" -state active
set tearoff [tk::TearOffMenu .m1 40 40]
- expr {[$tearoff index active] in [list {} none]}
+ expr {[$tearoff index active]<0}
} -cleanup {
deleteWindows
} -result 1
diff --git a/tests/message.test b/tests/message.test
index f5c0d82..4abe2db 100644
--- a/tests/message.test
+++ b/tests/message.test
@@ -402,7 +402,7 @@ test message-1.39 {configuration options, fallback to default} -setup {
list [.m cget -padx] [.m cget -pady] [.m cget -borderwidth] [.m cget -highlightthickness] [.m cget -width]
} -cleanup {
destroy .m
-} -result {-1 -1 0 0 0}
+} -result {{} {} 0 0 0}
test message-2.1 {Tk_MessageObjCmd procedure} -body {
diff --git a/tests/pack.test b/tests/pack.test
index 0731125..201bf9f 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1553,6 +1553,11 @@ test pack-17.2 {PackLostContentProc procedure} -setup {
# into account while the window is unmapped.
# pack-18.1.2 checks that, on Windows, width/height changes are taken into
# account on window remapping.
+#
+# While these tests pass on macOS, one can see by watching the tests
+# that the window .pack is sometimes black, even though the frame is
+# colored. So, evidently, even though the size changes are honored,
+# the window is sometimes not completely configured.
test pack-18.1.1 {unmap content when container unmapped} -constraints {
macOrUnix failsOnUbuntu failsOnXQuarz
} -setup {
@@ -1562,7 +1567,8 @@ test pack-18.1.1 {unmap content when container unmapped} -constraints {
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
} -body {
- frame .pack.a -width 100 -height 50 -relief raised -bd 2
+ frame .pack.a -width 100 -height 50 -relief raised -bd 2 -bg green
+ after 100
pack .pack.a
update
set result [winfo ismapped .pack.a]
@@ -1585,7 +1591,7 @@ test pack-18.1.2 {unmap content when container unmapped} -constraints {
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
} -body {
- frame .pack.a -width 100 -height 50 -relief raised -bd 2
+ frame .pack.a -width 100 -height 50 -relief raised -bd 2 -bg green
pack .pack.a
update
set result [winfo ismapped .pack.a]
@@ -1606,8 +1612,8 @@ test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbun
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
} -body {
- frame .pack.a -relief raised -bd 2
- frame .pack.b -width 70 -height 30 -relief sunken -bd 2
+ frame .pack.a -relief raised -bd 2 -bg green
+ frame .pack.b -width 70 -height 30 -relief sunken -bd 2 -bg red
pack .pack.a
pack .pack.b -in .pack.a
update
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index 96ddce3..45c6deb 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -122,7 +122,7 @@ test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body {
} -cleanup {
.p configure -proxyrelief [lindex [.p configure -proxyrelief] 3]
} -result {groove groove}
-test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -constraints needsTcl87 -body {
+test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -body {
.p configure -proxyrelief 1.5
} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""}
test panedwindow-1.25 {configuration options: -relief (good)} -body {
diff --git a/tests/raise.test b/tests/raise.test
index 2e9e2c6..7e6b0bd 100644
--- a/tests/raise.test
+++ b/tests/raise.test
@@ -16,6 +16,7 @@ namespace import -force tcltest::test
# Procedure to create a bunch of overlapping windows, which should
# make it easy to detect differences in order.
+wm geometry . +400+400
proc raise_setup {} {
destroy {*}[winfo children .raise]
update idletasks
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 061eacc..ef24860 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -316,10 +316,6 @@ destroy .t
test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} {
list [catch {.s get a} msg] $msg
} {1 {wrong # args: should be ".s get"}}
-test scrollbar-3.44 {ScrollbarWidgetCmd procedure, "get" option} {deprecated needsTcl87} {
- .s set 100 10 13 14
- .s get
-} {100 10 13 14}
test scrollbar-3.45 {ScrollbarWidgetCmd procedure, "get" option} {
.s set 0.6 0.8
set result {}
@@ -401,30 +397,6 @@ test scrollbar-3.63 {ScrollbarWidgetCmd procedure, "set" option} {
}
set result
} {0.4 0.4}
-test scrollbar-3.64 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- list [catch {.s set abc def ghi jkl} msg] $msg
-} {1 {expected integer but got "abc"}}
-test scrollbar-3.65 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- list [catch {.s set 1 def ghi jkl} msg] $msg
-} {1 {expected integer but got "def"}}
-test scrollbar-3.66 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- list [catch {.s set 1 2 ghi jkl} msg] $msg
-} {1 {expected integer but got "ghi"}}
-test scrollbar-3.67 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- list [catch {.s set 1 2 3 jkl} msg] $msg
-} {1 {expected integer but got "jkl"}}
-test scrollbar-3.68 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- .s set -10 50 20 30
- .s get
-} {0 50 0 0}
-test scrollbar-3.69 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- .s set 100 -10 20 30
- .s get
-} {100 0 20 30}
-test scrollbar-3.70 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} {
- .s set 100 50 30 20
- .s get
-} {100 50 30 30}
test scrollbar-3.71 {ScrollbarWidgetCmd procedure, "set" option} {
list [catch {.s set 1 2 3} msg] $msg
} {1 {wrong # args: should be ".s set firstFraction lastFraction"}}
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 7583bc4..67df965 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -1107,22 +1107,28 @@ test textDisp-6.9 {DisplayText, horizontal scrollbar updates} {
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} {
+ # For this test to pass line 8 must be out of the text widget.
+ # With macOS 14 this requires making the buttons a little larger.
+ # So we set the pady option. This may depend on the OS version.
.t configure -wrap char
+ update
.t delete 1.0 end
+ update
.t insert 1.0 "Line 1"
foreach i {2 3 4} {
.t insert end "\nLine $i"
}
.t insert end "\n"
.t window create end -create {
- button %W.button_one -text "Button 1"}
+ button %W.button_one -text "Button 1" -pady 5}
.t insert end "\nLine 6\n"
.t window create end -create {
- button %W.button_two -text "Button 2"}
+ button %W.button_two -text "Button 2" -pady 5}
.t insert end "\nLine 8\n"
.t window create end -create {
- button %W.button_three -text "Button 3"}
+ button %W.button_three -text "Button 3" -pady 5}
update
+ set tk_textEmbWinDisplay {}
.t delete 2.0 3.0
update
list $tk_textEmbWinDisplay
diff --git a/tests/textTag.test b/tests/textTag.test
index 5d58cb0..7818aee 100644
--- a/tests/textTag.test
+++ b/tests/textTag.test
@@ -113,7 +113,7 @@ test textTag-1.12 {tag configuration options} -body {
} -cleanup {
.t tag configure x -justify [lindex [.t tag configure x -justify] 3]
} -result {left}
-test textTag-1.13 {configuration options, bug [026e2bb685]} -constraints needsTcl87 -body {
+test textTag-1.13 {configuration options, bug [026e2bb685]} -body {
.t tag configure x -justify right
catch {.t tag configure x -justify middle} msg
list $msg [.t tag configure x -justify]
@@ -169,7 +169,7 @@ test textTag-1.20 {tag configuration options} -body {
.t tag cget x -overstrike
} -cleanup {
.t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3]
-} -result {on}
+} -result 1
test textTag-1.21 {configuration options} -body {
.t tag configure x -overstrike stupid
} -cleanup {
@@ -192,7 +192,7 @@ test textTag-1.22 {tag configuration options} -body {
} -cleanup {
.t tag configure x -relief [lindex [.t tag configure x -relief] 3]
} -result {raised}
-test textTag-1.23 {configuration options} -constraints needsTcl87 -body {
+test textTag-1.23 {configuration options} -body {
.t tag configure x -relief stupid
} -cleanup {
.t tag configure x -relief [lindex [.t tag configure x -relief] 3]
@@ -291,7 +291,7 @@ test textTag-1.34 {tag configuration options} -body {
.t tag cget x -underline
} -cleanup {
.t tag configure x -underline [lindex [.t tag configure x -underline] 3]
-} -result {no}
+} -result 0
test textTag-1.35 {configuration options} -body {
.t tag configure x -underline stupid
} -cleanup {
@@ -501,7 +501,7 @@ test textTag-5.4 {TkTextTagCmd - "configure" option} -body {
.t tag configure x -underline
} -cleanup {
.t tag delete x
-} -result {-underline {} {} {} yes}
+} -result {-underline {} {} {} 1}
test textTag-5.4a {TkTextTagCmd - "configure" option} -body {
.t tag delete x
.t tag configure x -underlinefg lightgreen
@@ -515,7 +515,7 @@ test textTag-5.5 {TkTextTagCmd - "configure" option} -body {
.t tag cget x -overstrike
} -cleanup {
.t tag delete x
-} -result {on}
+} -result 1
test textTag-5.5a {TkTextTagCmd - "configure" option} -body {
.t tag delete x
.t tag configure x -overstrikefg lightgreen
@@ -541,14 +541,14 @@ test textTag-5.8 {TkTextTagCmd - "configure" option} -body {
} -cleanup {
.t tag delete x
} -result {-justify {} {} {} left}
-test textTag-5.9 {TkTextTagCmd - "configure" option, bug [026e2bb685]} -constraints needsTcl87 -body {
- .t tag delete x
+test textTag-5.9 {TkTextTagCmd - "configure" option, bug [026e2bb685]} -body {
+ .t tag delete x
catch {.t tag configure x -justify bogus} msg
list $msg [.t tag configure x -justify]
} -cleanup {
.t tag delete x
} -result {{bad justification "bogus": must be left, right, center, or ""} {-justify {} {} {} {}}}
-test textTag-5.10 {TkTextTagCmd - "configure" option} -constraints needsTcl87 -body {
+test textTag-5.10 {TkTextTagCmd - "configure" option} -body {
.t tag delete x
.t tag configure x -justify fill
} -cleanup {
diff --git a/tests/ttk/checkbutton.test b/tests/ttk/checkbutton.test
index 248db96..d79b612 100644
--- a/tests/ttk/checkbutton.test
+++ b/tests/ttk/checkbutton.test
@@ -49,7 +49,7 @@ test checkbutton-1.6 "Checkbutton default variable" -body {
# Bug [109865fa01]
test checkbutton-1.7 "Button destroyed by click" -body {
proc destroy_button {} {
- destroy .top
+ destroy .top
}
toplevel .top
ttk::menubutton .top.mb -text Button -style TLabel
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index d65907f..0187720 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -64,7 +64,7 @@ test entry-1.7 "Deletion - insert cursor in the middle " -body {
.e index insert
} -result 0
-test entry-1.8 "Index is between 0 and end" -constraints deprecated -body {
+test entry-1.8 "Index is between 0 and end" -body {
.e delete 0 end
.e insert end abcde
set res [list [.e index -1] [.e index -4] [.e index 999]]
@@ -86,7 +86,7 @@ test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body {
-expand true -fill both
.te insert end [string repeat "abc" 50]
catch {update} ; # error triggers because the -xscrollcommand callback
- # errors out: invalid command name ".tsb"
+ # errors out: invalid command name ".tsb"
focus -force .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f])
pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \
-expand false -fill x
diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test
index b11244b..d115a9e 100644
--- a/tests/ttk/panedwindow.test
+++ b/tests/ttk/panedwindow.test
@@ -311,7 +311,7 @@ test panedwindow-6.1 "style command" -body {
ttk::panedwindow .wv ; # default is -orient vertical
ttk::panedwindow .wh -orient horizontal
list [.wv cget -style] [.wv style] [winfo class .wv]\
- [.wh cget -style] [.wh style] [winfo class .wh]
+ [.wh cget -style] [.wh style] [winfo class .wh]
} -cleanup {
destroy .wv .wh
} -result {{} TPanedwindow TPanedwindow {} TPanedwindow TPanedwindow}
diff --git a/tests/ttk/scale.test b/tests/ttk/scale.test
index 08143e2..ecda7d5 100644
--- a/tests/ttk/scale.test
+++ b/tests/ttk/scale.test
@@ -37,7 +37,7 @@ test scale-3.1 "style command" -body {
ttk::scale .wh ; # default is -orient horizontal
ttk::scale .wv -orient vertical
list [.wh cget -style] [.wh style] [winfo class .wh] \
- [.wv cget -style] [.wv style] [winfo class .wv]
+ [.wv cget -style] [.wv style] [winfo class .wv]
} -cleanup {
destroy .wh .wv
} -result {{} Horizontal.TScale TScale {} Vertical.TScale TScale}
diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test
index 9b6abee..ac10f56 100644
--- a/tests/ttk/scrollbar.test
+++ b/tests/ttk/scrollbar.test
@@ -122,7 +122,7 @@ test scrollbar-11.1 "style command" -body {
ttk::scrollbar .wv ; # default is -orient vertical
ttk::scrollbar .wh -orient horizontal
list [.wv cget -style] [.wv style] [winfo class .wv] \
- [.wh cget -style] [.wh style] [winfo class .wh]
+ [.wh cget -style] [.wh style] [winfo class .wh]
} -cleanup {
destroy .wv .wh
} -result {{} Vertical.TScrollbar TScrollbar {} Horizontal.TScrollbar TScrollbar}
diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test
index c77c8e1..9e8ef61 100644
--- a/tests/ttk/treetags.test
+++ b/tests/ttk/treetags.test
@@ -9,7 +9,7 @@ loadTestedCommands
proc assert {expr {message ""}} {
if {![uplevel 1 [list expr $expr]]} {
- error "PANIC: $message ($expr failed)"
+ error "PANIC: $message ($expr failed)"
}
}
@@ -191,8 +191,8 @@ test treetags-3.2 "tag configure - enumerate" -body {
} -cleanup {
treeConstraints $tv
} -result [list \
- -image {} -imageanchor {} -background red -stripedbackground {} -foreground blue -font {} -padding {} \
- ]
+ -image {} -imageanchor {} -background red -stripedbackground {} -foreground blue \
+ -font {} -padding {} ]
test treetags-4.1 "tag cell add" -body {
$tv tag cell add _thetag
} -returnCodes 1 -result {wrong # args: should be ".tv tag cell add tagName cells"}
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index 13eec44..d92a979 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -191,10 +191,11 @@ test treeview-3.5 "index - exhaustive test" -body {
} -result [list 0 1 2 3 4 5 6]
test treeview-3.6 "detach" -body {
+ set before [.tv detached newnode]
.tv detach newnode
consistencyCheck .tv
- .tv children {}
-} -result [list newfirstone firstnode anotherone onemore lastnode newlastone]
+ list [.tv children {}] [.tv detached] $before [.tv detached newnode]
+} -result {{newfirstone firstnode anotherone onemore lastnode newlastone} newnode 0 1}
# XREF: treeview-2.13
test treeview-3.7 "detach didn't screw up internal links" -body {
@@ -229,17 +230,19 @@ test treeview-3.11 "Can't detach root item" -body {
} -returnCodes error -result "Cannot detach root item"
test treeview-3.12 "Reattach" -body {
+ set before [.tv detached newnode]
.tv move newnode {} end
consistencyCheck .tv
- .tv children {}
-} -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode]
+ list [.tv children {}] $before [.tv detached newnode] [.tv detached]
+} -result {{newfirstone firstnode anotherone onemore lastnode newlastone newnode} 1 0 {}}
# Bug # ?????
test treeview-3.13 "Re-reattach" -body {
+ set before [.tv detached newnode]
.tv move newnode {} end
consistencyCheck .tv
- .tv children {}
-} -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode]
+ list [.tv children {}] $before [.tv detached newnode]
+} -result {{newfirstone firstnode anotherone onemore lastnode newlastone newnode} 0 0}
catch {
.tv insert newfirstone end -id x1
@@ -926,7 +929,8 @@ proc columnids {tv dcols} {
test treeview-identify-setup "identify series - setup" -body {
destroy .tv
ttk::setTheme default
- ttk::style configure Treeview -rowheight 20
+ ttk::style configure Treeview -rowheight 10m
+ ttk::style configure Treeview.Heading -font {Arial 10}
ttk::treeview .tv -columns [list A B C]
.tv insert {} end -id branch -text branch -open true
.tv insert branch end -id item1 -text item1 -height 2
@@ -934,58 +938,62 @@ test treeview-identify-setup "identify series - setup" -body {
.tv insert branch end -id item3 -text item3
.tv insert {} end -id item4 -text item4
- .tv column #0 -width 50 ;# 0-50
- .tv column A -width 50 ;# 50-100
- .tv column B -width 50 ;# 100-150
- .tv column C -width 50 ;# 150-200 (plus slop for margins)
+ .tv column #0 -width 200 ;# 0-200
+ .tv column A -width 200 ;# 200-400
+ .tv column B -width 200 ;# 400-600
+ .tv column C -width 200 ;# 600-800 (plus slop for margins)
wm geometry . {} ; pack .tv ; update
}
+# treeview-identify-setup sets heading row font to Arial with size 10 points,
+# so the heading line center y-coordinate is (in pixels):
+set yHLC [expr {([font metrics {Arial 10} -linespace] + 2) / 2.0}]
+# which makes the following in millimeters:
+set yHLC [expr {$yHLC / [winfo screenwidth .] * [winfo screenmmwidth .]}]
test treeview-identify-1 "identify heading" -body {
.tv configure -show {headings tree}
update idletasks
- identify* .tv {region column} 10 10
+ identify* .tv {region column} 10 ${yHLC}m
} -result [list heading #0]
test treeview-identify-2 "identify columns" -body {
.tv configure -displaycolumns #all
update idletasks
- columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10]
+ columnids .tv [identify* .tv column 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m]
} -result [list \#0 A B C]
test treeview-identify-3 "reordered columns" -body {
.tv configure -displaycolumns {B A C}
update idletasks
- columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10]
+ columnids .tv [identify* .tv column 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m]
} -result [list \#0 B A C]
test treeview-identify-4 "no tree column" -body {
.tv configure -displaycolumns #all -show {headings}
update idletasks
- identify* .tv {region column} 25 10 75 10 125 10 175 10
+ identify* .tv {region column} 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m
} -result [list heading #1 heading #2 heading #3 nothing {}]
-# Item height in default theme is 20px
+# Item height (-rowheight) is 10 millimeters (set in treeview-identify-setup)
test treeview-identify-5 "vertical scan - no headings" -body {
.tv configure -displaycolumns #all -show {tree}
update idletasks
- identify* .tv {region item} 25 10 25 30 25 70 25 90 25 110 25 130
+ identify* .tv {region item} 100 5m 100 15m 100 35m 100 45m 100 55m 100 65m
} -result [list tree branch tree item1 tree item2 tree item3 tree item4 nothing {}]
test treeview-identify-6 "vertical scan - with headings" -body {
.tv configure -displaycolumns #all -show {tree headings}
update idletasks
- identify* .tv {region item} 25 10 25 30 25 50 25 90 25 110
+ identify* .tv {region item} 100 ${yHLC}m 100 [expr {$yHLC+5}]m 100 [expr {$yHLC+15}]m 100 [expr {$yHLC+35}]m 100 [expr {$yHLC+45}]m
} -result [list heading {} tree branch tree item1 tree item2 tree item3]
test treeview-identify-7 "vertical scan - headings, no tree" -body {
.tv configure -displaycolumns #all -show {headings}
update idletasks
- identify* .tv {region item cell} 25 10 25 30 25 50 75 90 25 110
+ identify* .tv {region item cell} 100 ${yHLC}m 100 [expr {$yHLC+5}]m 100 [expr {$yHLC+15}]m 300 [expr {$yHLC+35}]m 100 [expr {$yHLC+45}]m
} -result [list heading {} {} cell branch {branch #1} cell item1 {item1 #1} cell item2 {item2 #2} cell item3 {item3 #1}]
-# In default theme, -indent and -itemheight both 20px
# Disclosure element name is "Treeitem.indicator"
set disclosure "*.indicator"
test treeview-identify-8 "identify element" -body {
@@ -993,18 +1001,21 @@ test treeview-identify-8 "identify element" -body {
.tv insert branch 0 -id branch2 -open true
.tv insert branch2 0 -id branch3 -open true
.tv insert branch3 0 -id leaf3
- update idletasks;
- identify* .tv {item element} 10 10 30 30 50 50
+ ttk::style configure Treeview -indent 8m
+ update idletasks
+ identify* .tv {item element} 4m 5m 12m 15m 20m 25m
} -match glob -result [list \
branch $disclosure branch2 $disclosure branch3 $disclosure]
test treeview-identify-8.1 "identify element" -body {
.tv configure -show {tree headings}
update
- identify* .tv element 1 1 10 10 25 25
+ identify* .tv element 1 1 40 ${yHLC}m 10m [expr {$yHLC+6}]m
# Heading elements are currently not reported
} -result [list {} {} text]
+ttk::style configure Treeview -rowheight 20
+
# See #2381555
test treeview-identify-9 "identify works when horizontally scrolled" -setup {
.tv configure -show {tree headings}
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index 74cd80a..d099c40 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -136,6 +136,8 @@ test ttk-selfdestruct-ok-1 "Intentional self-destruction" -body {
# Basic tests.
#
test ttk-1.1 "Create multiline button showing justified text" -body {
+ wm geometry . +100+100
+ event generate . <Motion> -warp 1 -x 600 -y 600
pack [ttk::button .t -text "Hello\nWorld!!" -justify center] -expand true -fill both
update
}
@@ -152,6 +154,8 @@ test ttk-1.4 "Original style preserved" -body {
.t cget -style
} -result ""
+# Tests using this will fail if the top-level window contains the cursor
+
proc checkstate {w} {
foreach statespec {
{!active !disabled}
@@ -166,7 +170,6 @@ proc checkstate {w} {
set result
}
-# NB: this will fail if the top-level window pops up underneath the cursor
test ttk-2.0 "Check state" -body {
checkstate .t
} -result [list 1 0 0 0 0 0]
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 2ad40e2..9194796 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -16,18 +16,6 @@ namespace import -force ::tk::test:loadTkCommand
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
-# Starting with macOS Ventura it became necessary to wait for windows to be restacked
-# or to be raised after creation.
-
-if {[tk windowingsystem] eq "aqua"} {
- proc restackDelay {} {
- after 200;
- update idletasks
- }
-} else {
- proc restackDelay {} {}
-}
-
proc sleep ms {
global x
after $ms {set x 1}
@@ -105,6 +93,7 @@ foreach geom "+20+80 +80+$Y0 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" {
set i 1
foreach geom "+20+80 +80+$Y0 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" {
test unixWm-3.$i {moving window while iconified} unix {
+ update
wm iconify .t
update idletasks
wm geom .t $geom
@@ -1373,7 +1362,9 @@ test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on gr
wm geometry .t
} {30x10+0+0}
test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} unix {
+ update
destroy .t
+ update
toplevel .t
wm geometry .t 200x100+100+$Y0
listbox .t.l -height 20 -width 20
@@ -1798,6 +1789,8 @@ test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
} {52 7 12 62}
deleteWindows
+# Make sure that the root window is out of the way!
+wm geom . +700+700
wm withdraw .
if {[tk windowingsystem] eq "aqua"} {
# Modern mac windows have no border.
@@ -1834,14 +1827,12 @@ test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and
tkwait visibility .t
wm geom .t +100+100
update
- restackDelay
toplevel .t2 -width 200 -height 100 -bg blue
wm overrideredirect .t2 1
tkwait visibility .t2
wm geom .t2 +200+200
update
raise .t2
- restackDelay
set x [winfo rootx .t]
set y [winfo rooty .t]
set y2 [winfo rooty .t2]
@@ -1855,11 +1846,10 @@ test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and
[winfo containing [expr $x +200] [expr $y + 450]]
} {{} {} .t .t .t2 .t2 .t {}}
test unixWm-50.3 {
- Tk_CoordsToWindow procedure, finding a toplevel with embedding
+ Tk_CoordsToWindow procedure, finding a toplevel with embedding
} tempNotWin {
deleteWindows
catch {interp delete child}
-
toplevel .t -width 300 -height 400 -bg blue
wm geom .t +100+100
frame .t.f -container 1 -bg red
@@ -1888,7 +1878,6 @@ test unixWm-50.3 {
} {{} .x .t .t.f}
test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix {
destroy .t
-
catch {interp delete child}
toplevel .t -width 200 -height 200 -bg green
tkwait visibility .t
@@ -1897,9 +1886,8 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix
interp create child
load {} Tk child
child eval {wm geometry . 200x200+100+100; update}
- restackDelay
set result [list [winfo containing 200 200] \
- [child eval {winfo containing 200 200}]]
+ [child eval {winfo containing 200 200}]]
interp delete child
set result
} {{} .}
@@ -1979,21 +1967,22 @@ test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix {
test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} {unix failsOnUbuntu failsOnXQuarz} {
destroy .t
destroy .t2
+ update
toplevel .t -width 200 -height 200 -bg green
tkwait visibility .t
- update
- wm geometry .t +0+0
+ wm geometry .t +20+20
+ after 200
update
toplevel .t2 -width 200 -height 200 -bg red
tkwait visibility .t2
+ wm geometry .t2 +20+20
+ after 200
update
- wm geometry .t2 +0+0
- update
- restackDelay
- set result [list [winfo containing 100 100]]
- wm iconify .t2
+ set result [list [winfo containing 120 120]]
+ destroy .t2
+ after 200
update
- lappend result [winfo containing 100 100]
+ lappend result [winfo containing 120 120]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
destroy .t
@@ -2071,7 +2060,6 @@ test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapp
tkwait visibility .t
wm geometry .t +0+0
update
- restackDelay
destroy .t2
toplevel .t2 -width 200 -height 200 -bg red
# This test assumes that .t2 is not mapped yet, but that is not really guaranteed.
@@ -2083,15 +2071,15 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {uni
toplevel $w -width 200 -height 200 -bg green
tkwait visibility $w
wm geometry $w +100+100
+ after 200
update
}
+ update
raise .t .t2
- restackDelay
update
set result [list [winfo containing 200 200]]
lower .t3
- restackDelay
- sleep 10
+ update
lappend result [winfo containing 200 200]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
@@ -2105,7 +2093,6 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
wm overrideredirect .t2 1
wm geometry .t2 +0+0
tkwait visibility .t2
- restackDelay
# Need to use vrootx and vrooty to make tests work correctly with
# virtual root window measures managers: overrideredirect windows
@@ -2116,15 +2103,14 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
raise .t
- restackDelay
lappend result [winfo containing $x $y]
raise .t2
- restackDelay
lappend result [winfo containing $x $y]
} {.t2 .t .t2}
# The mac won't put an overrideredirect window above the root,
if {[tk windowingsystem] eq "aqua"} {
wm withdraw .
+ update
}
test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} unix {
foreach w {.t .t2 .t3} {
@@ -2132,12 +2118,11 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
update
toplevel $w -width 200 -height 200 -bg green
wm overrideredirect $w 1
- wm geometry $w +0+0
tkwait visibility $w
+ wm geometry $w +0+0
update
}
lower .t3 .t2
- restackDelay
update
# Need to use vrootx and vrooty to make tests work correctly with
@@ -2149,11 +2134,12 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
lower .t2
- restackDelay
+ update
lappend result [winfo containing $x $y]
} {.t2 .t3}
if {[tk windowingsystem] eq "aqua"} {
wm deiconify .
+ update
}
test unixWm-51.10 {TkWmRestackToplevel procedure, don't move window that's already in the right place} unix {
makeToplevels
diff --git a/tests/visual_bb.test b/tests/visual_bb.test
index 36612a9..c2bed6f 100644
--- a/tests/visual_bb.test
+++ b/tests/visual_bb.test
@@ -23,7 +23,7 @@ proc runTest {file} {
global testNum
test "2.$testNum" "testing $file" {userInteraction} {
- uplevel #0 [list source -encoding utf-8 [file join [testsDirectory] $file]]
+ uplevel #0 [list source [file join [testsDirectory] $file]]
concat ""
} {}
incr testNum
diff --git a/tests/window.test b/tests/window.test
index 8a56d5a..892ceea 100644
--- a/tests/window.test
+++ b/tests/window.test
@@ -11,7 +11,8 @@ tcltest::configure {*}$argv
tcltest::loadTestedCommands
namespace import ::tk::test::loadTkCommand
update
-
+# Move the mouse out of the way for window-2.1
+event generate {} <Motion> -warp 1 -x 640 -y 10
# XXX This file is woefully incomplete. Right now it only tests
# a few parts of a few procedures in tkWindow.c
diff --git a/tests/winfo.test b/tests/winfo.test
index d4cc1ff..908647b 100644
--- a/tests/winfo.test
+++ b/tests/winfo.test
@@ -441,8 +441,10 @@ test winfo-13.3 {destroying container window} -setup {
test winfo-13.4 {[winfo containing] with embedded windows} -setup {
deleteWindows
} -body {
+ wm geometry . +100+100
frame .con -container 1
pack .con -expand yes -fill both
+ update
toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
button .emb.b
pack .emb.b -expand yes -fill both
diff --git a/tests/wm.test b/tests/wm.test
index d913006..650292d 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -1084,6 +1084,8 @@ test wm-iconwindow-1.5 {usage} -setup {
} -result {.icon is already an icon for .t2}
test wm-iconwindow-2.1 {setting and reading values} -setup {
+ # without this macOS crashes for unknown reasons
+ wm iconwindow .t {}
destroy .icon
set result {}
} -body {
diff --git a/tests/xmfbox.test b/tests/xmfbox.test
index 89eda3c..0d3b4d3 100644
--- a/tests/xmfbox.test
+++ b/tests/xmfbox.test
@@ -54,6 +54,7 @@ proc cleanup {} {
}
catch {unset foo}
destroy .foo
+ update
}
# ----------------------------------------------------------------------
@@ -76,6 +77,7 @@ test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} -constraints {
} -body {
toplevel .bar
wm geometry .bar +0+0
+ update
set x [tk::MotifFDialog_Create foo open {-parent .bar}]
} -cleanup {
destroy $x
@@ -89,6 +91,7 @@ test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} -constraints {
cleanup
file mkdir ./~nosuchuser1
set x [tk::MotifFDialog_Create foo open {}]
+ update
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
file normalize [file join {*}[tk::MotifFDialog_InterpFilter $x]]
@@ -100,6 +103,7 @@ test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} -constraints {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
+ update
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
file normalize [file join {*}[tk::MotifFDialog_InterpFilter $x]]
@@ -111,6 +115,7 @@ test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} -constraints {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
+ update
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
tk::MotifFDialog_InterpFilter $x
@@ -124,6 +129,7 @@ test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} -constraints {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
+ update
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
expr {$i >= 0}
} -result 1
@@ -134,6 +140,7 @@ test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} -constraints {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
+ update
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
$::tk::dialog::file::foo(fList) selection clear 0 end
$::tk::dialog::file::foo(fList) selection set $i
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 039c2e6..543b388 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -112,7 +112,7 @@ TCL_PLATFORM_DIR = $(TCLDIR)/unix
# for this version of Tk:
TCL_BIN_DIR = @TCL_BIN_DIR@
-# The linker flags needed to link in the Tcl library (ex: -ltcl8.7)
+# The linker flags needed to link in the Tcl library (ex: -ltcl9.0)
TCL_LIB_FLAG = @TCL_LIB_FLAG@
# Flag, 1: we're building a shared lib, 0 we're not
@@ -339,7 +339,7 @@ CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \
${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \
${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
-${NO_DEPRECATED_FLAGS} -DTCL_UTF_MAX=3 @EXTRA_CC_SWITCHES@
+${NO_DEPRECATED_FLAGS} -DTCL_UTF_MAX=4 @EXTRA_CC_SWITCHES@
CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@
@@ -352,7 +352,7 @@ ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
WISH_OBJS = tkAppInit.o
-TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o tkOldTest.o \
+TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o \
$(@TK_WINDOWINGSYSTEM@_TKTEST_OBJS)
WIDG_OBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
@@ -467,7 +467,7 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tkTextImage.c \
$(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \
$(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \
- $(GENERIC_DIR)/tkOldConfig.c $(GENERIC_DIR)/tkOldTest.c \
+ $(GENERIC_DIR)/tkOldConfig.c \
$(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \
$(GENERIC_DIR)/tkStubInit.c
@@ -655,9 +655,9 @@ ${LIB_FILE}: ${STUB_LIB_FILE} @LIB_RSRC_FILE@ ${OBJS} ${TK_ZIP_FILE}
fi
${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
- @if test "x${LIB_FILE}" = "xlibtk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \
- (cd ${TOP_DIR}/win; ${MAKE} tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \
- cp "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \
+ @if test "x${LIB_FILE}" = "xlibtcl9tk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \
+ (cd ${TOP_DIR}/win; ${MAKE} tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \
+ cp "${TOP_DIR}/win/tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \
fi
rm -f $@
@MAKE_STUB_LIB@
@@ -1247,9 +1247,6 @@ tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h
tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c
-tkOldTest.o: $(GENERIC_DIR)/tkOldTest.c
- $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkOldTest.c
-
tkTest.o: $(GENERIC_DIR)/tkTest.c tkUuid.h
$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkTest.c
diff --git a/unix/configure b/unix/configure
index 85b1fb6..85fa9fb 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tk 8.7.
+# Generated by GNU Autoconf 2.72 for tk 9.0.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -601,8 +601,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tk'
PACKAGE_TARNAME='tk'
-PACKAGE_VERSION='8.7'
-PACKAGE_STRING='tk 8.7'
+PACKAGE_VERSION='9.0'
+PACKAGE_STRING='tk 9.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1376,7 +1376,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures tk 8.7 to adapt to many kinds of systems.
+'configure' configures tk 9.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1442,7 +1442,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tk 8.7:";;
+ short | recursive ) echo "Configuration of tk 9.0:";;
esac
cat <<\_ACEOF
@@ -1559,7 +1559,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tk configure 8.7
+tk configure 9.0
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1925,7 +1925,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tk $as_me 8.7, which was
+It was created by tk $as_me 9.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -2604,10 +2604,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-TK_VERSION=8.7
-TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="b1"
+TK_VERSION=9.0
+TK_MAJOR_VERSION=9
+TK_MINOR_VERSION=0
+TK_PATCH_LEVEL="b3"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -2700,11 +2700,11 @@ printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory co
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tcl8.7 2>/dev/null` \
+ `ls -d /usr/lib/tcl9.0 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -2803,12 +2803,8 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
- as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
-Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
-fi
-if test "${TCL_MINOR_VERSION}" -lt 6 ; then
- as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
+if test "${TCL_MINOR_VERSION}" -lt 7 ; then
+ as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
fi
fi
@@ -5227,16 +5223,12 @@ fi
case $system in
DragonFly-*|FreeBSD-*)
- if test "${TCL_THREADS}" = "1"
-then :
-
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
-fi
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
;;
- esac
+ esac
if test $doRpath = yes
then :
@@ -6427,6 +6419,33 @@ printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
+ # Check for vfork, posix_spawnp() and friends unconditionally
+ ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork"
+if test "x$ac_cv_func_vfork" = xyes
+then :
+ printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp"
+if test "x$ac_cv_func_posix_spawnp" = xyes
+then :
+ printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2"
+if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes
+then :
+ printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags"
+if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes
+then :
+ printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h
+
+fi
+
+
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
# would use TCL_DL_LIBS instead of TCL_LIBS.
@@ -6635,6 +6654,59 @@ printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h
tcl_flags="$tcl_flags _FILE_OFFSET_BITS"
fi
+
+ if test ${tcl_cv_flag__largefile64_source+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main (void)
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ tcl_cv_flag__largefile64_source=no
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE64_SOURCE 1
+#include <sys/stat.h>
+int
+main (void)
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ tcl_cv_flag__largefile64_source=yes
+else case e in #(
+ e) tcl_cv_flag__largefile64_source=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+
+ if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
+
+printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
+ fi
+
if test "x${tcl_flags}" = "x" ; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
printf "%s\n" "none" >&6; }
@@ -6833,43 +6905,6 @@ printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
-printf %s "checking for struct stat64... " >&6; }
-if test ${tcl_cv_struct_stat64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main (void)
-{
-struct stat64 p;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_struct_stat64=yes
-else case e in #(
- e) tcl_cv_struct_stat64=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
-printf "%s\n" "$tcl_cv_struct_stat64" >&6; }
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
-
-printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
-
- fi
-
ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64"
if test "x$ac_cv_func_open64" = xyes
then :
@@ -9256,17 +9291,8 @@ fi
#--------------------------------------------------------------------
# Replace ${VERSION} with contents of ${TK_VERSION}
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
TK_STUB_LIB_FILE="libtkstub.a"
TK_STUB_LIB_FLAG="-ltkstub"
-else
- eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}"
-else
- TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`"
-fi
-fi
eval "TK_STUB_LIB_DIR=\"${libdir}\""
TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
@@ -9888,7 +9914,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tk $as_me 8.7, which was
+This file was extended by tk $as_me 9.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9947,7 +9973,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-tk config.status 8.7
+tk config.status 9.0
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
diff --git a/unix/configure.ac b/unix/configure.ac
index a532ac5..4281a14 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
-AC_INIT([tk],[8.7])
+AC_INIT([tk],[9.0])
AC_PREREQ([2.69])
dnl This is only used when included from macosx/configure.ac
@@ -23,10 +23,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
#endif /* _TKCONFIG */])
])
-TK_VERSION=8.7
-TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="b1"
+TK_VERSION=9.0
+TK_MAJOR_VERSION=9
+TK_MINOR_VERSION=0
+TK_PATCH_LEVEL="b3"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -38,12 +38,8 @@ SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
- AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
-Found config for Tcl ${TCL_VERSION}])
-fi
-if test "${TCL_MINOR_VERSION}" -lt 6 ; then
- AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
+if test "${TCL_MINOR_VERSION}" -lt 7 ; then
+ AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
Found config for Tcl ${TCL_VERSION}])
fi
fi
@@ -760,17 +756,8 @@ AC_SUBST(INSTALL_MSGS)
#--------------------------------------------------------------------
# Replace ${VERSION} with contents of ${TK_VERSION}
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
TK_STUB_LIB_FILE="libtkstub.a"
TK_STUB_LIB_FLAG="-ltkstub"
-else
- eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}"
-else
- TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`"
-fi
-fi
eval "TK_STUB_LIB_DIR=\"${libdir}\""
TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index a46478c..7b84923 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -93,11 +93,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tcl8.7 2>/dev/null` \
+ `ls -d /usr/lib/tcl9.0 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -226,11 +226,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tk8.7 2>/dev/null` \
+ `ls -d /usr/lib/tk9.0 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tk8.7 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \
+ `ls -d /usr/local/lib/tk9.0 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i; pwd)`"
@@ -1276,13 +1276,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
case $system in
DragonFly-*|FreeBSD-*)
- AS_IF([test "${TCL_THREADS}" = "1"], [
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
;;
- esac
+ esac
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
@@ -1874,6 +1873,9 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],)
+ # Check for vfork, posix_spawnp() and friends unconditionally
+ AC_CHECK_FUNCS(vfork posix_spawnp posix_spawn_file_actions_adddup2 posix_spawnattr_setflags)
+
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
# would use TCL_DL_LIBS instead of TCL_LIBS.
@@ -2292,6 +2294,7 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
# Might define the following vars:
# _ISOC99_SOURCE
# _FILE_OFFSET_BITS
+# _LARGEFILE64_SOURCE
#
#--------------------------------------------------------------------
@@ -2315,6 +2318,8 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include <sys/stat.h>],
[switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64)
+ SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
if test "x${tcl_flags}" = "x" ; then
AC_MSG_RESULT([none])
else
@@ -2335,7 +2340,6 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
# HAVE_STRUCT_DIRENT64, HAVE_DIR64
-# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
# _TIME_BITS
#
@@ -2391,14 +2395,6 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
fi
- AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat64 p;
-]])],
- [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])])
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
- AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
- fi
-
AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
AC_CACHE_VAL(tcl_cv_type_off64_t,[
diff --git a/unix/tk.spec b/unix/tk.spec
index 824ea40..abb352f 100644
--- a/unix/tk.spec
+++ b/unix/tk.spec
@@ -4,15 +4,15 @@
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
-Version: 8.7b1
+Version: 9.0b3
Release: 2
License: BSD
Group: Development/Languages
Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz
URL: https://www.tcl-lang.org/
Buildroot: /var/tmp/%{name}%{version}
-Buildrequires: XFree86-devel tcl >= 8.7b1
-Requires: tcl >= 8.7b1
+Buildrequires: XFree86-devel tcl >= 8.7.0
+Requires: tcl >= 8.7.0
%description
The Tcl (Tool Command Language) provides a powerful platform for
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 91eb691..c427ac1 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -12,6 +12,25 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+/*
+ * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list:
+ * What's going on is related to TIP #596:
+ * Stubs support for Embedding Tcl in other applications
+ *
+ * If an application using Tcl_Main() is compiled with USE_TCL_STUBS,
+ * Tcl_Main() will be replaced by a stub function, which loads
+ * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If
+ * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens.
+ *
+ * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS
+ * (unless you want to use the TIP #596 functionality)
+ *
+ * The proper solution is to make sure that Makefile.in doesn't use
+ * TCL_USE_STUBS when compiling tkAppInit.c. But that's a
+ * quite big re-organization just before a b1 release. Simpler
+ * is just to #undef'ine USE_TCL_STUBS, it has the same effect.
+ */
+#undef USE_TCL_STUBS
#undef BUILD_tk
#undef STATIC_BUILD
#include "tk.h"
diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in
index 2f6eca6..ffc0e06 100644
--- a/unix/tkConfig.h.in
+++ b/unix/tkConfig.h.in
@@ -34,6 +34,15 @@
/* Define to 1 if you have the `open64' function. */
#undef HAVE_OPEN64
+/* Define to 1 if you have the `posix_spawnattr_setflags' function. */
+#undef HAVE_POSIX_SPAWNATTR_SETFLAGS
+
+/* Define to 1 if you have the `posix_spawnp' function. */
+#undef HAVE_POSIX_SPAWNP
+
+/* Define to 1 if you have the `posix_spawn_file_actions_adddup2' function. */
+#undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
+
/* Does struct password have a pw_gecos field? */
#undef HAVE_PW_GECOS
@@ -58,9 +67,6 @@
/* Is 'struct dirent64' in <sys/types.h>? */
#undef HAVE_STRUCT_DIRENT64
-/* Is 'struct stat64' in <sys/stat.h>? */
-#undef HAVE_STRUCT_STAT64
-
/* Should we include <sys/select.h>? */
#undef HAVE_SYS_SELECT_H
@@ -82,6 +88,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
/* Is weak import available? */
#undef HAVE_WEAK_IMPORT
@@ -189,6 +198,9 @@
/* Add the _ISOC99_SOURCE flag when building */
#undef _ISOC99_SOURCE
+/* Add the _LARGEFILE64_SOURCE flag when building */
+#undef _LARGEFILE64_SOURCE
+
/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */
#undef _OE_SOCKETS
diff --git a/unix/tkUnix.c b/unix/tkUnix.c
index c0c0288..1c61603 100644
--- a/unix/tkUnix.c
+++ b/unix/tkUnix.c
@@ -135,6 +135,8 @@ Tk_UpdatePointer(
*----------------------------------------------------------------------
*/
+extern int XUnionRegion(Region srca, Region srcb, Region dr_return);
+
void
TkpCopyRegion(
TkRegion dst,
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index 2512f3c..16fdcc6 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -351,8 +351,8 @@
#define DEF_MESSAGE_HIGHLIGHT BLACK
#define DEF_MESSAGE_HIGHLIGHT_WIDTH "0"
#define DEF_MESSAGE_JUSTIFY "left"
-#define DEF_MESSAGE_PADX "-1"
-#define DEF_MESSAGE_PADY "-1"
+#define DEF_MESSAGE_PADX NULL
+#define DEF_MESSAGE_PADY NULL
#define DEF_MESSAGE_RELIEF "flat"
#define DEF_MESSAGE_TAKE_FOCUS "0"
#define DEF_MESSAGE_TEXT ""
@@ -448,7 +448,7 @@
#define DEF_SCROLLBAR_BORDER_WIDTH "1"
#define DEF_SCROLLBAR_COMMAND ""
#define DEF_SCROLLBAR_CURSOR ""
-#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1"
+#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL
#define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG
#define DEF_SCROLLBAR_HIGHLIGHT BLACK
#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0"
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 2ded5d9..da75d0f 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -238,16 +238,6 @@ static unsigned RankAttributes(FontAttributes *wantPtr,
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
-#if TCL_MAJOR_VERSION < 9
-static int Ucs2beToUtfProc(void *clientData, const char*src,
- int srcLen, int flags, Tcl_EncodingState*statePtr,
- char *dst, int dstLen, int *srcReadPtr,
- int *dstWrotePtr, int *dstCharsPtr);
-static int UtfToUcs2beProc(void *clientData, const char*src,
- int srcLen, int flags, Tcl_EncodingState*statePtr,
- char *dst, int dstLen, int *srcReadPtr,
- int *dstWrotePtr, int *dstCharsPtr);
-#endif
/*
*-------------------------------------------------------------------------
@@ -314,9 +304,6 @@ TkpFontPkgInit(
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
SubFont dummy;
int i;
-#if TCL_MAJOR_VERSION < 9
- Tcl_Encoding ucs2;
-#endif
if (tsdPtr->controlFamily.encoding == NULL) {
@@ -337,15 +324,6 @@ TkpFontPkgInit(
* if it doesn't exist yet. It is used in iso10646 fonts.
*/
-#if TCL_MAJOR_VERSION < 9
- ucs2 = Tcl_GetEncoding(NULL, "ucs-2be");
- if (ucs2 == NULL) {
- Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2};
- Tcl_CreateEncoding(&ucs2type);
- } else {
- Tcl_FreeEncoding(ucs2);
- }
-#endif
Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL);
}
}
@@ -415,7 +393,7 @@ ControlUtfProc(
result = TCL_CONVERT_NOSPACE;
break;
}
- src += TkUtfToUniChar(src, &ch);
+ src += Tcl_UtfToUniChar(src, &ch);
dst[0] = '\\';
if (((size_t)ch < sizeof(mapChars)) && (mapChars[ch] != 0)) {
dst[1] = mapChars[ch];
@@ -449,202 +427,6 @@ ControlUtfProc(
}
/*
- *-------------------------------------------------------------------------
- *
- * Ucs2beToUtfProc --
- *
- * Convert from UCS-2BE (big-endian 16-bit Unicode) to UTF-8.
- *
- * Results:
- * Returns TCL_OK if conversion was successful.
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-#if TCL_MAJOR_VERSION < 9
-static int
-Ucs2beToUtfProc(
- TCL_UNUSED(void *), /* Not used. */
- const char *src, /* Source string in Unicode. */
- int srcLen, /* Source string length in bytes. */
- int flags, /* Conversion control flags. */
- TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
- * information used during a piecewise
- * conversion. Contents of statePtr are
- * initialized and/or reset by conversion
- * routine under control of flags argument. */
- char *dst, /* Output buffer in which converted string is
- * stored. */
- int dstLen, /* The maximum length of output buffer in
- * bytes. */
- int *srcReadPtr, /* Filled with the number of bytes from the
- * source string that were converted. This may
- * be less than the original source length if
- * there was a problem converting some source
- * characters. */
- int *dstWrotePtr, /* Filled with the number of bytes that were
- * stored in the output buffer as a result of
- * the conversion. */
- int *dstCharsPtr) /* Filled with the number of characters that
- * correspond to the bytes stored in the
- * output buffer. */
-{
- const char *srcStart, *srcEnd;
- const char *dstEnd, *dstStart;
- int result, numChars, charLimit = INT_MAX;
- unsigned short ch;
-
- if (flags & TCL_ENCODING_CHAR_LIMIT) {
- charLimit = *dstCharsPtr;
- }
- result = TCL_OK;
-
- /* check alignment with ucs-2 (2 == sizeof(UCS-2)) */
- if ((srcLen % 2) != 0) {
- result = TCL_CONVERT_MULTIBYTE;
- srcLen--;
- }
- /* If last code point is a high surrogate, we cannot handle that yet */
- if ((srcLen >= 2) && ((src[srcLen - 2] & 0xFC) == 0xD8)) {
- result = TCL_CONVERT_MULTIBYTE;
- srcLen -= 2;
- }
-
- srcStart = src;
- srcEnd = src + srcLen;
-
- dstStart = dst;
- dstEnd = dst + dstLen - 4;
-
- for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
- if (dst > dstEnd) {
- result = TCL_CONVERT_NOSPACE;
- break;
- }
-
- ch = (src[0] & 0xFF) << 8 | (src[1] & 0xFF);
- src += 2 /* sizeof(UTF-16) */;
-
- /*
- * Special case for 1-byte utf chars for speed. Make sure we work with
- * unsigned short-size data.
- */
- if (ch && ch < 0x80) {
- *dst++ = (ch & 0xFF);
- } else {
- dst += Tcl_UniCharToUtf(ch, dst);
- }
- }
-
- *srcReadPtr = src - srcStart;
- *dstWrotePtr = dst - dstStart;
- *dstCharsPtr = numChars;
- return result;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * UtfToUcs2beProc --
- *
- * Convert from UTF-8 to UCS-2BE (fixed 2-byte encoding).
- *
- * Results:
- * Returns TCL_OK if conversion was successful.
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-#if defined(USE_TCL_STUBS)
-/* Since the UCS-2BE encoding is only used when Tk is dynamically loaded in Tcl 8.6,
- * make sure that Tcl_UtfCharComplete is ALWAYS the pre-TIP #575 version,
- * even though Tk is being compiled with -DTCL_NO_DEPRECATED! */
-# undef Tcl_UtfCharComplete
-# define Tcl_UtfCharComplete ((int (*)(const char *, int))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[326]))
-#endif
-
-static int
-UtfToUcs2beProc(
- TCL_UNUSED(void *), /* TableEncodingData that specifies
- * encoding. */
- const char *src, /* Source string in UTF-8. */
- int srcLen, /* Source string length in bytes. */
- int flags, /* Conversion control flags. */
- TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
- * information used during a piecewise
- * conversion. Contents of statePtr are
- * initialized and/or reset by conversion
- * routine under control of flags argument. */
- char *dst, /* Output buffer in which converted string is
- * stored. */
- int dstLen, /* The maximum length of output buffer in
- * bytes. */
- int *srcReadPtr, /* Filled with the number of bytes from the
- * source string that were converted. This may
- * be less than the original source length if
- * there was a problem converting some source
- * characters. */
- int *dstWrotePtr, /* Filled with the number of bytes that were
- * stored in the output buffer as a result of
- * the conversion. */
- int *dstCharsPtr) /* Filled with the number of characters that
- * correspond to the bytes stored in the
- * output buffer. */
-{
- const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
- int result, numChars;
- int ch;
-
- srcStart = src;
- srcEnd = src + srcLen;
- srcClose = srcEnd;
- if (!(flags & TCL_ENCODING_END)) {
- srcClose -= 6;
- }
-
- dstStart = dst;
- dstEnd = dst + dstLen - 2 /* sizeof(UCS-2) */;
-
- result = TCL_OK;
- for (numChars = 0; src < srcEnd; numChars++) {
- if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
- /*
- * If there is more string to follow, this will ensure that the
- * last UTF-8 character in the source buffer hasn't been cut off.
- */
- result = TCL_CONVERT_MULTIBYTE;
- break;
- }
- if (dst > dstEnd) {
- result = TCL_CONVERT_NOSPACE;
- break;
- }
- src += TkUtfToUniChar(src, &ch);
- if (ch > 0xFFFF) {
- ch = 0xFFFD;
- }
-
- /*
- * Ensure big-endianness (store big bits first).
- */
-
- *dst++ = (char)((ch >> 8) & 0xFF);
- *dst++ = (char)(ch & 0xFF);
- }
- *srcReadPtr = src - srcStart;
- *dstWrotePtr = dst - dstStart;
- *dstCharsPtr = numChars;
- return result;
-}
-#endif
-
-/*
*---------------------------------------------------------------------------
*
* TkpGetNativeFont --
@@ -1061,11 +843,11 @@ Tk_MeasureChars(
curX = 0;
end = source + numBytes;
for (p = source; p < end; ) {
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr);
if (thisSubFontPtr != lastSubFontPtr) {
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source,
+ (void)Tcl_UtfToExternalDString(familyPtr->encoding, source,
p - source, &runString);
if (familyPtr->isTwoByteFont) {
curX += XTextWidth16(lastSubFontPtr->fontStructPtr,
@@ -1083,7 +865,7 @@ Tk_MeasureChars(
p = next;
}
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source,
+ (void)Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source,
&runString);
if (familyPtr->isTwoByteFont) {
curX += XTextWidth16(lastSubFontPtr->fontStructPtr,
@@ -1108,7 +890,7 @@ Tk_MeasureChars(
* individually.
*/
- next = source + TkUtfToUniChar(source, &ch);
+ next = source + Tcl_UtfToUniChar(source, &ch);
newX = curX = termX = 0;
term = source;
@@ -1143,7 +925,7 @@ Tk_MeasureChars(
break;
}
- next += TkUtfToUniChar(next, &ch);
+ next += Tcl_UtfToUniChar(next, &ch);
if ((ch < 256) && isspace(ch)) {
if (sawNonSpace) {
term = p;
@@ -1168,13 +950,13 @@ Tk_MeasureChars(
*/
curX = newX;
- p += TkUtfToUniChar(p, &ch);
+ p += Tcl_UtfToUniChar(p, &ch);
}
if ((flags & TK_AT_LEAST_ONE) && (term == source) && (p < end)) {
term = p;
termX = curX;
if (term == source) {
- term += TkUtfToUniChar(term, &ch);
+ term += Tcl_UtfToUniChar(term, &ch);
termX = newX;
}
} else if ((p >= end) || !(flags & TK_WHOLE_WORDS)) {
@@ -1320,7 +1102,7 @@ Tk_DrawChars(
needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike;
for (p = source; p <= end; ) {
if (p < end) {
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr);
} else {
next = p + 1;
@@ -1332,7 +1114,7 @@ Tk_DrawChars(
do_width = (needWidth || (p != end)) ? 1 : 0;
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source,
+ (void)Tcl_UtfToExternalDString(familyPtr->encoding, source,
p - source, &runString);
if (familyPtr->isTwoByteFont) {
XDrawString16(display, drawable, gc, x, y,
@@ -2297,8 +2079,8 @@ FontMapLoadPage(
for (i = row << FONTMAP_SHIFT; i < end; i++) {
int hi, lo;
- if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src),
- TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL,
+ if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i, src),
+ TCL_ENCODING_PROFILE_STRICT, NULL, buf, sizeof(buf), NULL,
NULL, NULL) != TCL_OK) {
continue;
}
@@ -2493,7 +2275,7 @@ CanUseFallback(
}
nameListOrig = nameList;
- srcLen = TkUniCharToUtf(ch, src);
+ srcLen = Tcl_UniCharToUtf(ch, src);
want.fa = fontPtr->font.fa;
want.xa = fontPtr->xa;
@@ -2572,7 +2354,7 @@ CanUseFallback(
numEncodings++;
}
Tcl_UtfToExternal(NULL, encoding, src, srcLen,
- TCL_ENCODING_STOPONERROR, NULL, dst, sizeof(dst), &srcRead,
+ TCL_ENCODING_PROFILE_STRICT, NULL, dst, sizeof(dst), &srcRead,
&dstWrote, NULL);
if (dstWrote == 0) {
goto crossout;
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index c595fbb..933a690 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -196,7 +196,7 @@ TkpGetString(
Tcl_DStringValue(&buf)[len] = '\0';
if (len == 1) {
- len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0],
+ len = Tcl_UniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0],
Tcl_DStringValue(dsPtr));
Tcl_DStringSetLength(dsPtr, len);
} else {
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index 08d45b0..2ed2e49 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -860,14 +860,14 @@ DrawMenuUnderline(
if (mePtr->labelPtr != NULL) {
int len;
- len = TkGetCharLength(mePtr->labelPtr);
+ len = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len && mePtr->underline >= -len) {
int activeBorderWidth, leftEdge, ch;
const char *label, *start, *end;
label = Tcl_GetString(mePtr->labelPtr);
- start = TkUtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline);
- end = start + TkUtfToUniChar(start, &ch);
+ start = Tcl_UtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline);
+ end = start + Tcl_UtfToUniChar(start, &ch);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 23a5c45..af79850 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -146,15 +146,6 @@
#endif
/*
- * These calls implement native bitmaps which are not supported under
- * UNIX. The macros eliminate the calls.
- */
-
-#define TkpDefineNativeBitmaps()
-#define TkpCreateNativeBitmap(display, source) None
-#define TkpGetNativeAppBitmap(display, name, w, h) None
-
-/*
* This macro stores a representation of the window handle in a string.
* This should perhaps use the real size of an XID.
*/
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 617edfe..a99c57b 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -90,7 +90,7 @@ TCL_DECLARE_MUTEX(xftMutex);
static Tcl_Size utf8ToUcs4(const char *source, FcChar32 *c, Tcl_Size numBytes)
{
if (numBytes >= 6) {
- return TkUtfToUniChar(source, (int *)c);
+ return Tcl_UtfToUniChar(source, (int *)c);
}
return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes);
}
@@ -754,7 +754,7 @@ Tk_MeasureChars(
while (numBytes > 0) {
int unichar;
- clen = TkUtfToUniChar(source, &unichar);
+ clen = Tcl_UtfToUniChar(source, &unichar);
c = (FcChar32) unichar;
if (clen <= 0) {
diff --git a/win/Makefile.in b/win/Makefile.in
index 2d3c3ea..a101ac9 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -261,7 +261,7 @@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
-I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \
-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" \
-${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=3 -DUSE_TCL_STUBS
+${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=4 -DUSE_TCL_STUBS
CC_OBJNAME = @CC_OBJNAME@
CC_EXENAME = @CC_EXENAME@
@@ -281,7 +281,6 @@ WISH_OBJS = \
TKTEST_OBJS = \
tkSquare.$(OBJEXT) \
tkTest.$(OBJEXT) \
- tkOldTest.$(OBJEXT) \
tkWinTest.$(OBJEXT)
XLIB_OBJS = \
@@ -765,9 +764,6 @@ testMain.$(OBJEXT): winMain.c
tkTest.$(OBJEXT): tkTest.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
-tkOldTest.$(OBJEXT): tkOldTest.c
- $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
-
tkWinTest.$(OBJEXT): tkWinTest.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
diff --git a/win/README b/win/README
index e371a2c..b8ac0cc 100644
--- a/win/README
+++ b/win/README
@@ -1,4 +1,4 @@
-Tk 8.7 for Windows
+Tk 9.0 for Windows
Originally by Scott Stanton while at Sun Microsystems Labs
diff --git a/win/configure b/win/configure
index 9a92e86..0af7f10 100755
--- a/win/configure
+++ b/win/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tk 8.7.
+# Generated by GNU Autoconf 2.72 for tk 9.0.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -601,8 +601,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tk'
PACKAGE_TARNAME='tk'
-PACKAGE_VERSION='8.7'
-PACKAGE_STRING='tk 8.7'
+PACKAGE_VERSION='9.0'
+PACKAGE_STRING='tk 9.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1355,7 +1355,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures tk 8.7 to adapt to many kinds of systems.
+'configure' configures tk 9.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1417,7 +1417,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tk 8.7:";;
+ short | recursive ) echo "Configuration of tk 9.0:";;
esac
cat <<\_ACEOF
@@ -1515,7 +1515,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tk configure 8.7
+tk configure 9.0
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1725,7 +1725,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tk $as_me 8.7, which was
+It was created by tk $as_me 9.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -2407,10 +2407,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# /bin/sh. The bash shell seems to suffer from some strange failures.
SHELL=/bin/sh
-TK_VERSION=8.7
-TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="b1"
+TK_VERSION=9.0
+TK_MAJOR_VERSION=9
+TK_MINOR_VERSION=0
+TK_PATCH_LEVEL="b3"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -4091,15 +4091,10 @@ printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then
+if test "${TCL_MINOR_VERSION}" -lt 7; then
as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5
-fi
-if test "${TCL_MINOR_VERSION}" -lt 6; then
- as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better." "$LINENO" 5
fi
fi
@@ -5890,11 +5885,7 @@ else
fi
fi
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
- eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
-else
- eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ;
-fi
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
# FIXME: All of this var junk needs to be done in tcl.m4 !!!!
# I left out the other vars that also need to get defined here.
# we also need to double check about spaces in path names
@@ -6569,7 +6560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tk $as_me 8.7, which was
+This file was extended by tk $as_me 9.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6624,7 +6615,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-tk config.status 8.7
+tk config.status 9.0
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
diff --git a/win/configure.ac b/win/configure.ac
index 752b0a6..e56f0e4 100644
--- a/win/configure.ac
+++ b/win/configure.ac
@@ -3,7 +3,7 @@
# generate the file "configure", which is run during Tk installation
# to configure the system for the local environment.
-AC_INIT([tk],[8.7])
+AC_INIT([tk],[9.0])
AC_CONFIG_SRCDIR([../generic/tk.h])
AC_PREREQ([2.69])
@@ -12,10 +12,10 @@ AC_PREREQ([2.69])
# /bin/sh. The bash shell seems to suffer from some strange failures.
SHELL=/bin/sh
-TK_VERSION=8.7
-TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="b1"
+TK_VERSION=9.0
+TK_MAJOR_VERSION=9
+TK_MINOR_VERSION=0
+TK_PATCH_LEVEL="b3"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -77,15 +77,10 @@ SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
SC_LOAD_TCLCONFIG
if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then
+if test "${TCL_MINOR_VERSION}" -lt 7; then
AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.])
-fi
-if test "${TCL_MINOR_VERSION}" -lt 6; then
- AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.])
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better.])
fi
fi
@@ -247,11 +242,7 @@ else
fi
fi
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
- eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
-else
- eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ;
-fi
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
# FIXME: All of this var junk needs to be done in tcl.m4 !!!!
# I left out the other vars that also need to get defined here.
# we also need to double check about spaces in path names
diff --git a/win/makefile.vc b/win/makefile.vc
index 6356ad9..3db8eee 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -151,7 +151,6 @@ TKTESTOBJS = \
$(TMP_DIR)\testMain.obj \
$(TMP_DIR)\tkSquare.obj \
$(TMP_DIR)\tkTest.obj \
- $(TMP_DIR)\tkOldTest.obj \
$(TMP_DIR)\tkWinTest.obj \
$(TMP_DIR)\tktest.res
@@ -337,7 +336,7 @@ PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)"
CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \
/DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \
- /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=3 \
+ /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=4 \
!if $(TTK_SQUARE_WIDGET)
/DTTK_SQUARE_WIDGET=1 \
!endif
@@ -619,9 +618,6 @@ $(TMP_DIR)\tkUuid.h: $(ROOT)\manifest.uuid
$(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c
$(cc32) $(appcflags_nostubs) -Fo$@ $?
-$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c
- $(cc32) $(appcflags_nostubs) -Fo$@ $?
-
$(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c
$(cc32) $(appcflags_nostubs) -Fo$@ $?
diff --git a/win/rc/tktest.rc b/win/rc/tktest.rc
index 7bfd44b..4dfb522 100644
--- a/win/rc/tktest.rc
+++ b/win/rc/tktest.rc
@@ -8,12 +8,6 @@
//
// build-up the name suffix that defines the type of build this is.
//
-#if TCL_THREADS
-#define SUFFIX_THREADS "t"
-#else
-#define SUFFIX_THREADS ""
-#endif
-
#if STATIC_BUILD
#define SUFFIX_STATIC "s"
#else
@@ -26,7 +20,7 @@
#define SUFFIX_DEBUG ""
#endif
-#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG
+#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG
VS_VERSION_INFO VERSIONINFO
diff --git a/win/tcl.m4 b/win/tcl.m4
index fff706b..4bac910 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -985,13 +985,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
#------------------------------------------------------------------------
AC_DEFUN([SC_WITH_TCL], [
- if test -d ../../tcl8.7$1/win; then
- TCL_BIN_DEFAULT=../../tcl8.7$1/win
+ if test -d ../../tcl9.0$1/win; then
+ TCL_BIN_DEFAULT=../../tcl9.0$1/win
else
- TCL_BIN_DEFAULT=../../tcl8.7/win
+ TCL_BIN_DEFAULT=../../tcl9.0/win
fi
- AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.7 binaries from DIR],
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR],
TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`)
if test ! -d $TCL_BIN_DIR; then
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index 3de7fb2..5af7877 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -353,8 +353,8 @@
#define DEF_MESSAGE_HIGHLIGHT HIGHLIGHT
#define DEF_MESSAGE_HIGHLIGHT_WIDTH "0"
#define DEF_MESSAGE_JUSTIFY "left"
-#define DEF_MESSAGE_PADX "-1"
-#define DEF_MESSAGE_PADY "-1"
+#define DEF_MESSAGE_PADX NULL
+#define DEF_MESSAGE_PADY NULL
#define DEF_MESSAGE_RELIEF "flat"
#define DEF_MESSAGE_TAKE_FOCUS "0"
#define DEF_MESSAGE_TEXT ""
@@ -450,7 +450,7 @@
#define DEF_SCROLLBAR_BORDER_WIDTH "0"
#define DEF_SCROLLBAR_COMMAND ""
#define DEF_SCROLLBAR_CURSOR ""
-#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1"
+#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL
#define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG
#define DEF_SCROLLBAR_HIGHLIGHT HIGHLIGHT
#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0"
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 6ced04a..0b0494b 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1436,7 +1436,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
ConvertExternalFilename(wstr, &fnds);
resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds),
- Tcl_DStringLength(&fnds));
+ Tcl_DStringLength(&fnds));
CoTaskMemFree(wstr);
Tcl_DStringFree(&fnds);
}
@@ -2166,9 +2166,9 @@ static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr)
DWORD dw;
for (dw = 0; dw < count; ++dw) {
if (dlgFilterPtr[dw].pszName != NULL)
- ckfree((char *)dlgFilterPtr[dw].pszName);
+ ckfree((void *)dlgFilterPtr[dw].pszName);
if (dlgFilterPtr[dw].pszSpec != NULL)
- ckfree((char *)dlgFilterPtr[dw].pszSpec);
+ ckfree((void *)dlgFilterPtr[dw].pszSpec);
}
ckfree(dlgFilterPtr);
}
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 1802b35..c89a94b 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -845,7 +845,7 @@ Tk_MeasureChars(
start = source;
end = start + numBytes;
for (p = start; p < end; ) {
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr);
if (thisSubFontPtr != lastSubFontPtr) {
familyPtr = lastSubFontPtr->familyPtr;
@@ -906,7 +906,7 @@ Tk_MeasureChars(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_DStringInit(&runString);
for (p = start; p < end; ) {
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
Tcl_UtfToExternal(NULL, familyPtr->encoding, p,
(int) (next - p), TCL_ENCODING_PROFILE_TCL8, NULL, buf, sizeof(buf), NULL,
&dstWrote, NULL);
@@ -961,7 +961,7 @@ Tk_MeasureChars(
p = source;
ch = ' ';
while (p < end) {
- next = p + TkUtfToUniChar(p, &ch2);
+ next = p + Tcl_UtfToUniChar(p, &ch2);
if ((ch != ' ') && (ch2 == ' ')) {
lastWordBreak = p;
}
@@ -1478,7 +1478,7 @@ MultiFontTextOut(
end = source + numBytes;
for (p = source; p < end; ) {
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr);
/*
@@ -2261,7 +2261,7 @@ FontMapLoadPage(
end = (row + 1) << FONTMAP_SHIFT;
for (i = row << FONTMAP_SHIFT; i < end; i++) {
if (Tcl_UtfToExternal(NULL, encoding, src,
- TkUniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL,
+ Tcl_UniCharToUtf(i, src), TCL_ENCODING_PROFILE_STRICT, NULL,
buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) {
continue;
}
diff --git a/win/tkWinGDI.c b/win/tkWinGDI.c
index 7611880..2cded45 100644
--- a/win/tkWinGDI.c
+++ b/win/tkWinGDI.c
@@ -1366,7 +1366,8 @@ static int GdiCharWidths(
HDC hDC;
LOGFONTW lf;
- HFONT hfont, oldfont;
+ HFONT hfont;
+ HGDIOBJ oldfont;
int made_font = 0;
const char *aryvarname = "GdiCharWidths";
/* For now, assume 256 characters in the font.... */
@@ -1481,9 +1482,10 @@ int GdiText(
const char *string = 0;
RECT sizerect;
UINT format_flags = DT_EXPANDTABS|DT_NOPREFIX; /* Like the canvas. */
- Tk_Anchor anchor = 0;
+ Tk_Anchor anchor = TK_ANCHOR_N;
LOGFONTW lf;
- HFONT hfont, oldfont;
+ HFONT hfont;
+ HGDIOBJ oldfont;
int made_font = 0;
int retval;
int dotextcolor = 0;
@@ -3114,7 +3116,7 @@ static HBITMAP CopyScreenToBitmap(
LPRECT lpRect)
{
HDC hScrDC, hMemDC; /* Screen DC and memory DC. */
- HBITMAP hBitmap, hOldBitmap; /* Handles to deice-dependent bitmaps. */
+ HGDIOBJ hBitmap, hOldBitmap; /* Handles to deice-dependent bitmaps. */
int nX, nY, nX2, nY2; /* Coordinates of rectangle to grab. */
int nWidth, nHeight; /* DIB width and height */
int xScrn, yScrn; /* Screen resolution. */
@@ -3186,7 +3188,7 @@ static HBITMAP CopyScreenToBitmap(
/* Return handle to the bitmap. */
- return hBitmap;
+ return (HBITMAP)hBitmap;
}
/*
@@ -3230,7 +3232,7 @@ static HANDLE BitmapToDIB(
/* Ff no palette is specified, use default palette. */
if (hPal == NULL) {
- hPal = GetStockObject(DEFAULT_PALETTE);
+ hPal = (HPALETTE)GetStockObject(DEFAULT_PALETTE);
}
/* Calculate bits per pixel. */
@@ -3648,17 +3650,17 @@ static int PrintSelectPrinter(
*varlink2 = varlink1;
WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL);
- Tcl_LinkVar(interp, "::tk::print::printer_name", (char*)varlink2,
+ Tcl_LinkVar(interp, "::tk::print::printer_name", varlink2,
TCL_LINK_STRING | TCL_LINK_READ_ONLY);
- Tcl_LinkVar(interp, "::tk::print::copies", (char*)&copies,
+ Tcl_LinkVar(interp, "::tk::print::copies", &copies,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
- Tcl_LinkVar(interp, "::tk::print::dpi_x", (char*)&dpi_x,
+ Tcl_LinkVar(interp, "::tk::print::dpi_x", &dpi_x,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
- Tcl_LinkVar(interp, "::tk::print::dpi_y", (char*)&dpi_y,
+ Tcl_LinkVar(interp, "::tk::print::dpi_y", &dpi_y,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
- Tcl_LinkVar(interp, "::tk::print::paper_width", (char*)&paper_width,
+ Tcl_LinkVar(interp, "::tk::print::paper_width", &paper_width,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
- Tcl_LinkVar(interp, "::tk::print::paper_height", (char*)&paper_height,
+ Tcl_LinkVar(interp, "::tk::print::paper_height", &paper_height,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
}
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 02477cc..61cb06e 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -113,7 +113,7 @@ TkpGetString(
* Special case for WM_UNICHAR and win2000 multilingual IME input
*/
- len = TkUniCharToUtf(keyEv->keycode, buf);
+ len = Tcl_UniCharToUtf(keyEv->keycode, buf);
Tcl_DStringAppend(dsPtr, buf, len);
} else {
/*
@@ -125,7 +125,7 @@ TkpGetString(
if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256))
|| (keysym == XK_Return) || (keysym == XK_Tab)) {
- len = TkUniCharToUtf(keysym & 255, buf);
+ len = Tcl_UniCharToUtf(keysym & 255, buf);
Tcl_DStringAppend(dsPtr, buf, len);
}
}
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 29332e2..909237c 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -509,7 +509,7 @@ GetEntryText(
: Tcl_GetString(mePtr->accelPtr);
const char *p, *next;
Tcl_DString itemString;
- int ch = 0;
+ Tcl_UniChar ch = 0;
/*
* We have to construct the string with an ampersand preceeding the
@@ -526,7 +526,7 @@ GetEntryText(
if (*p == '&') {
Tcl_DStringAppend(&itemString, "&", 1);
}
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
ch = 0;
@@ -536,7 +536,7 @@ GetEntryText(
if (*p == '&') {
Tcl_DStringAppend(&itemString, "&", 1);
}
- next = p + TkUtfToUniChar(p, &ch);
+ next = p + Tcl_UtfToUniChar(p, &ch);
Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
}
@@ -2102,14 +2102,14 @@ DrawMenuUnderline(
if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) {
int len;
- len = TkGetCharLength(mePtr->labelPtr);
+ len = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
const char *label, *start, *end;
int ch;
label = Tcl_GetString(mePtr->labelPtr);
- start = TkUtfAtIndex(label, mePtr->underline);
- end = start + TkUtfToUniChar(start, &ch);
+ start = Tcl_UtfAtIndex(label, mePtr->underline);
+ end = start + Tcl_UtfToUniChar(start, &ch);
Tk_UnderlineChars(menuPtr->display, d,
gc, tkfont, label, x + mePtr->indicatorSpace,
y + (height + fmPtr->ascent - fmPtr->descent) / 2,
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index b991800..4a331ae 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -124,13 +124,4 @@
#define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
| ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
-/*
- * These calls implement native bitmaps which are not currently
- * supported under Windows. The macros eliminate the calls.
- */
-
-#define TkpDefineNativeBitmaps()
-#define TkpCreateNativeBitmap(display, source) None
-#define TkpGetNativeAppBitmap(display, name, w, h) None
-
#endif /* _WINPORT */
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 7938539..ba52b32 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2461,6 +2461,33 @@ TkpWmGetState(
*--------------------------------------------------------------
*/
+static void CheckForPointer(TkWindow *winPtr)
+{
+ POINT mouse;
+ int x, y;
+ unsigned int state = TkWinGetModifierState();
+ TkWindow **windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
+ TkWindow **w;
+ TkGetPointerCoords(NULL, &x, &y);
+ mouse.x = x;
+ mouse.y = y;
+ if (windows != NULL) {
+ for (w = windows; *w ; w++) {
+ RECT windowRect;
+ HWND hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) *w));
+ if (GetWindowRect(hwnd, &windowRect) == 0) {
+ continue;
+ }
+ if (winPtr != *w && PtInRect(&windowRect, mouse)) {
+ Tk_Window target = Tk_CoordsToWindow(x, y, (Tk_Window) *w);
+ Tk_UpdatePointer((Tk_Window) target, x, y, state);
+ break;
+ }
+ }
+ ckfree(windows);
+ }
+}
+
void
TkWmDeadWindow(
TkWindow *winPtr) /* Top-level window that's being deleted. */
@@ -2599,6 +2626,13 @@ TkWmDeadWindow(
DecrIconRefCount(wmPtr->iconPtr);
}
+ /*
+ * Check if the dead window is a toplevel containing the pointer. If so,
+ * find the window which will inherit the pointer and call
+ * TkUpdatePointer.
+ */
+
+ CheckForPointer(winPtr);
ckfree(wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -6590,8 +6624,6 @@ TkWmStackorderToplevelEnumProc(
TkWmStackorderToplevelPair *pair =
(TkWmStackorderToplevelPair *) lParam;
- /*fprintf(stderr, "Looking up HWND %d\n", hwnd);*/
-
hPtr = Tcl_FindHashEntry(pair->table, hwnd);
if (hPtr != NULL) {
childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr);
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 2047536..656e142 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -661,7 +661,7 @@ TkpCloseDisplay(
ckfree(DefaultVisualOfScreen(ScreenOfDisplay(display, 0)));
}
if (RootWindowOfScreen(ScreenOfDisplay(display, 0)) != None) {
- ckfree((char *)RootWindowOfScreen(ScreenOfDisplay(display, 0)));
+ ckfree((void *)RootWindowOfScreen(ScreenOfDisplay(display, 0)));
}
if (DefaultColormapOfScreen(ScreenOfDisplay(display, 0)) != None) {
XFreeColormap(display, DefaultColormapOfScreen(ScreenOfDisplay(display, 0)));
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index 690c30b..f50f49f 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -621,7 +621,7 @@ static void ThumbElementSize(
ThumbElement *thumbPtr = (ThumbElement *)elementRecord;
Ttk_Orient orient;
- TtkGetOrientFromObj(NULL, thumbPtr->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, thumbPtr->orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL) {
*widthPtr = GetSystemMetrics(SM_CXHTHUMB);
*heightPtr = GetSystemMetrics(SM_CYHSCROLL);
@@ -686,7 +686,7 @@ static void SliderElementSize(
SliderElement *slider = (SliderElement *)elementRecord;
Ttk_Orient orient;
- TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
+ Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL) {
*widthPtr = (GetSystemMetrics(SM_CXHTHUMB) / 2) | 1;
*heightPtr = GetSystemMetrics(SM_CYHSCROLL);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 51b236a..5b97fad 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -426,10 +426,10 @@ static void DestroyElementData(void *clientData)
{
ElementData *elementData = (ElementData *)clientData;
if (elementData->info->flags & HEAP_ELEMENT) {
- ckfree((char *)elementData->info->statemap);
- ckfree((char *)elementData->info->className);
- ckfree((char *)elementData->info->elementName);
- ckfree((char *)elementData->info);
+ ckfree((void *)elementData->info->statemap);
+ ckfree((void *)elementData->info->className);
+ ckfree((void *)elementData->info->elementName);
+ ckfree((void *)elementData->info);
}
ckfree(clientData);
}
diff --git a/win/winMain.c b/win/winMain.c
index 90324b6..6da18b5 100644
--- a/win/winMain.c
+++ b/win/winMain.c
@@ -12,6 +12,25 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+/*
+ * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list:
+ * What's going on is related to TIP #596:
+ * Stubs support for Embedding Tcl in other applications
+ *
+ * If an application using Tcl_Main() is compiled with USE_TCL_STUBS,
+ * Tcl_Main() will be replaced by a stub function, which loads
+ * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If
+ * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens.
+ *
+ * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS
+ * (unless you want to use the TIP #596 functionality)
+ *
+ * The proper solution is to make sure that Makefile.in doesn't use
+ * TCL_USE_STUBS when compiling tkAppInit.c. But that's a
+ * quite big re-organization just before a b1 release. Simpler
+ * is just to #undef'ine USE_TCL_STUBS, it has the same effect.
+ */
+#undef USE_TCL_STUBS
#include "tk.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/xlib/X11/keysymdef.h b/xlib/X11/keysymdef.h
index 18a18d1..e75c402 100644
--- a/xlib/X11/keysymdef.h
+++ b/xlib/X11/keysymdef.h
@@ -258,15 +258,6 @@ SOFTWARE.
#define XK_Begin 0xff58 /* BOL */
-#ifndef TK_NO_DEPRECATED
-/* Special Windows keyboard keys */
-
-#define XK_Win_L 0xFF5B /* Left-hand Windows */
-#define XK_Win_R 0xFF5C /* Right-hand Windows */
-#define XK_App 0xFF5D /* Menu key */
-#endif
-
-
/* Misc functions */
#define XK_Select 0xff60 /* Select, mark */
@@ -2591,18 +2582,3 @@ SOFTWARE.
#define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */
#define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */
#endif /* XK_SINHALA */
-
-/* Multimedia keys, defined same as on Linux
- * /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h
- */
-
-#ifndef TK_NO_DEPRECATED
-#define XK_XF86AudioLowerVolume 0x1008FF11 /* Volume control down */
-#define XK_XF86AudioMute 0x1008FF12 /* Mute sound from the system */
-#define XK_XF86AudioRaiseVolume 0x1008FF13 /* Volume control up */
-#define XK_XF86AudioPlay 0x1008FF14 /* Start playing of audio > */
-#define XK_XF86AudioStop 0x1008FF15 /* Stop playing audio */
-#define XK_XF86AudioPrev 0x1008FF16 /* Previous track */
-#define XK_XF86AudioNext 0x1008FF17 /* Next track */
-#endif /* !TK_NO_DEPRECATED */
-