├── win ├── gitmanifest.in ├── svnmanifest.in ├── aclocal.m4 ├── tkUuid.h.in ├── rc │ ├── tk.ico │ ├── wish.ico │ ├── cursor00.cur │ ├── cursor02.cur │ ├── cursor04.cur │ ├── cursor06.cur │ ├── cursor08.cur │ ├── cursor0a.cur │ ├── cursor0c.cur │ ├── cursor0e.cur │ ├── cursor10.cur │ ├── cursor12.cur │ ├── cursor14.cur │ ├── cursor16.cur │ ├── cursor18.cur │ ├── cursor1a.cur │ ├── cursor1c.cur │ ├── cursor1e.cur │ ├── cursor20.cur │ ├── cursor22.cur │ ├── cursor24.cur │ ├── cursor26.cur │ ├── cursor28.cur │ ├── cursor2a.cur │ ├── cursor2c.cur │ ├── cursor2e.cur │ ├── cursor30.cur │ ├── cursor32.cur │ ├── cursor34.cur │ ├── cursor36.cur │ ├── cursor38.cur │ ├── cursor3a.cur │ ├── cursor3c.cur │ ├── cursor3e.cur │ ├── cursor40.cur │ ├── cursor42.cur │ ├── cursor44.cur │ ├── cursor46.cur │ ├── cursor48.cur │ ├── cursor4a.cur │ ├── cursor4c.cur │ ├── cursor4e.cur │ ├── cursor50.cur │ ├── cursor52.cur │ ├── cursor54.cur │ ├── cursor56.cur │ ├── cursor58.cur │ ├── cursor5a.cur │ ├── cursor5c.cur │ ├── cursor5e.cur │ ├── cursor60.cur │ ├── cursor62.cur │ ├── cursor64.cur │ ├── cursor66.cur │ ├── cursor68.cur │ ├── cursor6a.cur │ ├── cursor6c.cur │ ├── cursor6e.cur │ ├── cursor70.cur │ ├── cursor72.cur │ ├── cursor74.cur │ ├── cursor76.cur │ ├── cursor78.cur │ ├── cursor7a.cur │ ├── cursor7c.cur │ ├── cursor7e.cur │ ├── cursor80.cur │ ├── cursor82.cur │ ├── cursor84.cur │ ├── cursor86.cur │ ├── cursor88.cur │ ├── cursor8a.cur │ ├── cursor8c.cur │ ├── cursor8e.cur │ ├── cursor90.cur │ ├── cursor92.cur │ ├── cursor94.cur │ ├── cursor96.cur │ ├── cursor98.cur │ ├── cursor9a.cur │ ├── tk.rc │ ├── wish.rc │ └── tktest.rc ├── x86_64-w64-mingw32-nmakehlp.exe ├── README ├── tkWinSendCom.h ├── tkWinConfig.c └── wish.exe.manifest.in ├── .fossil-settings ├── manifest ├── crlf-glob ├── crnl-glob ├── binary-glob ├── encoding-glob └── ignore-glob ├── tests ├── corruptTruncatedColormap.gif ├── option.file2 ├── iDOT.png ├── red.gif ├── earth.gif ├── ouster.png ├── teapot.ppm ├── pwrdLogo150.gif ├── corruptMangled.gif ├── corruptMangled4G.gif ├── corruptTruncated.gif ├── deferredClearCode.gif ├── teapotTransparent.png ├── README ├── option.file1 ├── option.file3 ├── obj.test ├── main.tcl ├── ttk │ ├── layout.test │ └── all.tcl ├── canvPsArc.tcl ├── flagup.xbm ├── flagdown.xbm ├── bell.test └── bgerror.test ├── unix ├── aclocal.m4 ├── tk.pc.in ├── tkUnixInt.h ├── tkUnixConfig.c └── tk.spec ├── macosx ├── Tk.icns ├── Tk.tiff ├── configure.ac ├── tkMacOSXImage.h ├── Credits.html.in ├── tkMacOSXFont.h ├── tkMacOSXDebug.h ├── tkMacOSX.h ├── tkMacOSXConfig.c ├── Tk-Info.plist.in └── Wish.sdef ├── .settings ├── org.eclipse.core.runtime.prefs └── org.eclipse.core.resources.prefs ├── library ├── images │ ├── logo100.gif │ ├── logo64.gif │ ├── logoMed.gif │ ├── tai-ku.gif │ ├── logoLarge.gif │ ├── pwrdLogo75.gif │ ├── pwrdLogo100.gif │ ├── pwrdLogo150.gif │ ├── pwrdLogo175.gif │ ├── pwrdLogo200.gif │ └── README ├── msgs │ └── en_gb.msg ├── demos │ ├── images │ │ ├── earth.gif │ │ ├── ouster.png │ │ ├── tcllogo.gif │ │ ├── teapot.ppm │ │ ├── earthmenu.png │ │ ├── earthris.gif │ │ ├── Tk_feather.png │ │ ├── plowed_field.png │ │ ├── starry_night.png │ │ ├── pattern.xbm │ │ ├── gray25.xbm │ │ ├── flagup.xbm │ │ ├── letters.xbm │ │ ├── flagdown.xbm │ │ └── noletter.xbm │ ├── hello │ ├── dialog2.tcl │ ├── dialog1.tcl │ ├── form.tcl │ ├── paned1.tcl │ ├── timer │ ├── square │ ├── ttkscale.tcl │ ├── image1.tcl │ ├── entry1.tcl │ ├── bitmap.tcl │ ├── clrpick.tcl │ ├── button.tcl │ ├── accessiblewidget │ ├── ttkprogress.tcl │ ├── spin.tcl │ ├── vscale.tcl │ ├── hscale.tcl │ ├── label.tcl │ ├── ttkspin.tcl │ ├── fontchoose.tcl │ ├── browse │ ├── labelframe.tcl │ ├── README │ ├── states.tcl │ ├── icon.tcl │ └── msgbox.tcl ├── ttk │ └── progress.tcl └── optMenu.tcl ├── generic ├── README ├── default.h ├── tkPort.h ├── tkBusy.h └── ttk │ ├── ttkThemeInt.h │ ├── ttkStubInit.c │ └── ttkStubLib.c ├── bitmaps ├── info.xbm ├── warning.xbm ├── gray12.xbm ├── gray25.xbm ├── gray50.xbm ├── gray75.xbm ├── error.xbm ├── hourglass.xbm ├── questhead.xbm └── question.xbm ├── .project ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── doc ├── GetHINSTANCE.3 ├── HWNDToWindow.3 ├── NameOfImg.3 ├── IdToWindow.3 ├── DeleteImg.3 ├── GetHWND.3 ├── MainLoop.3 ├── ttk_Theme.3 ├── SetCaret.3 ├── Inactive.3 ├── DrawFocHlt.3 ├── bell.n ├── StrictMotif.3 ├── ClrSelect.3 ├── destroy.n ├── GetRootCrd.3 ├── ttk_separator.n ├── GetOption.3 ├── lower.n ├── tkerror.n ├── CrtConsoleChan.3 ├── popup.n ├── optionMenu.n ├── GetUid.3 ├── Restack.3 ├── MapWindow.3 ├── chooseColor.n ├── CoordToWin.3 ├── HandleEvent.3 ├── GetPixmap.3 ├── GetVRoot.3 ├── SetVisual.3 ├── OwnSelect.3 ├── QWinEvent.3 ├── InternAtom.3 ├── raise.n ├── SetClass.3 └── sysnotify.n ├── .gitattributes ├── .gitignore ├── xlib ├── ximage.c └── xdraw.c └── changes.md /win/gitmanifest.in: -------------------------------------------------------------------------------- 1 | git- -------------------------------------------------------------------------------- /win/svnmanifest.in: -------------------------------------------------------------------------------- 1 | svn-r -------------------------------------------------------------------------------- /.fossil-settings/manifest: -------------------------------------------------------------------------------- 1 | u 2 | -------------------------------------------------------------------------------- /win/aclocal.m4: -------------------------------------------------------------------------------- 1 | builtin(include,tcl.m4) 2 | -------------------------------------------------------------------------------- /tests/corruptTruncatedColormap.gif: -------------------------------------------------------------------------------- 1 | GIF89add -------------------------------------------------------------------------------- /win/tkUuid.h.in: -------------------------------------------------------------------------------- 1 | #define TK_VERSION_UUID \ 2 | -------------------------------------------------------------------------------- /.fossil-settings/crlf-glob: -------------------------------------------------------------------------------- 1 | win/*.bat 2 | win/*.vc 3 | -------------------------------------------------------------------------------- /.fossil-settings/crnl-glob: -------------------------------------------------------------------------------- 1 | win/*.bat 2 | win/*.vc 3 | -------------------------------------------------------------------------------- /unix/aclocal.m4: -------------------------------------------------------------------------------- 1 | builtin(include,../unix/tcl.m4) 2 | -------------------------------------------------------------------------------- /.fossil-settings/binary-glob: -------------------------------------------------------------------------------- 1 | *.bmp 2 | *.gif 3 | *.png 4 | -------------------------------------------------------------------------------- /tests/option.file2: -------------------------------------------------------------------------------- 1 | *foo1: magenta 2 | foo2 missing colon 3 | -------------------------------------------------------------------------------- /macosx/Tk.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/macosx/Tk.icns -------------------------------------------------------------------------------- /macosx/Tk.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/macosx/Tk.tiff -------------------------------------------------------------------------------- /tests/iDOT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/iDOT.png -------------------------------------------------------------------------------- /tests/red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/red.gif -------------------------------------------------------------------------------- /win/rc/tk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/tk.ico -------------------------------------------------------------------------------- /tests/earth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/earth.gif -------------------------------------------------------------------------------- /tests/ouster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/ouster.png -------------------------------------------------------------------------------- /tests/teapot.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/teapot.ppm -------------------------------------------------------------------------------- /win/rc/wish.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/wish.ico -------------------------------------------------------------------------------- /win/rc/cursor00.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor00.cur -------------------------------------------------------------------------------- /win/rc/cursor02.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor02.cur -------------------------------------------------------------------------------- /win/rc/cursor04.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor04.cur -------------------------------------------------------------------------------- /win/rc/cursor06.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor06.cur -------------------------------------------------------------------------------- /win/rc/cursor08.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor08.cur -------------------------------------------------------------------------------- /win/rc/cursor0a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor0a.cur -------------------------------------------------------------------------------- /win/rc/cursor0c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor0c.cur -------------------------------------------------------------------------------- /win/rc/cursor0e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor0e.cur -------------------------------------------------------------------------------- /win/rc/cursor10.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor10.cur -------------------------------------------------------------------------------- /win/rc/cursor12.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor12.cur -------------------------------------------------------------------------------- /win/rc/cursor14.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor14.cur -------------------------------------------------------------------------------- /win/rc/cursor16.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor16.cur -------------------------------------------------------------------------------- /win/rc/cursor18.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor18.cur -------------------------------------------------------------------------------- /win/rc/cursor1a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor1a.cur -------------------------------------------------------------------------------- /win/rc/cursor1c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor1c.cur -------------------------------------------------------------------------------- /win/rc/cursor1e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor1e.cur -------------------------------------------------------------------------------- /win/rc/cursor20.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor20.cur -------------------------------------------------------------------------------- /win/rc/cursor22.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor22.cur -------------------------------------------------------------------------------- /win/rc/cursor24.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor24.cur -------------------------------------------------------------------------------- /win/rc/cursor26.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor26.cur -------------------------------------------------------------------------------- /win/rc/cursor28.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor28.cur -------------------------------------------------------------------------------- /win/rc/cursor2a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor2a.cur -------------------------------------------------------------------------------- /win/rc/cursor2c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor2c.cur -------------------------------------------------------------------------------- /win/rc/cursor2e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor2e.cur -------------------------------------------------------------------------------- /win/rc/cursor30.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor30.cur -------------------------------------------------------------------------------- /win/rc/cursor32.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor32.cur -------------------------------------------------------------------------------- /win/rc/cursor34.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor34.cur -------------------------------------------------------------------------------- /win/rc/cursor36.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor36.cur -------------------------------------------------------------------------------- /win/rc/cursor38.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor38.cur -------------------------------------------------------------------------------- /win/rc/cursor3a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor3a.cur -------------------------------------------------------------------------------- /win/rc/cursor3c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor3c.cur -------------------------------------------------------------------------------- /win/rc/cursor3e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor3e.cur -------------------------------------------------------------------------------- /win/rc/cursor40.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor40.cur -------------------------------------------------------------------------------- /win/rc/cursor42.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor42.cur -------------------------------------------------------------------------------- /win/rc/cursor44.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor44.cur -------------------------------------------------------------------------------- /win/rc/cursor46.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor46.cur -------------------------------------------------------------------------------- /win/rc/cursor48.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor48.cur -------------------------------------------------------------------------------- /win/rc/cursor4a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor4a.cur -------------------------------------------------------------------------------- /win/rc/cursor4c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor4c.cur -------------------------------------------------------------------------------- /win/rc/cursor4e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor4e.cur -------------------------------------------------------------------------------- /win/rc/cursor50.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor50.cur -------------------------------------------------------------------------------- /win/rc/cursor52.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor52.cur -------------------------------------------------------------------------------- /win/rc/cursor54.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor54.cur -------------------------------------------------------------------------------- /win/rc/cursor56.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor56.cur -------------------------------------------------------------------------------- /win/rc/cursor58.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor58.cur -------------------------------------------------------------------------------- /win/rc/cursor5a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor5a.cur -------------------------------------------------------------------------------- /win/rc/cursor5c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor5c.cur -------------------------------------------------------------------------------- /win/rc/cursor5e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor5e.cur -------------------------------------------------------------------------------- /win/rc/cursor60.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor60.cur -------------------------------------------------------------------------------- /win/rc/cursor62.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor62.cur -------------------------------------------------------------------------------- /win/rc/cursor64.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor64.cur -------------------------------------------------------------------------------- /win/rc/cursor66.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor66.cur -------------------------------------------------------------------------------- /win/rc/cursor68.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor68.cur -------------------------------------------------------------------------------- /win/rc/cursor6a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor6a.cur -------------------------------------------------------------------------------- /win/rc/cursor6c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor6c.cur -------------------------------------------------------------------------------- /win/rc/cursor6e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor6e.cur -------------------------------------------------------------------------------- /win/rc/cursor70.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor70.cur -------------------------------------------------------------------------------- /win/rc/cursor72.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor72.cur -------------------------------------------------------------------------------- /win/rc/cursor74.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor74.cur -------------------------------------------------------------------------------- /win/rc/cursor76.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor76.cur -------------------------------------------------------------------------------- /win/rc/cursor78.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor78.cur -------------------------------------------------------------------------------- /win/rc/cursor7a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor7a.cur -------------------------------------------------------------------------------- /win/rc/cursor7c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor7c.cur -------------------------------------------------------------------------------- /win/rc/cursor7e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor7e.cur -------------------------------------------------------------------------------- /win/rc/cursor80.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor80.cur -------------------------------------------------------------------------------- /win/rc/cursor82.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor82.cur -------------------------------------------------------------------------------- /win/rc/cursor84.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor84.cur -------------------------------------------------------------------------------- /win/rc/cursor86.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor86.cur -------------------------------------------------------------------------------- /win/rc/cursor88.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor88.cur -------------------------------------------------------------------------------- /win/rc/cursor8a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor8a.cur -------------------------------------------------------------------------------- /win/rc/cursor8c.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor8c.cur -------------------------------------------------------------------------------- /win/rc/cursor8e.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor8e.cur -------------------------------------------------------------------------------- /win/rc/cursor90.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor90.cur -------------------------------------------------------------------------------- /win/rc/cursor92.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor92.cur -------------------------------------------------------------------------------- /win/rc/cursor94.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor94.cur -------------------------------------------------------------------------------- /win/rc/cursor96.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor96.cur -------------------------------------------------------------------------------- /win/rc/cursor98.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor98.cur -------------------------------------------------------------------------------- /win/rc/cursor9a.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/rc/cursor9a.cur -------------------------------------------------------------------------------- /tests/pwrdLogo150.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/pwrdLogo150.gif -------------------------------------------------------------------------------- /tests/corruptMangled.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/corruptMangled.gif -------------------------------------------------------------------------------- /.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /library/images/logo100.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/logo100.gif -------------------------------------------------------------------------------- /library/images/logo64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/logo64.gif -------------------------------------------------------------------------------- /library/images/logoMed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/logoMed.gif -------------------------------------------------------------------------------- /library/images/tai-ku.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/tai-ku.gif -------------------------------------------------------------------------------- /library/msgs/en_gb.msg: -------------------------------------------------------------------------------- 1 | namespace eval ::tk { 2 | ::msgcat::mcset en_gb Color Colour 3 | } 4 | -------------------------------------------------------------------------------- /tests/corruptMangled4G.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/corruptMangled4G.gif -------------------------------------------------------------------------------- /tests/corruptTruncated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/corruptTruncated.gif -------------------------------------------------------------------------------- /tests/deferredClearCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/deferredClearCode.gif -------------------------------------------------------------------------------- /tests/teapotTransparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/tests/teapotTransparent.png -------------------------------------------------------------------------------- /library/images/logoLarge.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/logoLarge.gif -------------------------------------------------------------------------------- /library/images/pwrdLogo75.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/pwrdLogo75.gif -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /library/demos/images/earth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/earth.gif -------------------------------------------------------------------------------- /library/demos/images/ouster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/ouster.png -------------------------------------------------------------------------------- /library/demos/images/tcllogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/tcllogo.gif -------------------------------------------------------------------------------- /library/demos/images/teapot.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/teapot.ppm -------------------------------------------------------------------------------- /library/images/pwrdLogo100.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/pwrdLogo100.gif -------------------------------------------------------------------------------- /library/images/pwrdLogo150.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/pwrdLogo150.gif -------------------------------------------------------------------------------- /library/images/pwrdLogo175.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/pwrdLogo175.gif -------------------------------------------------------------------------------- /library/images/pwrdLogo200.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/images/pwrdLogo200.gif -------------------------------------------------------------------------------- /library/demos/images/earthmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/earthmenu.png -------------------------------------------------------------------------------- /library/demos/images/earthris.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/earthris.gif -------------------------------------------------------------------------------- /library/demos/images/Tk_feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/Tk_feather.png -------------------------------------------------------------------------------- /library/demos/images/plowed_field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/plowed_field.png -------------------------------------------------------------------------------- /library/demos/images/starry_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/library/demos/images/starry_night.png -------------------------------------------------------------------------------- /win/x86_64-w64-mingw32-nmakehlp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcltk/tk/main/win/x86_64-w64-mingw32-nmakehlp.exe -------------------------------------------------------------------------------- /.fossil-settings/encoding-glob: -------------------------------------------------------------------------------- 1 | win/buildall.vc.bat 2 | win/makefile.vc 3 | win/rules-ext.vc 4 | win/rules.vc 5 | win/targets.vc 6 | win/rc/*.bmp 7 | win/rc/*.cur 8 | win/rc/*.ico 9 | win/rc/*.rc 10 | -------------------------------------------------------------------------------- /generic/README: -------------------------------------------------------------------------------- 1 | This directory contains Tk source files that work on all the platforms 2 | where Tk runs (e.g. UNIX, PCs, and MacOSX). Platform-specific 3 | sources are in the directories ../unix, ../win, and ../macosx. 4 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | README -- Tk test suite design document. 2 | 3 | This directory contains a set of validation tests for the Tk commands. 4 | Please see the tests/README file in the Tcl source distribution for 5 | information about the test suite. 6 | -------------------------------------------------------------------------------- /bitmaps/info.xbm: -------------------------------------------------------------------------------- 1 | #define info_width 8 2 | #define info_height 21 3 | static unsigned char info_bits[] = { 4 | 0x3c, 0x2a, 0x16, 0x2a, 0x14, 0x00, 0x00, 0x3f, 0x15, 0x2e, 0x14, 0x2c, 5 | 0x14, 0x2c, 0x14, 0x2c, 0x14, 0x2c, 0xd7, 0xab, 0x55}; 6 | -------------------------------------------------------------------------------- /bitmaps/warning.xbm: -------------------------------------------------------------------------------- 1 | #define warning_width 6 2 | #define warning_height 19 3 | static unsigned char warning_bits[] = { 4 | 0x0c, 0x16, 0x2b, 0x15, 0x2b, 0x15, 0x2b, 0x16, 0x0a, 0x16, 0x0a, 0x16, 5 | 0x0a, 0x00, 0x00, 0x1e, 0x0a, 0x16, 0x0a}; 6 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | tk9.1 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Important Note 2 | ========== 3 | Please do not file issues with Tk on Github. They are unlikely to be noticed in a timely fashion. Tk issues are hosted in the [tk fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tk/tktnew); please post them there. 4 | -------------------------------------------------------------------------------- /library/demos/images/pattern.xbm: -------------------------------------------------------------------------------- 1 | #define foo_width 16 2 | #define foo_height 16 3 | static char foo_bits[] = { 4 | 0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92, 5 | 0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72, 6 | 0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06}; 7 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Important Note 2 | ========== 3 | Please do not file pull requests with Tk on Github. They are unlikely to be noticed in a timely fashion. Tk issues (including patches) are hosted in the [tk fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tk/tktnew); please post them there. 4 | -------------------------------------------------------------------------------- /bitmaps/gray12.xbm: -------------------------------------------------------------------------------- 1 | #define gray12_width 16 2 | #define gray12_height 16 3 | static unsigned char gray12_bits[] = { 4 | 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 5 | 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 6 | 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88}; 7 | -------------------------------------------------------------------------------- /bitmaps/gray25.xbm: -------------------------------------------------------------------------------- 1 | #define gray25_width 16 2 | #define gray25_height 16 3 | static unsigned char gray25_bits[] = { 4 | 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 5 | 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 6 | 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22}; 7 | -------------------------------------------------------------------------------- /bitmaps/gray50.xbm: -------------------------------------------------------------------------------- 1 | #define gray50_width 16 2 | #define gray50_height 16 3 | static unsigned char gray50_bits[] = { 4 | 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 5 | 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 6 | 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa}; 7 | -------------------------------------------------------------------------------- /bitmaps/gray75.xbm: -------------------------------------------------------------------------------- 1 | #define gray75_width 16 2 | #define gray75_height 16 3 | static unsigned char gray75_bits[] = { 4 | 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 5 | 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 6 | 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd}; 7 | -------------------------------------------------------------------------------- /library/demos/images/gray25.xbm: -------------------------------------------------------------------------------- 1 | #define grey_width 16 2 | #define grey_height 16 3 | static char grey_bits[] = { 4 | 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 5 | 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 6 | 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; 7 | -------------------------------------------------------------------------------- /library/images/README: -------------------------------------------------------------------------------- 1 | README - images directory 2 | 3 | This directory includes images for the Tcl Logo and the Tcl Powered 4 | Logo. Please feel free to use the Tcl Powered Logo on any of your 5 | products that employ the use of Tcl or Tk. The Tcl logo may also be 6 | used to promote Tcl in your product documentation, web site or other 7 | places you so desire. 8 | -------------------------------------------------------------------------------- /bitmaps/error.xbm: -------------------------------------------------------------------------------- 1 | #define error_width 17 2 | #define error_height 17 3 | static unsigned char error_bits[] = { 4 | 0xf0, 0x0f, 0x00, 0x58, 0x15, 0x00, 0xac, 0x2a, 0x00, 0x16, 0x50, 0x00, 5 | 0x2b, 0xa0, 0x00, 0x55, 0x40, 0x01, 0xa3, 0xc0, 0x00, 0x45, 0x41, 0x01, 6 | 0x83, 0xc2, 0x00, 0x05, 0x45, 0x01, 0x03, 0xca, 0x00, 0x05, 0x74, 0x01, 7 | 0x0a, 0xa8, 0x00, 0x14, 0x58, 0x00, 0xe8, 0x2f, 0x00, 0x50, 0x15, 0x00, 8 | 0xa0, 0x0a, 0x00}; 9 | -------------------------------------------------------------------------------- /tests/option.file1: -------------------------------------------------------------------------------- 1 | ! This file is a sample option (resource) database used to test 2 | ! Tk's option-handling capabilities. 3 | 4 | ! Comment line \ 5 | with a backslash-newline sequence embedded in it. 6 | 7 | *x1: blue 8 | tktest.x2 : green 9 | *\ 10 | x3 \ 11 | : pur\ 12 | ple 13 | *x 4: brown 14 | # More comments, this time delimited by hash-marks. 15 | # Comment-line with space. 16 | *x6: 17 | *x9: \ \ \\\101\n 18 | # comment line as last line of file. 19 | -------------------------------------------------------------------------------- /tests/option.file3: -------------------------------------------------------------------------------- 1 | ! This file is a sample option (resource) database used to test 2 | ! Tk's option-handling capabilities. 3 | 4 | ! Comment line \ 5 | with a backslash-newline sequence embedded in it. 6 | 7 | *x1: blue 8 | tktest.x2 : green 9 | *\ 10 | x3 \ 11 | : pur\ 12 | ple 13 | *x 4: brówn 14 | # More comments, this time delimited by hash-marks. 15 | # Comment-line with space. 16 | *x6: 17 | *x9: \ \ \\\101\n 18 | # comment line as last line of file. 19 | -------------------------------------------------------------------------------- /macosx/configure.ac: -------------------------------------------------------------------------------- 1 | #! /bin/bash -norc 2 | dnl This file is an input file used by the GNU "autoconf" program to 3 | dnl generate the file "configure", which is run during Tk installation 4 | dnl to configure the system for the local environment. 5 | 6 | dnl Ensure that the config (auto)headers support is used, then just 7 | dnl include the configure sources from ../unix: 8 | 9 | m4_include(../unix/aclocal.m4) 10 | m4_define(SC_USE_CONFIG_HEADERS) 11 | m4_include(../unix/configure.ac) 12 | -------------------------------------------------------------------------------- /bitmaps/hourglass.xbm: -------------------------------------------------------------------------------- 1 | #define hourglass_width 19 2 | #define hourglass_height 21 3 | static unsigned char hourglass_bits[] = { 4 | 0xff, 0xff, 0x07, 0x55, 0x55, 0x05, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 5 | 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xc2, 0x0a, 0x03, 0x46, 0x05, 0x01, 6 | 0x82, 0x0a, 0x03, 0x06, 0x05, 0x01, 0x02, 0x03, 0x03, 0x86, 0x05, 0x01, 7 | 0xc2, 0x0a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 8 | 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0xff, 0xff, 0x07, 9 | 0xab, 0xaa, 0x02}; 10 | -------------------------------------------------------------------------------- /bitmaps/questhead.xbm: -------------------------------------------------------------------------------- 1 | #define questhead_width 20 2 | #define questhead_height 22 3 | static unsigned char questhead_bits[] = { 4 | 0xf8, 0x1f, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 0xeb, 0xaf, 0x00, 5 | 0xf5, 0x5f, 0x01, 0xfb, 0xbf, 0x00, 0x75, 0x5d, 0x01, 0xfb, 0xbe, 0x02, 6 | 0x75, 0x5d, 0x05, 0xab, 0xbe, 0x0a, 0x55, 0x5f, 0x07, 0xab, 0xaf, 0x00, 7 | 0xd6, 0x57, 0x01, 0xac, 0xab, 0x00, 0xd8, 0x57, 0x00, 0xb0, 0xaa, 0x00, 8 | 0x50, 0x55, 0x00, 0xb0, 0x0b, 0x00, 0xd0, 0x17, 0x00, 0xb0, 0x0b, 0x00, 9 | 0x58, 0x15, 0x00, 0xa8, 0x2a, 0x00}; 10 | -------------------------------------------------------------------------------- /unix/tk.pc.in: -------------------------------------------------------------------------------- 1 | # tk pkg-config source file 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | demodir=@TK_DEMO_DIR@ 8 | 9 | Name: The Tk Toolkit 10 | Description: Tk is a cross-platform graphical user interface toolkit, the standard GUI not only for Tcl, but for many other dynamic languages as well. 11 | URL: https://www.tcl-lang.org/ 12 | Version: @TK_VERSION@@TK_PATCH_LEVEL@ 13 | Requires: tcl >= 8.6 14 | Libs: -L${libdir} @TK_LIB_FLAG@ @TK_STUB_LIB_FLAG@ 15 | Libs.private: @XFT_LIBS@ @XLIBSW@ 16 | Cflags: -I${includedir} 17 | -------------------------------------------------------------------------------- /.fossil-settings/ignore-glob: -------------------------------------------------------------------------------- 1 | *.a 2 | *.dll 3 | *.dylib 4 | *.dylib.E 5 | *.exe 6 | *.exp 7 | *.la 8 | *.lib 9 | *.lo 10 | *.o 11 | *.obj 12 | *.pdb 13 | *.res 14 | *.sl 15 | *.so 16 | */Makefile 17 | */autom4te.cache 18 | */config.cache 19 | */config.log 20 | */config.status 21 | */tkConfig.sh 22 | */wish* 23 | */tktest 24 | */versions.vc 25 | */version.vc 26 | */libtk.vfs 27 | */libtk*.zip 28 | */tkUuid.h 29 | html 30 | macosx/configure 31 | win/Debug* 32 | win/Release* 33 | win/*.manifest 34 | win/nmhlp-out.txt 35 | win/nmakehlp.out 36 | unix/tk.pc 37 | unix/Tk-Info.plist 38 | unix/Wish-Info.plist 39 | unix/Credits.html 40 | -------------------------------------------------------------------------------- /library/demos/hello: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # the next line restarts using wish \ 3 | exec wish "$0" ${1+"$@"} 4 | 5 | # hello -- 6 | # Simple Tk script to create a button that prints "Hello, world". 7 | # Click on the button to terminate the program. 8 | 9 | package require tk 10 | 11 | # The first line below creates the button, and the second line 12 | # asks the packer to shrink-wrap the application's main window 13 | # around the button. 14 | 15 | button .hello -text "Hello, world" -command { 16 | puts stdout "Hello, world"; destroy . 17 | } 18 | pack .hello 19 | 20 | # Local Variables: 21 | # mode: tcl 22 | # End: 23 | -------------------------------------------------------------------------------- /doc/GetHINSTANCE.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1998-2000 Scriptics Corporation. 3 | '\" All rights reserved. 4 | '\" 5 | .TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures" 6 | .so man.macros 7 | .BS 8 | .SH NAME 9 | Tk_GetHINSTANCE \- retrieve the global application instance handle 10 | .SH SYNOPSIS 11 | .nf 12 | \fB#include \fR 13 | .sp 14 | HINSTANCE 15 | \fBTk_GetHINSTANCE\fR() 16 | .fi 17 | .BE 18 | .SH DESCRIPTION 19 | .PP 20 | \fBTk_GetHINSTANCE\fR returns the Windows application instance handle 21 | for the Tk application. This function is only available on Windows platforms. 22 | .SH KEYWORDS 23 | identifier, instance 24 | -------------------------------------------------------------------------------- /bitmaps/question.xbm: -------------------------------------------------------------------------------- 1 | #define question_width 17 2 | #define question_height 27 3 | static unsigned char question_bits[] = { 4 | 0xf0, 0x0f, 0x00, 0x58, 0x15, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 5 | 0x2b, 0xa8, 0x00, 0x15, 0x50, 0x01, 0x0b, 0xa0, 0x00, 0x05, 0x60, 0x01, 6 | 0x0b, 0xa0, 0x00, 0x05, 0x60, 0x01, 0x0b, 0xb0, 0x00, 0x00, 0x58, 0x01, 7 | 0x00, 0xaf, 0x00, 0x80, 0x55, 0x00, 0xc0, 0x2a, 0x00, 0x40, 0x15, 0x00, 8 | 0xc0, 0x02, 0x00, 0x40, 0x01, 0x00, 0xc0, 0x02, 0x00, 0x40, 0x01, 0x00, 9 | 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xc0, 0x02, 0x00, 10 | 0x40, 0x01, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x01, 0x00}; 11 | -------------------------------------------------------------------------------- /generic/default.h: -------------------------------------------------------------------------------- 1 | /* 2 | * default.h -- 3 | * 4 | * This file defines the defaults for all options for all of 5 | * the Tk widgets. 6 | * 7 | * Copyright © 1991-1994 The Regents of the University of California. 8 | * Copyright © 1994 Sun Microsystems, Inc. 9 | * 10 | * See the file "license.terms" for information on usage and redistribution 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #ifndef _DEFAULT 15 | #define _DEFAULT 16 | 17 | #ifdef _WIN32 18 | # include "tkWinDefault.h" 19 | #else 20 | # if defined(MAC_OSX_TK) 21 | # include "tkMacOSXDefault.h" 22 | # else 23 | # include "tkUnixDefault.h" 24 | # endif 25 | #endif 26 | 27 | #endif /* _DEFAULT */ 28 | -------------------------------------------------------------------------------- /macosx/tkMacOSXImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkMacOSXImage.h -- 3 | * 4 | * 5 | * The code in this file provides an interface for XImages, and 6 | * implements the nsimage image type. 7 | * 8 | * Copyright © 1995-1997 Sun Microsystems, Inc. 9 | * Copyright © 2001-2009 Apple Inc. 10 | * Copyright © 2005-2009 Daniel A. Steffen 11 | * Copyright © 2017-2021 Marc Culler. 12 | * 13 | * See the file "license.terms" for information on usage and redistribution 14 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 15 | */ 16 | 17 | /* 18 | * Function prototypes 19 | */ 20 | 21 | MODULE_SCOPE CFDataRef CreatePDFFromDrawableRect( Drawable drawable, 22 | int x, int y, unsigned int width, unsigned int height); 23 | -------------------------------------------------------------------------------- /doc/HWNDToWindow.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1998-2000 Scriptics Corporation. 3 | '\" All rights reserved. 4 | '\" 5 | .TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" 6 | .so man.macros 7 | .BS 8 | .SH NAME 9 | Tk_HWNDToWindow \- Find Tk's window information for a Windows window 10 | .SH SYNOPSIS 11 | .nf 12 | \fB#include \fR 13 | .sp 14 | Tk_Window 15 | \fBTk_HWNDToWindow\fR(\fIhwnd\fR) 16 | .fi 17 | .SH ARGUMENTS 18 | .AP HWND hwnd in 19 | Windows handle for the window. 20 | .BE 21 | .SH DESCRIPTION 22 | .PP 23 | Given a Windows HWND window identifier, this procedure returns the 24 | corresponding Tk_Window handle. If there is no Tk_Window corresponding 25 | to \fIhwnd\fR then NULL is returned. 26 | .SH KEYWORDS 27 | Windows window id 28 | -------------------------------------------------------------------------------- /generic/tkPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkPort.h -- 3 | * 4 | * This header file handles porting issues that occur because of 5 | * differences between systems. It reads in platform specific 6 | * portability files. 7 | * 8 | * Copyright © 1995 Sun Microsystems, Inc. 9 | * 10 | * See the file "license.terms" for information on usage and redistribution 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #ifndef _TKPORT 15 | #define _TKPORT 16 | 17 | #if defined(_WIN32) 18 | # include "tkWinPort.h" 19 | #endif 20 | #ifndef _TK 21 | # include "tk.h" 22 | #endif 23 | #if !defined(_WIN32) 24 | # if defined(MAC_OSX_TK) 25 | # include "tkMacOSXPort.h" 26 | # else 27 | # include "tkUnixPort.h" 28 | # endif 29 | #endif 30 | 31 | #endif /* _TKPORT */ 32 | -------------------------------------------------------------------------------- /macosx/Credits.html.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

7 | Tcl and Tk are distributed under a modified BSD license:
8 | 9 | https://www.tcl-lang.org/software/tcltk/license.html 10 | 11 |

12 |
    13 |
  • © 1987-@TK_YEAR@ Tcl Core Team and Contributers.
  • 14 |
  • © 2011-@TK_YEAR@ Kevin Walzer.
  • 15 |
  • © 2014-@TK_YEAR@ Marc Culler.
  • 16 |
  • © 2002-2012 Daniel A. Steffen.
  • 17 |
  • © 2001-2009 Apple Inc.
  • 18 |
  • © 2001-2002 Jim Ingham & Ian Reid.
  • 19 |
  • © 1998-2000 Jim Ingham & Ray Johnson.
  • 20 |
  • © 1998-2000 Scriptics Inc.
  • 21 |
  • © 1996-1997 Sun Microsystems Inc.
  • 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /library/demos/dialog2.tcl: -------------------------------------------------------------------------------- 1 | # dialog2.tcl -- 2 | # 3 | # This demonstration script creates a dialog box with a global grab. 4 | 5 | after idle { 6 | .dialog2.msg configure -wraplength 4i 7 | } 8 | after 100 { 9 | grab -global .dialog2 10 | } 11 | set i [tk_dialog .dialog2 "Dialog with global grab" {This dialog box uses a global grab. If you are using an X11 window manager you will be prevented from interacting with anything on your display until you invoke one of the buttons below. This is almost always a bad idea; don't use global grabs with X11 unless you're truly desperate. On macOS systems you will not be able to interact with any window belonging to this process, but interaction with other macOS Applications will still be possible.}\ 12 | warning 0 OK Cancel {Show Code}] 13 | 14 | switch $i { 15 | 0 {puts "You pressed OK"} 16 | 1 {puts "You pressed Cancel"} 17 | 2 {showCode .dialog2} 18 | } 19 | -------------------------------------------------------------------------------- /doc/NameOfImg.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_NameOfImage \- Return name of image. 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | const char * 17 | \fBTk_NameOfImage\fR(\fIimageModel\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_ImageModel imageModel 21 | .AP Tk_ImageModel imageModel in 22 | Token for image, which was passed to image manager's \fIcreateProc\fR when 23 | the image was created. 24 | .BE 25 | .SH DESCRIPTION 26 | .PP 27 | This procedure is invoked by image managers to find out the name 28 | of an image. Given the token for the image, it returns the 29 | string name for the image. 30 | .SH KEYWORDS 31 | image manager, image name 32 | -------------------------------------------------------------------------------- /macosx/tkMacOSXFont.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkMacOSXFont.h -- 3 | * 4 | * Contains the Macintosh implementation of the platform-independent 5 | * font package interface. 6 | * 7 | * Copyright © 1990-1994 The Regents of the University of California. 8 | * Copyright © 1994-1997 Sun Microsystems, Inc. 9 | * Copyright © 2001-2009 Apple Inc. 10 | * Copyright © 2006-2009 Daniel A. Steffen 11 | * 12 | * See the file "license.terms" for information on usage and redistribution 13 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 | */ 15 | 16 | #ifndef TKMACOSXFONT_H 17 | #define TKMACOSXFONT_H 1 18 | 19 | #include "tkFont.h" 20 | 21 | #ifndef _TKMACINT 22 | #include "tkMacOSXInt.h" 23 | #endif 24 | 25 | /* 26 | * Function prototypes 27 | */ 28 | 29 | MODULE_SCOPE Tcl_Obj * TkMacOSXFontDescriptionForNSFontAndNSFontAttributes( 30 | NSFont *nsFont, NSDictionary *nsAttributes); 31 | 32 | #endif /*TKMACOSXFONT_H*/ 33 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * eol=lf 3 | * text=auto 4 | 5 | # Explicitly declare text files you want to always be normalized and converted 6 | # to native line endings on checkout. 7 | *.3 text 8 | *.c text 9 | *.css text 10 | *.enc text 11 | *.h text 12 | *.htm text 13 | *.html text 14 | *.java text 15 | *.js text 16 | *.json text 17 | *.n text 18 | *.svg text 19 | *.ts text 20 | *.tcl text 21 | *.test text 22 | 23 | # Declare files that will always have CRLF line endings on checkout. 24 | *.bat eol=crlf 25 | *.rc eol=crlf 26 | *.sln eol=crlf 27 | *.vc eol=crlf 28 | 29 | # Denote all files that are truly binary and should not be modified. 30 | *.a binary 31 | *.bmp binary 32 | *.cur binary 33 | *.dll binary 34 | *.exe binary 35 | *.gif binary 36 | *.gz binary 37 | *.ico binary 38 | *.jpg binary 39 | *.lib binary 40 | *.pdf binary 41 | *.png binary 42 | *.xlsx binary 43 | *.zip binary 44 | -------------------------------------------------------------------------------- /doc/IdToWindow.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_IdToWindow \- Find Tk's window information for an X window 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | Tk_Window 17 | \fBTk_IdToWindow\fR(\fIdisplay, window\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_Window display 21 | .AP Display *display in 22 | X display containing the window. 23 | .AP Window window in 24 | X id for window. 25 | .BE 26 | .SH DESCRIPTION 27 | .PP 28 | Given an X window identifier and the X display it corresponds to, 29 | this procedure returns the corresponding Tk_Window handle. 30 | If there is no Tk_Window corresponding to \fIwindow\fR then 31 | NULL is returned. 32 | .SH KEYWORDS 33 | X window id 34 | -------------------------------------------------------------------------------- /doc/DeleteImg.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_DeleteImage \- Destroy an image. 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | \fBTk_DeleteImage\fR(\fIinterp, name\fR) 17 | .fi 18 | .SH ARGUMENTS 19 | .AS Tcl_Interp *interp 20 | .AP Tcl_Interp *interp in 21 | Interpreter for which the image was created. 22 | .AP "const char" *name in 23 | Name of the image. 24 | .BE 25 | .SH DESCRIPTION 26 | .PP 27 | \fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR 28 | and \fIname\fR, if there is one. All instances of that image 29 | will redisplay as empty regions. If the given image does not 30 | exist then the procedure has no effect. 31 | .SH KEYWORDS 32 | delete image, image manager 33 | -------------------------------------------------------------------------------- /win/README: -------------------------------------------------------------------------------- 1 | Tk 9.1 for Windows 2 | 3 | Originally by Scott Stanton while at Sun Microsystems Labs 4 | 5 | This is the directory where you configure and compile the Windows 6 | version of Tk. This directory also contains source files for Tk 7 | that are specific to Microsoft Windows. The rest of this file 8 | contains information specific to the Windows version of Tk. 9 | 10 | Please see the README and win/README files that come with the 11 | associated Tcl release for an extensive set of pointers to 12 | documentation. You will need to obtain and compile the 13 | Tcl release before using the Tk source distrition. 14 | 15 | If you install the Tk sources next to the Tcl sources, then 16 | the Tk Makefiles (e.g., makefile.vc for VC++) will properly 17 | locate the necessary Tcl files. Otherwise you may need to 18 | edit makefile.vc and adjust the path to Tcl accordingly. 19 | 20 | Information about compiling for windows is maintained at: 21 | https://www.tcl-lang.org/doc/howto/compile.html 22 | -------------------------------------------------------------------------------- /doc/GetHWND.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1998-2000 Scriptics Corporation. 3 | '\" All rights reserved. 4 | '\" 5 | .TH HWND 3 8.0 Tk "Tk Library Procedures" 6 | .so man.macros 7 | .BS 8 | .SH NAME 9 | Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window 10 | .SH SYNOPSIS 11 | .nf 12 | \fB#include \fR 13 | .sp 14 | HWND 15 | \fBTk_GetHWND\fR(\fIwindow\fR) 16 | .sp 17 | Window 18 | \fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AP Window window in 22 | X token for window. 23 | .AP Tk_Window tkwin in 24 | Tk window for window. 25 | .AP HWND hwnd in 26 | Windows HWND for window. 27 | .BE 28 | .SH DESCRIPTION 29 | .PP 30 | \fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows 31 | window given by \fIwindow\fR. 32 | .PP 33 | \fBTk_AttachHWND\fR binds the Windows HWND identifier to the 34 | specified Tk_Window given by \fItkwin\fR. It returns an X Windows 35 | window that encapsulates the HWND. 36 | .SH KEYWORDS 37 | identifier, window 38 | -------------------------------------------------------------------------------- /doc/MainLoop.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1992 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_MainLoop \- loop for events until all windows are deleted 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_MainLoop\fR() 18 | .fi 19 | .BE 20 | .SH DESCRIPTION 21 | .PP 22 | \fBTk_MainLoop\fR is a procedure that loops repeatedly calling 23 | \fBTcl_DoOneEvent\fR. It returns only when there are no applications 24 | left in this process (i.e. no main windows exist anymore). Most 25 | windowing applications will call \fBTk_MainLoop\fR after 26 | initialization; the main execution of the application will consist 27 | entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. 28 | .SH KEYWORDS 29 | application, event, main loop 30 | -------------------------------------------------------------------------------- /library/demos/dialog1.tcl: -------------------------------------------------------------------------------- 1 | # dialog1.tcl -- 2 | # 3 | # This demonstration script creates a dialog box with a local grab. 4 | 5 | interp create child 6 | load {} Tk child 7 | child eval { 8 | wm title . child 9 | wm geometry . +700+30 10 | pack [text .t -width 30 -height 10] 11 | } 12 | 13 | after idle {.dialog1.msg configure -wraplength 4i} 14 | set i [tk_dialog .dialog1 "Dialog with local grab" {This is a modal dialog box. It uses Tk's "grab" command to create a "local grab" on the dialog box. The grab prevents any mouse or keyboard events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications. For example, you should be able to edit text in the window named "child" which was created by a child interpreter.} \ 15 | info 0 OK Cancel {Show Code}] 16 | 17 | switch $i { 18 | 0 {puts "You pressed OK"} 19 | 1 {puts "You pressed Cancel"} 20 | 2 {showCode .dialog1} 21 | } 22 | 23 | if {[interp exists child]} { 24 | interp delete child 25 | } 26 | -------------------------------------------------------------------------------- /macosx/tkMacOSXDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkMacOSXDebug.h -- 3 | * 4 | * Declarations of Macintosh specific functions for debugging MacOS events, 5 | * regions, etc... 6 | * 7 | * Copyright © 2001-2009 Apple Inc. 8 | * Copyright © 2005-2009 Daniel A. Steffen 9 | * 10 | * See the file "license.terms" for information on usage and redistribution 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #ifndef _TKMACDEBUG 15 | #define _TKMACDEBUG 16 | 17 | #ifndef _TKMACINT 18 | #include "tkMacOSXInt.h" 19 | #endif 20 | 21 | #ifdef TK_MAC_DEBUG 22 | 23 | MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol); 24 | 25 | /* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */ 26 | #define TkMacOSXInitNamedDebugSymbol(module, ret, symbol, ...) \ 27 | static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \ 28 | if (symbol == (void*)(-1L)) { \ 29 | symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\ 30 | } 31 | 32 | #endif /* TK_MAC_DEBUG */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.bundle 3 | *.dll 4 | *.dylib 5 | *.dylib.E 6 | *.exe 7 | *.exp 8 | *.lib 9 | *.o 10 | *.obj 11 | *.pdb 12 | *.res 13 | *.sl 14 | *.so 15 | .fslckout 16 | Makefile 17 | Tk-Info.plist 18 | Wish-Info.plist 19 | Credits.html 20 | autom4te.cache 21 | config.cache 22 | config.log 23 | config.status 24 | config.status.lineno 25 | html 26 | manifest.uuid 27 | _FOSSIL_ 28 | */tkConfig.sh 29 | */wish* 30 | */tktest 31 | */versions.vc 32 | */version.vc 33 | */libtk.vfs 34 | */libtk*.zip 35 | */tkUuid.h 36 | libtommath/bn.ilg 37 | libtommath/bn.ind 38 | libtommath/pretty.build 39 | libtommath/tommath.src 40 | libtommath/*.log 41 | libtommath/*.pdf 42 | libtommath/*.pl 43 | libtommath/*.sh 44 | libtommath/doc/* 45 | libtommath/tombc/* 46 | libtommath/pre_gen/* 47 | libtommath/pics/* 48 | libtommath/mtest/* 49 | libtommath/logs/* 50 | libtommath/etc/* 51 | libtommath/demo/* 52 | libtommath/*.out 53 | libtommath/*.tex 54 | macosx/configure 55 | unix/autoMkindex.tcl 56 | unix/dltest.marker 57 | unix/tk.pc 58 | unix/tclIndex 59 | win/Debug* 60 | win/Release* 61 | win/*.manifest 62 | win/nmakehlp.out 63 | win/nmhlp-out.txt 64 | -------------------------------------------------------------------------------- /unix/tkUnixInt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkUnixInt.h -- 3 | * 4 | * This file contains declarations that are shared among the 5 | * UNIX-specific parts of Tk but aren't used by the rest of Tk. 6 | * 7 | * Copyright © 1995-1997 Sun Microsystems, Inc. 8 | * 9 | * See the file "license.terms" for information on usage and redistribution of 10 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 11 | */ 12 | 13 | #ifndef _TKUNIXINT 14 | #define _TKUNIXINT 15 | 16 | #ifndef _TKINT 17 | #include "tkInt.h" 18 | #endif 19 | 20 | /* 21 | * Prototypes for procedures that are referenced in files other than the ones 22 | * they're defined in. 23 | */ 24 | 25 | #include "tkIntPlatDecls.h" /* IWYU pragma: export */ 26 | 27 | MODULE_SCOPE int Tktray_Init (Tcl_Interp* interp); 28 | MODULE_SCOPE int SysNotify_Init (Tcl_Interp* interp); 29 | MODULE_SCOPE int Cups_Init (Tcl_Interp* interp); 30 | MODULE_SCOPE int TkAtkAccessibility_Init (Tcl_Interp *interp) ; 31 | 32 | #endif /* _TKUNIXINT */ 33 | 34 | 35 | /* 36 | * Local Variables: 37 | * mode: c 38 | * c-basic-offset: 4 39 | * fill-column: 78 40 | * End: 41 | */ 42 | -------------------------------------------------------------------------------- /doc/ttk_Theme.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 2003 Joe English 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Ttk_CreateTheme 3 8.5 Tk "Tk Themed Widget" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Ttk_CreateTheme, Ttk_GetTheme, Ttk_GetDefaultTheme, Ttk_GetCurrentTheme \- create and use Tk themes. 12 | .SH SYNOPSIS 13 | .nf 14 | Ttk_Theme Ttk_CreateTheme(\fIinterp\fR, \fIname\fR, \fIparentTheme\fR); 15 | Ttk_Theme Ttk_GetTheme(\fIinterp\fR, \fIname\fR); 16 | Ttk_Theme Ttk_GetDefaultTheme(\fIinterp\fR); 17 | Ttk_Theme Ttk_GetCurrentTheme(\fIinterp\fR); 18 | .fi 19 | .SH ARGUMENTS 20 | .AP "Tcl_Interp *" interp in 21 | The Tcl interpreter in which to register/query available themes. 22 | .AP "Ttk_Theme" parentTheme in 23 | Fallback or parent theme from which the new theme will 24 | inherit elements and layouts. 25 | .AP "const char *" name in 26 | The name of the theme. 27 | .BE 28 | .SH DESCRIPTION 29 | .\" TODO - Document these functions better! 30 | .SH "SEE ALSO" 31 | Ttk_RegisterLayout, Ttk_BuildLayout 32 | .\" .SH KEYWORDS 33 | -------------------------------------------------------------------------------- /doc/SetCaret.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 2002 ActiveState Corporation. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_SetCaretPos \- set the display caret location 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | int 17 | \fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AP Tk_Window tkwin in 21 | Token for window. 22 | .AP int x in 23 | Window-relative x coordinate. 24 | .AP int y in 25 | Window-relative y coordinate. 26 | .AP int h in 27 | Height of the caret in the window. 28 | .BE 29 | .SH DESCRIPTION 30 | .PP 31 | \fBTk_SetCaretPos\fR sets the caret location for the display of the 32 | specified Tk_Window \fItkwin\fR. The caret is the per-display cursor 33 | location used for indicating global focus (e.g. to comply with Microsoft 34 | Accessibility guidelines), as well as for location of the over-the-spot XIM 35 | (X Input Methods) or Windows IME windows. 36 | .SH KEYWORDS 37 | caret, cursor 38 | -------------------------------------------------------------------------------- /tests/obj.test: -------------------------------------------------------------------------------- 1 | # This file is a Tcl script to test new object types in Tk. 2 | # 3 | # Copyright © 1997 Sun Microsystems, Inc. 4 | # Copyright © 1998-1999 Scriptics Corporation. 5 | # All rights reserved. 6 | 7 | # 8 | # TESTFILE INITIALIZATION 9 | # 10 | 11 | package require tcltest 2.2; # needed in mode -singleproc 0 12 | 13 | # Load the main script main.tcl, which takes care of: 14 | # - setup for the application and the root window 15 | # - importing commands from the tcltest namespace 16 | # - loading of the testutils mechanism along with its utility procs 17 | # - loading of Tk specific test constraints (additionally to constraints 18 | # provided by the package tcltest) 19 | source [file join [tcltest::configure -testdir] main.tcl] 20 | 21 | # Ensure a pristine initial window state 22 | resetWindows 23 | 24 | # 25 | # TESTS 26 | # 27 | 28 | test obj-1.1 {TkGetPixelsFromObj} -body { 29 | } -result {} 30 | 31 | test obj-2.1 {FreePixelInternalRep} -body { 32 | } -result {} 33 | 34 | test obj-3.1 {DupPixelInternalRep} -body { 35 | } -result {} 36 | 37 | test obj-4.1 {SetPixelFromAny} -body { 38 | } -result {} 39 | 40 | # 41 | # TESTFILE CLEANUP 42 | # 43 | 44 | cleanupTests 45 | -------------------------------------------------------------------------------- /macosx/tkMacOSX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkMacOSX.h -- 3 | * 4 | * Declarations of Macintosh specific exported variables and procedures. 5 | * 6 | * Copyright © 1995-1997 Sun Microsystems, Inc. 7 | * Copyright © 2001-2009 Apple Inc. 8 | * Copyright © 2005-2009 Daniel A. Steffen 9 | * 10 | * See the file "license.terms" for information on usage and redistribution 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #ifndef _TKMAC 15 | #define _TKMAC 16 | 17 | #ifndef _TK 18 | #include "tk.h" 19 | #endif 20 | 21 | /* 22 | * Structures and function types for handling Netscape-type in process 23 | * embedding where Tk does not control the top-level 24 | */ 25 | 26 | typedef int (Tk_MacOSXEmbedRegisterWinProc) (long winID, Tk_Window window); 27 | typedef void* (Tk_MacOSXEmbedGetGrafPortProc) (Tk_Window window); 28 | typedef int (Tk_MacOSXEmbedMakeContainerExistProc) (Tk_Window window); 29 | typedef void (Tk_MacOSXEmbedGetClipProc) (Tk_Window window, void *rgn); 30 | typedef void (Tk_MacOSXEmbedGetOffsetInParentProc) (Tk_Window window, void *ulCorner); 31 | 32 | #include "tkPlatDecls.h" /* IWYU pragma: export */ 33 | 34 | #endif /* _TKMAC */ 35 | -------------------------------------------------------------------------------- /doc/Inactive.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1998-2000 Scriptics Corporation. 3 | '\" All rights reserved. 4 | '\" 5 | .TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures" 6 | .so man.macros 7 | .BS 8 | .SH NAME 9 | Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time 10 | .SH SYNOPSIS 11 | .nf 12 | \fB#include \fR 13 | .sp 14 | long 15 | \fBTk_GetUserInactiveTime\fR(\fIdisplay\fR) 16 | .sp 17 | \fBTk_ResetUserInactiveTime\fR(\fIdisplay\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Display *display 21 | .AP Display *display in 22 | The display on which the user inactivity timer is to be queried or 23 | reset. 24 | .BE 25 | .SH DESCRIPTION 26 | .PP 27 | \fBTk_GetUserInactiveTime\fR returns the number of milliseconds that 28 | have passed since the last user interaction (usually via keyboard or 29 | mouse) with the respective display. On systems and displays that do not 30 | support querying the user inactivity time, \fB\-1\fR is returned. 31 | \fBTk_ResetUserInactiveTime\fR resets the user inactivity timer of the 32 | given display to zero. On windowing systems that do not support 33 | multiple displays \fIdisplay\fR can be passed as \fBNULL\fR. 34 | .SH KEYWORDS 35 | idle, inactive 36 | -------------------------------------------------------------------------------- /library/demos/form.tcl: -------------------------------------------------------------------------------- 1 | # form.tcl -- 2 | # 3 | # This demonstration script creates a simple form with a bunch 4 | # of entry widgets. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .form 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Form Demonstration" 16 | wm iconname $w "form" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 4i -justify left -text "This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries." 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | set btns [addSeeDismiss $w.buttons $w] 24 | pack $btns -side bottom -fill x 25 | 26 | foreach i {f1 f2 f3 f4 f5} { 27 | frame $w.$i -bd 2 28 | entry $w.$i.entry -relief sunken -width 40 29 | label $w.$i.label 30 | pack $w.$i.entry -side right 31 | pack $w.$i.label -side left 32 | } 33 | $w.f1.label config -text Name: 34 | $w.f2.label config -text Address: 35 | $w.f5.label config -text Phone: 36 | pack $w.msg $w.f1 $w.f2 $w.f3 $w.f4 $w.f5 -side top -fill x 37 | bind $w "destroy $w" 38 | focus $w.f1.entry 39 | -------------------------------------------------------------------------------- /doc/DrawFocHlt.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | \fBTk_DrawFocusHighlight\fR(\fItkwin, gc, width, drawable\fR) 17 | .fi 18 | .SH ARGUMENTS 19 | .AS "Tcl_Interp" *joinPtr 20 | .AP Tk_Window tkwin in 21 | Window for which the highlight is being drawn. Used to retrieve 22 | the window's dimensions, among other things. 23 | .AP GC gc in 24 | Graphics context to use for drawing the highlight. 25 | .AP int width in 26 | Width of the highlight ring, in pixels. 27 | .AP Drawable drawable in 28 | Drawable in which to draw the highlight; usually an offscreen 29 | pixmap for double buffering. 30 | .BE 31 | .SH DESCRIPTION 32 | .PP 33 | \fBTk_DrawFocusHighlight\fR is a utility procedure that draws the 34 | traversal highlight ring for a widget. 35 | It is typically invoked by widgets during redisplay. 36 | .SH KEYWORDS 37 | focus, traversal highlight 38 | -------------------------------------------------------------------------------- /doc/bell.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1994 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" Copyright (c) 2000 Ajuba Solutions. 5 | '\" 6 | '\" See the file "license.terms" for information on usage and redistribution 7 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 8 | '\" 9 | .TH bell n 8.4 Tk "Tk Built-In Commands" 10 | .so man.macros 11 | .BS 12 | '\" Note: do not modify the .SH NAME line immediately below! 13 | .SH NAME 14 | bell \- Ring a display's bell 15 | .SH SYNOPSIS 16 | \fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? 17 | .BE 18 | .SH DESCRIPTION 19 | .PP 20 | This command rings the bell on the display for \fIwindow\fR and 21 | returns an empty string. 22 | If the \fB\-displayof\fR option is omitted, the display of the 23 | application's main window is used by default. 24 | The command uses the current bell-related settings for the display, which 25 | may be modified with programs such as \fBxset\fR. 26 | .PP 27 | If \fB\-nice\fR is not specified, this command also resets the screen saver 28 | for the screen. Some screen savers will ignore this, but others will reset 29 | so that the screen becomes visible again. 30 | .SH KEYWORDS 31 | beep, bell, ring 32 | '\" Local Variables: 33 | '\" mode: nroff 34 | '\" End: 35 | -------------------------------------------------------------------------------- /library/demos/paned1.tcl: -------------------------------------------------------------------------------- 1 | # paned1.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window containing 4 | # a paned window that separates two windows horizontally. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .paned1 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Horizontal Paned Window Demonstration" 16 | wm iconname $w "paned1" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 4i -justify left -text "The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.)" 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | set btns [addSeeDismiss $w.buttons $w] 24 | pack $btns -side bottom -fill x 25 | 26 | panedwindow $w.pane 27 | pack $w.pane -side top -expand yes -fill both -pady 1.5p -padx 2m 28 | 29 | label $w.pane.left -text "This is the\nleft side" -fg black -bg yellow 30 | label $w.pane.right -text "This is the\nright side" -fg black -bg cyan 31 | 32 | $w.pane add $w.pane.left $w.pane.right -stretch always 33 | -------------------------------------------------------------------------------- /doc/StrictMotif.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_StrictMotif \- Return value of tk_strictMotif variable 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | int 17 | \fBTk_StrictMotif\fR(\fItkwin\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_Window tkwin 21 | .AP Tk_Window tkwin in 22 | Token for window. 23 | .BE 24 | .SH DESCRIPTION 25 | .PP 26 | This procedure returns the current value of the \fBtk_strictMotif\fR 27 | variable in the interpreter associated with \fItkwin\fR's application. 28 | The value is returned as an integer that is either 0 or 1. 29 | 1 means that strict Motif compliance has been requested, so anything 30 | that is not part of the Motif specification should be avoided. 31 | 0 means that 32 | .QW Motif-like 33 | is good enough, and extra features are welcome. 34 | .PP 35 | This procedure uses a link to the Tcl variable to provide much 36 | faster access to the variable's value than could be had by calling 37 | \fBTcl_GetVar\fR. 38 | .SH KEYWORDS 39 | Motif compliance, tk_strictMotif variable 40 | -------------------------------------------------------------------------------- /library/demos/timer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # the next line restarts using wish \ 3 | exec wish "$0" ${1+"$@"} 4 | 5 | # timer -- 6 | # This script generates a counter with start and stop buttons. 7 | 8 | package require tk 9 | 10 | label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m 11 | button .start -text Start -command { 12 | if {$stopped} { 13 | set stopped 0 14 | set startMoment [clock clicks -milliseconds] 15 | tick 16 | .stop configure -state normal 17 | .start configure -state disabled 18 | } 19 | } 20 | button .stop -text Stop -state disabled -command { 21 | set stopped 1 22 | .stop configure -state disabled 23 | .start configure -state normal 24 | } 25 | pack .counter -side bottom -fill both 26 | pack .start -side left -fill both -expand yes 27 | pack .stop -side right -fill both -expand yes 28 | 29 | set startMoment {} 30 | 31 | set stopped 1 32 | 33 | proc tick {} { 34 | global startMoment stopped 35 | if {$stopped} {return} 36 | after 50 tick 37 | set elapsedMS [expr {[clock clicks -milliseconds] - $startMoment}] 38 | .counter config -text [format "%.2f" [expr {double($elapsedMS)/1000}]] 39 | } 40 | 41 | bind . {destroy .} 42 | bind . {destroy .} 43 | focus . 44 | 45 | # Local Variables: 46 | # mode: tcl 47 | # End: 48 | -------------------------------------------------------------------------------- /doc/ClrSelect.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1992-1994 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_ClearSelection \- Deselect a selection 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_ClearSelection\fR(\fItkwin, selection\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_Window tkwin 21 | .AP Tk_Window tkwin in 22 | The selection will be cleared from the display containing this 23 | window. 24 | .AP Atom selection in 25 | The name of selection to be cleared. 26 | .BE 27 | .SH DESCRIPTION 28 | .PP 29 | \fBTk_ClearSelection\fR cancels the selection specified by the atom 30 | \fIselection\fR for the display containing \fItkwin\fR. 31 | The selection need not be in \fItkwin\fR itself or even in 32 | \fItkwin\fR's application. 33 | If there is a window anywhere on \fItkwin\fR's display that 34 | owns \fIselection\fR, the window will be notified and the 35 | selection will be cleared. 36 | If there is no owner for \fIselection\fR on the display, then the 37 | procedure has no effect. 38 | .SH KEYWORDS 39 | clear, selection 40 | -------------------------------------------------------------------------------- /unix/tkUnixConfig.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tkUnixConfig.c -- 3 | * 4 | * This module implements the Unix system defaults for the configuration 5 | * package. 6 | * 7 | * Copyright © 1997 Sun Microsystems, Inc. 8 | * 9 | * See the file "license.terms" for information on usage and redistribution of 10 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 11 | */ 12 | 13 | #include "tkInt.h" 14 | 15 | 16 | /* 17 | *---------------------------------------------------------------------- 18 | * 19 | * Tk_GetSystemDefault -- 20 | * 21 | * Given a dbName and className for a configuration option, return a 22 | * string representation of the option. 23 | * 24 | * Results: 25 | * Returns a Tcl_Obj* with the string identifier that identifies this 26 | * option. Returns NULL if there are no system defaults that match this 27 | * pair. 28 | * 29 | * Side effects: 30 | * None, once the package is initialized. 31 | * 32 | *---------------------------------------------------------------------- 33 | */ 34 | 35 | Tcl_Obj * 36 | Tk_GetSystemDefault( 37 | Tk_Window tkwin, /* A window to use. */ 38 | const char *dbName, /* The option database name. */ 39 | const char *className) /* The name of the option class. */ 40 | { 41 | (void)tkwin; 42 | (void)dbName; 43 | (void)className; 44 | 45 | return NULL; 46 | } 47 | 48 | /* 49 | * Local Variables: 50 | * mode: c 51 | * c-basic-offset: 4 52 | * fill-column: 78 53 | * End: 54 | */ 55 | -------------------------------------------------------------------------------- /macosx/tkMacOSXConfig.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tkMacOSXConfig.c -- 3 | * 4 | * This module implements the Macintosh system defaults for 5 | * the configuration package. 6 | * 7 | * Copyright © 1997 Sun Microsystems, Inc. 8 | * Copyright © 2001 Apple Inc. 9 | * 10 | * See the file "license.terms" for information on usage and redistribution 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #include "tkInt.h" 15 | 16 | 17 | /* 18 | *---------------------------------------------------------------------- 19 | * 20 | * Tk_GetSystemDefault -- 21 | * 22 | * Given a dbName and className for a configuration option, 23 | * return a string representation of the option. 24 | * 25 | * Results: 26 | * Returns a Tcl_Obj* with the string identifier that identifies 27 | * this option. Returns NULL if there are no system defaults 28 | * that match this pair. 29 | * 30 | * Side effects: 31 | * None, once the package is initialized. 32 | * 33 | *---------------------------------------------------------------------- 34 | */ 35 | 36 | Tcl_Obj * 37 | Tk_GetSystemDefault( 38 | TCL_UNUSED(Tk_Window), /* A window to use. */ 39 | TCL_UNUSED(const char *), /* The option database name. */ 40 | TCL_UNUSED(const char *)) /* The name of the option class. */ 41 | { 42 | return NULL; 43 | } 44 | 45 | /* 46 | * Local Variables: 47 | * mode: objc 48 | * c-basic-offset: 4 49 | * fill-column: 79 50 | * coding: utf-8 51 | * End: 52 | */ 53 | -------------------------------------------------------------------------------- /library/ttk/progress.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # Ttk widget set: progress bar utilities. 3 | # 4 | 5 | namespace eval ttk::progressbar { 6 | variable Timers ;# Map: widget name -> after ID 7 | } 8 | 9 | # Autoincrement -- 10 | # Periodic callback procedure for autoincrement mode 11 | # 12 | proc ttk::progressbar::Autoincrement {pb steptime stepsize} { 13 | variable Timers 14 | 15 | if {![winfo exists $pb]} { 16 | # widget has been destroyed -- cancel timer 17 | unset -nocomplain Timers($pb) 18 | return 19 | } 20 | 21 | set Timers($pb) [after $steptime \ 22 | [list ttk::progressbar::Autoincrement $pb $steptime $stepsize] ] 23 | 24 | $pb step $stepsize 25 | } 26 | 27 | # ttk::progressbar::start -- 28 | # Start autoincrement mode. Invoked by [$pb start] widget code. 29 | # 30 | proc ttk::progressbar::start {pb {steptime 50} {stepsize 1}} { 31 | variable Timers 32 | if {![info exists Timers($pb)]} { 33 | Autoincrement $pb $steptime $stepsize 34 | } 35 | if {[tk windowingsystem] eq "aqua"} { 36 | $pb state selected 37 | } 38 | } 39 | 40 | # ttk::progressbar::stop -- 41 | # Cancel autoincrement mode. Invoked by [$pb stop] widget code. 42 | # 43 | proc ttk::progressbar::stop {pb} { 44 | variable Timers 45 | if {[info exists Timers($pb)]} { 46 | after cancel $Timers($pb) 47 | unset Timers($pb) 48 | } 49 | $pb configure -value 0 50 | if {[tk windowingsystem] eq "aqua"} { 51 | $pb state !selected 52 | } 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /doc/destroy.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH destroy n "" Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | '\" Note: do not modify the .SH NAME line immediately below! 12 | .SH NAME 13 | destroy \- Destroy one or more windows 14 | .SH SYNOPSIS 15 | \fBdestroy \fR?\fIwindow window ...\fR? 16 | .BE 17 | .SH DESCRIPTION 18 | .PP 19 | This command deletes the windows given by the 20 | \fIwindow\fR arguments, plus all of their descendants. 21 | If a \fIwindow\fR 22 | .QW . 23 | is deleted then all windows will be destroyed and the application will 24 | (normally) exit. 25 | The \fIwindow\fRs are destroyed in order, and if an error occurs 26 | in destroying a window the command aborts without destroying the 27 | remaining windows. 28 | No error is returned if \fIwindow\fR does not exist. 29 | .SH EXAMPLE 30 | .PP 31 | Destroy all checkbuttons that are direct children of the given widget: 32 | .CS 33 | proc killCheckbuttonChildren {parent} { 34 | foreach w [winfo children $parent] { 35 | if {[winfo class $w] eq "Checkbutton"} { 36 | \fBdestroy\fR $w 37 | } 38 | } 39 | } 40 | .CE 41 | .SH KEYWORDS 42 | application, destroy, window 43 | '\" Local Variables: 44 | '\" mode: nroff 45 | '\" End: 46 | -------------------------------------------------------------------------------- /doc/GetRootCrd.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_GetRootCoords \- Compute root-window coordinates of window 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_Window tkwin 21 | .AP Tk_Window tkwin in 22 | Token for window. 23 | .AP int *xPtr out 24 | Pointer to location in which to store root-window x-coordinate 25 | corresponding to left edge of \fItkwin\fR's border. 26 | .AP int *yPtr out 27 | Pointer to location in which to store root-window y-coordinate 28 | corresponding to top edge of \fItkwin\fR's border. 29 | .BE 30 | .SH DESCRIPTION 31 | .PP 32 | This procedure scans through the structural information maintained 33 | by Tk to compute the root-window coordinates corresponding to 34 | the upper-left corner of \fItkwin\fR's border. If \fItkwin\fR has 35 | no border, then \fBTk_GetRootCoords\fR returns the root-window 36 | coordinates corresponding to location (0,0) in \fItkwin\fR. 37 | \fBTk_GetRootCoords\fR is relatively efficient, since it does not have to 38 | communicate with the X server. 39 | .SH KEYWORDS 40 | coordinates, root window 41 | -------------------------------------------------------------------------------- /doc/ttk_separator.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 2004 Joe English 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH ttk::separator n 8.5 Tk "Tk Themed Widget" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | ttk::separator \- Separator bar 12 | .SH SYNOPSIS 13 | \fBttk::separator\fI pathName \fR?\fIoptions\fR? 14 | .BE 15 | .SH DESCRIPTION 16 | .PP 17 | A \fBttk::separator\fR widget displays a horizontal or vertical separator 18 | bar. 19 | .SO ttk_widget 20 | \-class \-cursor 21 | \-style \-takefocus 22 | .SE 23 | .SH "WIDGET-SPECIFIC OPTIONS" 24 | .OP \-orient orient Orient 25 | One of \fBhorizontal\fR or \fBvertical\fR. 26 | Specifies the orientation of the separator. 27 | .SH "WIDGET COMMAND" 28 | .PP 29 | Separator widgets support the standard commands 30 | \fBcget\fR, \fBconfigure\fR, \fBidentify element\fR, \fBinstate\fR, 31 | \fBstate\fR and \fBstyle\fR 32 | (see \fBttk::widget\fR). 33 | .PP 34 | .SH "STYLING OPTIONS" 35 | .PP 36 | The class name for a \fBttk::separator\fP is \fBTSeparator\fP. 37 | .PP 38 | \fBTSeparator\fP styling options configurable with \fBttk::style\fP 39 | are: 40 | .PP 41 | \fB\-background\fP \fIcolor\fP 42 | .PP 43 | Some options are only available for specific themes. 44 | .PP 45 | See the \fBttk::style\fP manual page for information on how to configure 46 | ttk styles. 47 | .SH "SEE ALSO" 48 | ttk::widget(n) 49 | .SH "KEYWORDS" 50 | widget, separator 51 | '\" Local Variables: 52 | '\" mode: nroff 53 | '\" End: 54 | -------------------------------------------------------------------------------- /tests/main.tcl: -------------------------------------------------------------------------------- 1 | # main.tcl -- 2 | # 3 | # This file holds initialization code that is common to all test files. 4 | # It performs an initial Tk setup for the root window, imports commands from 5 | # the tcltest namespace, and loads definitions of global utility procs and 6 | # test constraints. 7 | # 8 | # See the file "license.terms" for information on usage and redistribution 9 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 10 | 11 | if {[namespace exists ::tk::test]} { 12 | # This file has already been sourced by a previous test file in mode -singleproc 1 13 | return 14 | } 15 | 16 | # 17 | # SETUP FOR APPLICATION AND ROOT WINDOW 18 | # 19 | encoding system utf-8 20 | if {[tcltest::configure -singleproc] == 0} { 21 | # Support test suite invocation by tclsh (as is the case with "-singleproc 1") 22 | package require tk 23 | } 24 | tk appname tktest 25 | wm title . tktest 26 | wm geometry . +0+0 27 | 28 | # 29 | # IMPORT TCLTEST COMMANDS 30 | # 31 | namespace import -force tcltest::cleanupTests tcltest::interpreter \ 32 | tcltest::makeDirectory tcltest::makeFile tcltest::removeDirectory \ 33 | tcltest::removeFile tcltest::test tcltest::testsDirectory 34 | 35 | # 36 | # SOURCE DEFINITIONS OF GLOBAL UTILITY PROCS AND CONSTRAINTS 37 | # 38 | set mainTestDir [tcltest::configure -testdir] 39 | if {[file tail $mainTestDir] eq "ttk"} { 40 | set mainTestDir [file dirname $mainTestDir] 41 | } 42 | source [file join $mainTestDir testutils.tcl] 43 | source [file join $mainTestDir constraints.tcl] 44 | unset mainTestDir 45 | 46 | # EOF 47 | -------------------------------------------------------------------------------- /doc/GetOption.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_GetOption 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_GetOption \- retrieve an option from the option database 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Tk_Uid 18 | \fBTk_GetOption\fR(\fItkwin, name, class\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AS Tk_Window *class 22 | .AP Tk_Window tkwin in 23 | Token for window. 24 | .AP "const char" *name in 25 | Name of desired option. 26 | .AP "const char" *class in 27 | Class of desired option. Null means there is no class for 28 | this option; do lookup based on name only. 29 | .BE 30 | .SH DESCRIPTION 31 | .PP 32 | This procedure is invoked to retrieve an option from the database 33 | associated with \fItkwin\fR's main window. If there is an option 34 | for \fItkwin\fR that matches the given \fIname\fR or \fIclass\fR, 35 | then it is returned in the form of a Tk_Uid. If multiple options 36 | match \fIname\fR and \fIclass\fR, then the highest-priority one 37 | is returned. If no option matches, then NULL is returned. 38 | .PP 39 | \fBTk_GetOption\fR caches options related to \fItkwin\fR so that 40 | successive calls for the same \fItkwin\fR will execute much more 41 | quickly than successive calls for different windows. 42 | .SH KEYWORDS 43 | class, name, option, retrieve 44 | -------------------------------------------------------------------------------- /library/demos/square: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # the next line restarts using wish \ 3 | exec wish "$0" ${1+"$@"} 4 | 5 | # square -- 6 | # This script generates a demo application containing only a "square" 7 | # widget. It's only usable in the "tktest" application or if Tk has 8 | # been compiled with tkSquare.c. This demo arranges the following 9 | # bindings for the widget: 10 | # 11 | # Button-1 press/drag: moves square to mouse 12 | # "a": toggle size animation on/off 13 | 14 | package require tk ;# We use Tk generally, and... 15 | package require tk::test ;# ... we use the square widget too. 16 | 17 | square .s 18 | pack .s -expand yes -fill both 19 | wm minsize . 1 1 20 | 21 | bind .s {center %x %y} 22 | bind .s {center %x %y} 23 | bind .s a animate 24 | focus .s 25 | 26 | # The procedure below centers the square on a given position. 27 | 28 | proc center {x y} { 29 | set a [.s size] 30 | .s position [expr {$x-($a/2)}] [expr {$y-($a/2)}] 31 | } 32 | 33 | # The procedures below provide a simple form of animation where 34 | # the box changes size in a pulsing pattern: larger, smaller, larger, 35 | # and so on. 36 | 37 | set inc 0 38 | proc animate {} { 39 | global inc 40 | if {$inc == 0} { 41 | set inc 3 42 | timer 43 | } else { 44 | set inc 0 45 | } 46 | } 47 | 48 | proc timer {} { 49 | global inc 50 | set s [.s size] 51 | if {$inc == 0} return 52 | if {$s >= 40} {set inc -3} 53 | if {$s <= 10} {set inc 3} 54 | .s size [expr {$s+$inc}] 55 | after 30 timer 56 | } 57 | 58 | # Local Variables: 59 | # mode: tcl 60 | # End: 61 | -------------------------------------------------------------------------------- /library/demos/ttkscale.tcl: -------------------------------------------------------------------------------- 1 | # ttkscale.tcl -- 2 | # 3 | # This demonstration script shows an example with a horizontal scale. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .ttkscale 12 | catch {destroy $w} 13 | toplevel $w -bg [ttk::style lookup TLabel -background] 14 | wm title $w "Themed Scale Demonstration" 15 | wm iconname $w "ttkscale" 16 | positionWindow $w 17 | 18 | pack [ttk::frame [set w $w.contents]] -fill both -expand 1 19 | 20 | ttk::label $w.msg -font $font -wraplength 3.5i -justify left -text "A label tied to a horizontal scale is displayed below. If you click or drag mouse button 1 in the scale, you can change the contents of the label; a callback command is used to couple the slider to both the text and the coloring of the label." 21 | pack $w.msg -side top -padx .5c 22 | 23 | ## See Code / Dismiss buttons 24 | set btns [addSeeDismiss $w.buttons [winfo toplevel $w]] 25 | pack $btns -side bottom -fill x 26 | 27 | ttk::frame $w.frame -borderwidth 7.5p 28 | pack $w.frame -side top -fill x 29 | 30 | # List of colors from rainbow; "Indigo" is not a standard color 31 | set colorList {Red Orange Yellow Green Blue Violet} 32 | ttk::label $w.frame.label 33 | ttk::scale $w.frame.scale -from 0 -to 5 -command [list apply {{w idx} { 34 | set c [lindex $::colorList [tcl::mathfunc::int $idx]] 35 | $w.frame.label configure -foreground $c -text "Color: $c" 36 | }} $w] 37 | # Trigger the setting of the label's text 38 | $w.frame.scale set 0 39 | pack $w.frame.label $w.frame.scale 40 | -------------------------------------------------------------------------------- /library/demos/image1.tcl: -------------------------------------------------------------------------------- 1 | # image1.tcl -- 2 | # 3 | # This demonstration script displays two image widgets. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .image1 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Image Demonstration #1" 15 | wm iconname $w "Image1" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 4i -justify left -text "This demonstration displays two images, each in a separate label widget." 19 | pack $w.msg -side top 20 | 21 | ## See Code / Dismiss buttons 22 | set btns [addSeeDismiss $w.buttons $w] 23 | pack $btns -side bottom -fill x 24 | 25 | # Main widget program sets variable tk_demoDirectory 26 | catch {image delete image1a} 27 | image create photo image1a -file [file join $tk_demoDirectory images earth.gif] 28 | catch {image delete image1b} 29 | image create photo image1b \ 30 | -file [file join $tk_demoDirectory images earthris.gif] 31 | 32 | # Create copies of the images just created, magnified according to the 33 | # display's DPI scaling level. Since the zooom factor must be an integer, 34 | # the copies will only be effectively magnified if $tk::scalingPct >= 200. 35 | set zoomFactor [expr {$tk::scalingPct / 100}] 36 | image create photo image1a2 37 | image1a2 copy image1a -zoom $zoomFactor 38 | image create photo image1b2 39 | image1b2 copy image1b -zoom $zoomFactor 40 | 41 | label $w.l1 -image image1a2 -bd 1 -relief sunken 42 | label $w.l2 -image image1b2 -bd 1 -relief sunken 43 | 44 | pack $w.l1 $w.l2 -side top -padx .5m -pady .5m 45 | -------------------------------------------------------------------------------- /win/tkWinSendCom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkWinSendCom.h -- 3 | * 4 | * This file provides procedures that implement the Windows "send" 5 | * command, allowing commands to be passed from interpreter to 6 | * interpreter. 7 | * 8 | * Copyright © 2002 Pat Thoyts 9 | * 10 | * See the file "license.terms" for information on usage and redistribution of 11 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 | */ 13 | 14 | #ifndef _tkWinSendCom_h_INCLUDE 15 | #define _tkWinSendCom_h_INCLUDE 16 | 17 | #include "tkWinInt.h" 18 | #include 19 | 20 | #ifdef _MSC_VER 21 | # pragma comment (lib, "ole32.lib") 22 | # pragma comment (lib, "oleaut32.lib") 23 | # pragma comment (lib, "uuid.lib") 24 | #endif 25 | 26 | /* 27 | * TkWinSendCom CoClass structure 28 | */ 29 | 30 | typedef struct { 31 | IDispatchVtbl *lpVtbl; 32 | ISupportErrorInfoVtbl *lpVtbl2; 33 | long refcount; 34 | Tcl_Interp *interp; 35 | } TkWinSendCom; 36 | 37 | /* 38 | * TkWinSendCom Dispatch IDs 39 | */ 40 | 41 | #define TKWINSENDCOM_DISPID_SEND 1 42 | #define TKWINSENDCOM_DISPID_ASYNC 2 43 | 44 | /* 45 | * TkWinSendCom public functions 46 | */ 47 | 48 | MODULE_SCOPE HRESULT TkWinSendCom_CreateInstance(Tcl_Interp *interp, 49 | REFIID riid, void **ppv); 50 | MODULE_SCOPE int TkWinSend_QueueCommand(Tcl_Interp *interp, 51 | Tcl_Obj *cmdPtr); 52 | MODULE_SCOPE void TkWinSend_SetExcepInfo(Tcl_Interp *interp, 53 | EXCEPINFO *pExcepInfo); 54 | 55 | #endif /* _tkWinSendCom_h_INCLUDE */ 56 | 57 | /* 58 | * Local Variables: 59 | * mode: c 60 | * End: 61 | */ 62 | -------------------------------------------------------------------------------- /library/demos/entry1.tcl: -------------------------------------------------------------------------------- 1 | # entry1.tcl -- 2 | # 3 | # This demonstration script creates several entry widgets without 4 | # scrollbars. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .entry1 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Entry Demonstration (no scrollbars)" 16 | wm iconname $w "entry1" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 5i -justify left -text "Three different entries are displayed below. You can add characters by pointing, clicking and typing. The normal Motif editing characters are supported, along with many Emacs bindings. For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor. For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with mouse the middle mouse button pressed." 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | set btns [addSeeDismiss $w.buttons $w] 24 | pack $btns -side bottom -fill x 25 | 26 | entry $w.e1 27 | entry $w.e2 28 | entry $w.e3 -placeholder {Enter text here} -placeholderforeground gray75 29 | pack $w.e1 $w.e2 $w.e3 -side top -pady 3p -padx 7.5p -fill x 30 | 31 | $w.e1 insert 0 "Initial value" 32 | $w.e2 insert end "This entry contains a long value, much too long " 33 | $w.e2 insert end "to fit in the window at one time, so long in fact " 34 | $w.e2 insert end "that you'll have to scan or scroll to see the end." 35 | -------------------------------------------------------------------------------- /macosx/Tk-Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | CFBundleDevelopmentRegion 13 | English 14 | CFBundleExecutable 15 | @TK_LIB_FILE@ 16 | CFBundleGetInfoString 17 | Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@@TK_PATCH_LEVEL@, 18 | Copyright © 1989-@TK_YEAR@ Tcl Core Team, 19 | Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, 20 | Copyright © 1989-@TK_YEAR@ Contributors, 21 | Copyright © 2011-@TK_YEAR@ Kevin Walzer, 22 | Copyright © 2014-@TK_YEAR@ Marc Culler, 23 | Copyright © 2001-2009 Apple Inc., 24 | Copyright © 2001-2002 Jim Ingham & Ian Reid 25 | CFBundleIdentifier 26 | com.tcltk.tklibrary 27 | CFBundleInfoDictionaryVersion 28 | 6.0 29 | CFBundleName 30 | Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@ 31 | CFBundlePackageType 32 | FMWK 33 | CFBundleShortVersionString 34 | @TK_VERSION@@TK_PATCH_LEVEL@ 35 | CFBundleSignature 36 | Tk 37 | CFBundleVersion 38 | @TK_VERSION@@TK_PATCH_LEVEL@ 39 | 40 | 41 | -------------------------------------------------------------------------------- /doc/lower.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH lower n 3.3 Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | '\" Note: do not modify the .SH NAME line immediately below! 12 | .SH NAME 13 | lower \- Change a window's position in the stacking order 14 | .SH SYNOPSIS 15 | \fBlower \fIwindow \fR?\fIbelowThis\fR? 16 | .BE 17 | .SH DESCRIPTION 18 | .PP 19 | If the \fIbelowThis\fR argument is omitted then the command lowers 20 | \fIwindow\fR so that it is below all of its siblings in the stacking 21 | order (it will be obscured by any siblings that overlap it and 22 | will not obscure any siblings). 23 | If \fIbelowThis\fR is specified then it must be the path name of 24 | a window that is either a sibling of \fIwindow\fR or the descendant 25 | of a sibling of \fIwindow\fR. 26 | In this case the \fBlower\fR command will insert 27 | \fIwindow\fR into the stacking order just below \fIbelowThis\fR 28 | (or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); 29 | this could end up either raising or lowering \fIwindow\fR. 30 | .PP 31 | All \fBtoplevel\fR windows may be restacked with respect to each 32 | other, whatever their relative path names, but the window manager is 33 | not obligated to strictly honor requests to restack. 34 | .SH "SEE ALSO" 35 | raise 36 | .SH KEYWORDS 37 | lower, obscure, stacking order 38 | '\" Local Variables: 39 | '\" mode: nroff 40 | '\" End: 41 | -------------------------------------------------------------------------------- /doc/tkerror.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1994 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH tkerror n 4.1 Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | '\" Note: do not modify the .SH NAME line immediately below! 12 | .SH NAME 13 | tkerror \- Command invoked to process background errors 14 | .SH SYNOPSIS 15 | \fBtkerror \fImessage\fR 16 | .BE 17 | .SH DESCRIPTION 18 | .PP 19 | Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to 20 | \fBbgerror\fR because the event loop (which is what usually invokes 21 | it) is now part of Tcl. Using the \fBtkerror\fR name is deprecated. 22 | .PP 23 | For backward compatibility 24 | the \fBbgerror\fR provided by the current Tk version still 25 | tries to call \fBtkerror\fR if there is one (or an auto loadable one), 26 | so old script defining that error handler should still work, but you 27 | should anyhow modify your scripts to use \fBbgerror\fR instead 28 | of \fBtkerror\fR because that support for the old name might vanish 29 | in the future. If that call fails, \fBbgerror\fR 30 | posts a dialog showing the error and offering to see the stack trace 31 | to the user. If you want your own error management you should 32 | directly override \fBbgerror\fR instead of \fBtkerror\fR. 33 | Documentation for \fBbgerror\fR is available as part of Tcl's 34 | documentation. 35 | .SH KEYWORDS 36 | background error, reporting 37 | '\" Local Variables: 38 | '\" mode: nroff 39 | '\" End: 40 | -------------------------------------------------------------------------------- /library/demos/bitmap.tcl: -------------------------------------------------------------------------------- 1 | # bitmap.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window that displays 4 | # all of Tk's built-in bitmaps. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | # bitmapRow -- 13 | # Create a row of bitmap items in a window. 14 | # 15 | # Arguments: 16 | # w - The window that is to contain the row. 17 | # args - The names of one or more bitmaps, which will be displayed 18 | # in a new row across the bottom of w along with their 19 | # names. 20 | 21 | proc bitmapRow {w args} { 22 | frame $w 23 | pack $w -side top -fill both 24 | set i 0 25 | foreach bitmap $args { 26 | frame $w.$i 27 | pack $w.$i -side left -fill both -pady .25c -padx .25c 28 | label $w.$i.bitmap -bitmap $bitmap 29 | label $w.$i.label -text $bitmap -width 9 30 | pack $w.$i.label $w.$i.bitmap -side bottom 31 | incr i 32 | } 33 | } 34 | 35 | set w .bitmap 36 | catch {destroy $w} 37 | toplevel $w 38 | wm title $w "Bitmap Demonstration" 39 | wm iconname $w "bitmap" 40 | positionWindow $w 41 | 42 | label $w.msg -font $font -wraplength 4i -justify left -text "This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts." 43 | pack $w.msg -side top 44 | 45 | ## See Code / Dismiss buttons 46 | set btns [addSeeDismiss $w.buttons $w] 47 | pack $btns -side bottom -fill x 48 | 49 | frame $w.frame 50 | bitmapRow $w.frame.0 error gray12 gray25 gray50 gray75 51 | bitmapRow $w.frame.1 hourglass info question questhead warning 52 | pack $w.frame -side top -expand yes -fill both 53 | -------------------------------------------------------------------------------- /unix/tk.spec: -------------------------------------------------------------------------------- 1 | # This file is the basis for a binary Tk Linux RPM. 2 | 3 | %{!?directory:%define directory /usr/local} 4 | 5 | Name: tk 6 | Summary: Tk graphical toolkit for the Tcl scripting language. 7 | Version: 9.1a1 8 | Release: 2 9 | License: BSD 10 | Group: Development/Languages 11 | Source: https://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz 12 | URL: https://www.tcl-lang.org/ 13 | Buildroot: /var/tmp/%{name}%{version} 14 | Buildrequires: XFree86-devel tcl >= 9.0.0 15 | Requires: tcl >= 9.0.0 16 | 17 | %description 18 | The Tcl (Tool Command Language) provides a powerful platform for 19 | creating integration applications that tie together diverse 20 | applications, protocols, devices, and frameworks. When paired with 21 | the Tk toolkit, Tcl provides the fastest and most powerful way to 22 | create GUI applications that run on PCs, Unix, and Mac OS X. Tcl 23 | can also be used for a variety of web-related tasks and for creating 24 | powerful command languages for applications. 25 | 26 | %prep 27 | %setup -q -n %{name}%{version} 28 | 29 | %build 30 | cd unix 31 | CFLAGS="%optflags" ./configure \ 32 | --prefix=%{directory} \ 33 | --exec-prefix=%{directory} \ 34 | --libdir=%{directory}/%{_lib} 35 | make 36 | 37 | %install 38 | cd unix 39 | make INSTALL_ROOT=%buildroot install 40 | 41 | %clean 42 | rm -rf %buildroot 43 | 44 | %files -n tk 45 | %defattr(-,root,root) 46 | %if %{_lib} != lib 47 | %{directory}/%{_lib} 48 | %endif 49 | %{directory}/lib 50 | %{directory}/bin 51 | %{directory}/include 52 | %{directory}/man/man1 53 | %{directory}/man/man3 54 | %{directory}/man/mann 55 | -------------------------------------------------------------------------------- /tests/ttk/layout.test: -------------------------------------------------------------------------------- 1 | # 2 | # Tests for the "ttk::style layout" command 3 | # 4 | 5 | # 6 | # TESTFILE INITIALIZATION 7 | # 8 | 9 | package require tcltest 2.2; # needed in mode -singleproc 0 10 | 11 | # Load the main script main.tcl, which takes care of: 12 | # - setup for the application and the root window 13 | # - importing commands from the tcltest namespace 14 | # - loading of the testutils mechanism along with its utility procs 15 | # - loading of Tk specific test constraints (additionally to constraints 16 | # provided by the package tcltest) 17 | source [file join [file dirname [tcltest::configure -testdir]] main.tcl] 18 | 19 | # Ensure a pristine initial window state 20 | resetWindows 21 | 22 | # 23 | # TESTS 24 | # 25 | 26 | test layout-1.1 "Size computations for mixed-orientation layouts" -body { 27 | ttk::style theme use default 28 | 29 | set block [image create photo -width 10 -height 10] 30 | ttk::style element create block image $block 31 | ttk::style layout Blocks { 32 | border -children { block } -side left 33 | border -children { block } -side top 34 | border -children { block } -side bottom 35 | } 36 | ttk::style configure Blocks -borderwidth 1 -relief raised 37 | ttk::button .b -style Blocks 38 | 39 | pack .b -expand true -fill both 40 | 41 | list [winfo reqwidth .b] [winfo reqheight .b] 42 | 43 | } -cleanup { destroy .b } -result [list 24 24] 44 | 45 | test layout-2 "Empty -children not allowed" -body { 46 | ttk::style layout Test.Tentry {Entry.field -children {}} 47 | } -returnCodes error -result {Invalid -children value} 48 | 49 | # 50 | # TESTFILE CLEANUP 51 | # 52 | 53 | tcltest::cleanupTests 54 | -------------------------------------------------------------------------------- /library/demos/clrpick.tcl: -------------------------------------------------------------------------------- 1 | # clrpick.tcl -- 2 | # 3 | # This demonstration script prompts the user to select a color. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .clrpick 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Color Selection Dialog" 15 | wm iconname $w "colors" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 4i -justify left -text "Press the buttons below to choose the foreground and background colors for the widgets in this window." 19 | pack $w.msg -side top 20 | 21 | ## See Code / Dismiss buttons 22 | set btns [addSeeDismiss $w.buttons $w] 23 | pack $btns -side bottom -fill x 24 | 25 | button $w.back -text "Set background color ..." \ 26 | -command \ 27 | "setColor $w $w.back background {-background -highlightbackground}" 28 | button $w.fore -text "Set foreground color ..." \ 29 | -command \ 30 | "setColor $w $w.back foreground -foreground" 31 | 32 | pack $w.back $w.fore -side top -anchor c -pady 2m 33 | 34 | proc setColor {w button name options} { 35 | grab $w 36 | set initialColor [$button cget -$name] 37 | set color [tk_chooseColor -title "Choose a $name color" -parent $w \ 38 | -initialcolor $initialColor] 39 | if {[string compare $color ""]} { 40 | setColor_helper $w $options $color 41 | } 42 | grab release $w 43 | } 44 | 45 | proc setColor_helper {w options color} { 46 | foreach option $options { 47 | catch { 48 | $w config $option $color 49 | } 50 | } 51 | foreach child [winfo children $w] { 52 | setColor_helper $child $options $color 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /doc/CrtConsoleChan.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 2007 ActiveState Software Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_InitConsoleChannels \- Install the console channels as standard channels 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | \fBTk_InitConsoleChannels\fR(\fIinterp\fR) 17 | .fi 18 | .SH ARGUMENTS 19 | .AS Tcl_Interp *interp in 20 | .AP Tcl_Interp *interp in 21 | Interpreter in which the console channels are created. 22 | .BE 23 | .SH DESCRIPTION 24 | .PP 25 | \fBTk_InitConsoleChannels\fR is invoked to create a set of console 26 | channels and install them as the standard channels. All I/O on these 27 | channels will be discarded until \fBTk_CreateConsoleWindow\fR is 28 | called to attach the console to a text widget. 29 | .PP 30 | This function is for use by shell applications based on Tk, like 31 | \fBwish\fR, on platforms which have no standard channels in graphical 32 | mode, like Win32. 33 | .PP 34 | The \fIinterp\fR argument is the interpreter in which to create and 35 | install the console channels. 36 | .PP 37 | \fBNOTE:\fR If this function is used it has to be called before the 38 | first call to \fBTcl_RegisterChannel\fR, directly, or indirectly 39 | through other channel functions. Because otherwise the standard 40 | channels will be already initialized to the system defaults, which will 41 | be nonsensical for the case \fBTk_InitConsoleChannels\fR is for. 42 | .SH "SEE ALSO" 43 | console(n) 44 | .SH KEYWORDS 45 | standard channels, console 46 | -------------------------------------------------------------------------------- /doc/popup.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH tk_popup n 4.0 Tk "Tk Built-In Commands" 8 | .so man.macros 9 | .BS 10 | '\" Note: do not modify the .SH NAME line immediately below! 11 | .SH NAME 12 | tk_popup \- Post a popup menu 13 | .SH SYNOPSIS 14 | \fBtk_popup \fImenu x y \fR?\fIentry\fR? 15 | .BE 16 | .SH DESCRIPTION 17 | .PP 18 | This procedure posts a menu at a given position on the screen and 19 | configures Tk so that the menu and its cascaded children can be 20 | traversed with the mouse or the keyboard. 21 | \fIMenu\fR is the name of a menu widget and \fIx\fR and \fIy\fR 22 | are the root coordinates at which to display the menu. 23 | If \fIentry\fR is omitted or an empty string, the 24 | menu's upper left corner is positioned at the given point. 25 | Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and 26 | the menu will be positioned so that the entry is positioned over 27 | the given point. 28 | .SH EXAMPLE 29 | .PP 30 | How to attach a simple popup menu to a widget. 31 | .CS 32 | # Create a menu 33 | set m [menu .popupMenu] 34 | $m add command -label "Example 1" -command bell 35 | $m add command -label "Example 2" -command bell 36 | 37 | # Create something to attach it to 38 | pack [label .l -text "Click me!"] 39 | 40 | # Arrange for the menu to pop up when the label is clicked 41 | bind .l {\fBtk_popup\fR .popupMenu %X %Y} 42 | .CE 43 | .SH "SEE ALSO" 44 | bind(n), menu(n), tk_optionMenu(n) 45 | .SH KEYWORDS 46 | menu, popup 47 | '\" Local Variables: 48 | '\" mode: nroff 49 | '\" End: 50 | -------------------------------------------------------------------------------- /library/demos/button.tcl: -------------------------------------------------------------------------------- 1 | # button.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window containing 4 | # several button widgets. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .button 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Button Demonstration" 16 | wm iconname $w "button" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 4i -justify left -text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button. You can press Tab to move among the buttons, then press Space to invoke the current button." 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | pack [addSeeDismiss $w.buttons $w] -side bottom -fill x 24 | 25 | proc colorrefresh {w col} { 26 | $w configure -bg $col 27 | if {[tk windowingsystem] eq "aqua"} { 28 | # set highlightbackground of all buttons in $w 29 | set l [list $w] 30 | while {[llength $l]} { 31 | set l [concat [lassign $l b] [winfo children $b]] 32 | if {[winfo class $b] eq "Button"} { 33 | $b configure -highlightbackground $col 34 | } 35 | } 36 | } 37 | } 38 | 39 | button $w.b1 -text "Peach Puff" -width 10 \ 40 | -command [list colorrefresh $w PeachPuff1] 41 | button $w.b2 -text "Light Blue" -width 10 \ 42 | -command [list colorrefresh $w LightBlue1] 43 | button $w.b3 -text "Sea Green" -width 10 \ 44 | -command [list colorrefresh $w SeaGreen2] 45 | button $w.b4 -text "Yellow" -width 10 \ 46 | -command [list colorrefresh $w Yellow1] 47 | pack $w.b1 $w.b2 $w.b3 $w.b4 -side top -expand yes -pady 1.5p 48 | -------------------------------------------------------------------------------- /library/demos/accessiblewidget: -------------------------------------------------------------------------------- 1 | set widgetDemo 1 2 | 3 | wm withdraw . 4 | 5 | set _w [toplevel .acc] 6 | wm title $_w "Accessible Widget Demo" 7 | wm resizable $_w 0 0 8 | set tk_demoDirectory [file join [pwd] [file dirname [info script]]] 9 | 10 | ttk::label $_w.x -text "This is a demonstration of accessible widgets in Tcl/Tk. Please click on the buttons 11 | below to interact with the different widgets and see how they support accessibility." -padding 5 12 | 13 | pack $_w.x -side top -fill x -expand no 14 | 15 | pack [ttk::frame $_w.f] -side bottom -fill x -expand no 16 | 17 | set data { 18 | {{Buttons} button.tcl} 19 | {{Check-buttons (select any of a group)} check.tcl} 20 | {{Radio-buttons (select one of a group)} radio.tcl} 21 | {{The simple Themed Tk widgets} ttkbut.tcl} 22 | {{Color picker} clrpick.tcl} 23 | {{File selection dialog} filebox.tcl} 24 | {{Font selection dialog} fontchoose.tcl} 25 | {{Message boxes} msgbox.tcl} 26 | {{A list of the 50 states} states.tcl} 27 | {{A table of countries} mclist.tcl} 28 | {{A directory browser tree} tree.tcl} 29 | {{Combo-boxes} combo.tcl} 30 | {{Entry} entry1.tcl} 31 | {{Editable text} text.tcl} 32 | {{Spin-box} ttkspin.tcl} 33 | {{Menus} menu.tcl} 34 | {{Notebook} ttknote.tcl} 35 | {{Paned window} ttkpane.tcl} 36 | {{Scale} hscale.tcl} 37 | } 38 | 39 | foreach item $data { 40 | set name [file rootname [file tail [lindex $item 1]]] 41 | set srcfile [file join $tk_demoDirectory [file tail [lindex $item 1]]] 42 | set btn [ttk::button $_w.f.$name -text [lindex $item 0] -padding 5 -command [list source $srcfile]] 43 | pack $btn -fill x -expand no 44 | } 45 | 46 | return 47 | 48 | 49 | # Local Variables: 50 | # mode: tcl 51 | # End: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /win/tkWinConfig.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tkWinConfig.c -- 3 | * 4 | * This module implements the Windows system defaults for the 5 | * configuration package. 6 | * 7 | * Copyright © 1997 Sun Microsystems, Inc. 8 | * 9 | * See the file "license.terms" for information on usage and redistribution of 10 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 11 | */ 12 | 13 | #include "tkWinInt.h" 14 | 15 | 16 | /* 17 | *---------------------------------------------------------------------- 18 | * 19 | * Tk_GetSystemDefault -- 20 | * 21 | * Given a dbName and className for a configuration option, return a 22 | * string representation of the option. 23 | * 24 | * Results: 25 | * Returns a Tcl_Obj* with the string identifier that identifies this 26 | * option. Returns NULL if there are no system defaults that match this 27 | * pair. 28 | * 29 | * Side effects: 30 | * None, once the package is initialized. 31 | * 32 | *---------------------------------------------------------------------- 33 | */ 34 | 35 | Tcl_Obj * 36 | Tk_GetSystemDefault( 37 | Tk_Window tkwin, /* A window to use. */ 38 | const char *dbName, /* The option database name. */ 39 | const char *className) /* The name of the option class. */ 40 | { 41 | Tcl_Obj *valueObjPtr; 42 | Tk_Uid classUid; 43 | 44 | if (tkwin == NULL) { 45 | return NULL; 46 | } 47 | 48 | valueObjPtr = NULL; 49 | classUid = Tk_Class(tkwin); 50 | 51 | if (strcmp(classUid, "Menu") == 0) { 52 | valueObjPtr = TkWinGetMenuSystemDefault(tkwin, dbName, className); 53 | } 54 | 55 | return valueObjPtr; 56 | } 57 | 58 | /* 59 | * Local Variables: 60 | * mode: c 61 | * c-basic-offset: 4 62 | * fill-column: 78 63 | * End: 64 | */ 65 | -------------------------------------------------------------------------------- /library/demos/ttkprogress.tcl: -------------------------------------------------------------------------------- 1 | # ttkprogress.tcl -- 2 | # 3 | # This demonstration script creates several progress bar widgets. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .ttkprogress 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Progress Bar Demonstration" 15 | wm iconname $w "ttkprogress" 16 | positionWindow $w 17 | 18 | ttk::label $w.msg -font $font -wraplength 4i -justify left -text "Below are two progress bars. The top one is a “determinate” progress bar, which is used for showing how far through a defined task the program has got. The bottom one is an “indeterminate” progress bar, which is used to show that the program is busy but does not know how long for. Both are run here in self-animated mode, which can be turned on and off using the buttons underneath." 19 | pack $w.msg -side top -fill x 20 | 21 | ## See Code / Dismiss buttons 22 | set btns [addSeeDismiss $w.buttons $w] 23 | pack $btns -side bottom -fill x 24 | 25 | ttk::frame $w.f 26 | pack $w.f -fill both -expand 1 27 | set w $w.f 28 | 29 | proc doBars {op args} { 30 | foreach w $args { 31 | $w $op 32 | } 33 | } 34 | ttk::progressbar $w.p1 -mode determinate 35 | ttk::progressbar $w.p2 -mode indeterminate 36 | ttk::button $w.start -text "Start Progress" -command [list \ 37 | doBars start $w.p1 $w.p2] 38 | ttk::button $w.stop -text "Stop Progress" -command [list \ 39 | doBars stop $w.p1 $w.p2] 40 | 41 | grid $w.p1 - -pady 3p -padx 7.5p 42 | grid $w.p2 - -pady 3p -padx 7.5p 43 | grid $w.start $w.stop -padx 7.5p -pady 3p 44 | grid configure $w.start -sticky e 45 | grid configure $w.stop -sticky w 46 | grid columnconfigure $w all -weight 1 47 | -------------------------------------------------------------------------------- /library/demos/spin.tcl: -------------------------------------------------------------------------------- 1 | # spin.tcl -- 2 | # 3 | # This demonstration script creates several spinbox widgets. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .spin 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Spinbox Demonstration" 15 | wm iconname $w "spin" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 5i -justify left -text "Three different\ 19 | spin-boxes are displayed below. You can add characters by pointing,\ 20 | clicking and typing. The normal Motif editing characters are\ 21 | supported, along with many Emacs bindings. For example, Backspace\ 22 | and Control-h delete the character to the left of the insertion\ 23 | cursor and Delete and Control-d delete the chararacter to the right\ 24 | of the insertion cursor. For values that are too large to fit in the\ 25 | window all at once, you can scan through the value by dragging with\ 26 | mouse button2 pressed. Note that the first spin-box will only permit\ 27 | you to type in integers, and the third selects from a list of\ 28 | Australian cities." 29 | pack $w.msg -side top 30 | 31 | ## See Code / Dismiss buttons 32 | set btns [addSeeDismiss $w.buttons $w] 33 | pack $btns -side bottom -fill x 34 | 35 | set australianCities { 36 | Canberra Sydney Melbourne Perth Adelaide Brisbane 37 | Hobart Darwin "Alice Springs" 38 | } 39 | 40 | spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \ 41 | -validatecommand {string is integer %P} 42 | spinbox $w.s2 -from 0 -to 3 -increment .5 -format %05.2f -width 10 43 | spinbox $w.s3 -values $australianCities -width 10 44 | 45 | pack $w.s1 $w.s2 $w.s3 -side top -pady 3p -padx 7.5p 46 | -------------------------------------------------------------------------------- /doc/optionMenu.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1994 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH tk_optionMenu n 4.0 Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | '\" Note: do not modify the .SH NAME line immediately below! 12 | .SH NAME 13 | tk_optionMenu \- Create an option menubutton and its menu 14 | .SH SYNOPSIS 15 | \fBtk_optionMenu \fIpathName varName value \fR?\fIvalue value ...\fR? 16 | .BE 17 | .SH DESCRIPTION 18 | .PP 19 | This procedure creates an option menubutton whose name is \fIpathName\fR, 20 | plus an associated menu. 21 | Together they allow the user to select one of the values 22 | given by the \fIvalue\fR arguments. 23 | The current value will be stored in the global variable whose 24 | name is given by \fIvarName\fR and it will also be displayed as the label 25 | in the option menubutton. 26 | The user can click on the menubutton to display a menu containing 27 | all of the \fIvalue\fRs and thereby select a new value. 28 | Once a new value is selected, it will be stored in the variable 29 | and appear in the option menubutton. 30 | The current value can also be changed by setting the variable. 31 | .PP 32 | The return value from \fBtk_optionMenu\fR is the name of the menu 33 | associated with \fIpathName\fR, so that the caller can change its 34 | configuration options or manipulate it in other ways. 35 | .SH EXAMPLE 36 | .PP 37 | .CS 38 | tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble 39 | pack .foo 40 | .CE 41 | .SH KEYWORDS 42 | option menu 43 | '\" Local Variables: 44 | '\" mode: nroff 45 | '\" End: 46 | -------------------------------------------------------------------------------- /library/optMenu.tcl: -------------------------------------------------------------------------------- 1 | # optMenu.tcl -- 2 | # 3 | # This file defines the procedure tk_optionMenu, which creates 4 | # an option button and its associated menu. 5 | # 6 | # Copyright © 1994 The Regents of the University of California. 7 | # Copyright © 1994 Sun Microsystems, Inc. 8 | # 9 | # See the file "license.terms" for information on usage and redistribution 10 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 11 | # 12 | 13 | # ::tk_optionMenu -- 14 | # This procedure creates an option button named $w and an associated 15 | # menu. Together they provide the functionality of Motif option menus: 16 | # they can be used to select one of many values, and the current value 17 | # appears in the global variable varName, as well as in the text of 18 | # the option menubutton. The name of the menu is returned as the 19 | # procedure's result, so that the caller can use it to change configuration 20 | # options on the menu or otherwise manipulate it. 21 | # 22 | # Arguments: 23 | # w - The name to use for the menubutton. 24 | # varName - Global variable to hold the currently selected value. 25 | # firstValue - First of legal values for option (must be >= 1). 26 | # args - Any number of additional values. 27 | 28 | proc ::tk_optionMenu {w varName firstValue args} { 29 | upvar #0 $varName var 30 | 31 | if {![info exists var]} { 32 | set var $firstValue 33 | } 34 | menubutton $w -textvariable $varName -indicatoron 1 -menu $w.menu \ 35 | -relief raised -highlightthickness 1 -anchor c \ 36 | -direction flush 37 | menu $w.menu -tearoff 0 38 | $w.menu add radiobutton -label $firstValue -variable $varName 39 | foreach i $args { 40 | $w.menu add radiobutton -label $i -variable $varName 41 | } 42 | return $w.menu 43 | } 44 | -------------------------------------------------------------------------------- /doc/GetUid.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_GetUid 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_GetUid, Tk_Uid \- convert from string to unique identifier 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Tk_Uid 18 | \fBTk_GetUid\fR(\fIstring\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AP char *string in 22 | String for which the corresponding unique identifier is 23 | desired. 24 | .BE 25 | .SH DESCRIPTION 26 | .PP 27 | \fBTk_GetUid\fR returns the unique identifier corresponding 28 | to \fIstring\fR. 29 | Unique identifiers are similar to atoms in Lisp, and are used 30 | in Tk to speed up comparisons and 31 | searches. A unique identifier (type Tk_Uid) is a string pointer 32 | and may be used anywhere that a variable of type 33 | .QW "char *" 34 | could be used. However, there is guaranteed to be exactly 35 | one unique identifier for any given string value. If \fBTk_GetUid\fR 36 | is called twice, once with string \fIa\fR and once with string 37 | \fIb\fR, and if \fIa\fR and \fIb\fR have the same string value 38 | (strcmp(a, b) == 0), then \fBTk_GetUid\fR will return exactly 39 | the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)). 40 | This means that variables of type 41 | Tk_Uid may be compared directly (x == y) without having to call 42 | \fBstrcmp\fR. 43 | In addition, the return value from \fBTk_GetUid\fR will have the 44 | same string value as its argument (strcmp(Tk_GetUid(a), a) == 0). 45 | .SH KEYWORDS 46 | atom, unique identifier 47 | -------------------------------------------------------------------------------- /doc/Restack.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_RestackWindow \- Change a window's position in the stacking order 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | int 18 | \fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AS Tk_Window aboveBelow 22 | .AP Tk_Window tkwin in 23 | Token for window to restack. 24 | .AP int aboveBelow in 25 | Indicates new position of \fItkwin\fR relative to \fIother\fR; 26 | must be \fBAbove\fR or \fBBelow\fR. 27 | .AP Tk_Window other in 28 | \fITkwin\fR will be repositioned just above or below this window. 29 | Must be a sibling of \fItkwin\fR or a descendant of a sibling. 30 | If NULL then \fItkwin\fR is restacked above or below all siblings. 31 | .BE 32 | .SH DESCRIPTION 33 | .PP 34 | \fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative 35 | to its siblings. 36 | If \fIother\fR is specified as NULL then \fIwindow\fR is repositioned 37 | at the top or bottom of its stacking order, depending on whether 38 | \fIaboveBelow\fR is \fBAbove\fR or \fBBelow\fR. 39 | If \fIother\fR has a non-NULL value then \fIwindow\fR is repositioned 40 | just above or below \fIother\fR. 41 | .PP 42 | The \fIaboveBelow\fR argument must have one of the symbolic values 43 | \fBAbove\fR or \fBBelow\fR. 44 | Both of these values are defined by the include file . 45 | .SH KEYWORDS 46 | above, below, obscure, stacking order 47 | -------------------------------------------------------------------------------- /generic/tkBusy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tkBusy.h -- 3 | * 4 | * This file defines the type of the structure describing a busy window. 5 | * 6 | * Copyright 1993-1998 Lucent Technologies, Inc. 7 | * 8 | * The "busy" command was created by George Howlett. Adapted for 9 | * integration into Tk by Jos Decoster and Donal K. Fellows. 10 | * 11 | * See the file "license.terms" for information on usage and redistribution of 12 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 13 | */ 14 | 15 | typedef struct Busy { 16 | Display *display; /* Display of busy window */ 17 | Tcl_Interp *interp; /* Interpreter where "busy" command was 18 | * created. It's used to key the searches in 19 | * the window hierarchy. See the "windows" 20 | * command. */ 21 | Tk_Window tkBusy; /* Busy window: Transparent window used to 22 | * block delivery of events to windows 23 | * underneath it. */ 24 | Tk_Window tkParent; /* Parent window of the busy window. It may be 25 | * the reference window (if the reference is a 26 | * toplevel) or a mutual ancestor of the 27 | * reference window */ 28 | Tk_Window tkRef; /* Reference window of the busy window. It is 29 | * used to manage the size and position of the 30 | * busy window. */ 31 | int x, y; /* Position of the reference window */ 32 | int width, height; /* Size of the reference window. Retained to 33 | * know if the reference window has been 34 | * reconfigured to a new size. */ 35 | int menuBar; /* Menu bar flag. */ 36 | Tk_Cursor cursor; /* Cursor for the busy window. */ 37 | Tcl_HashEntry *hashPtr; /* Used the delete the busy window entry out 38 | * of the global hash table. */ 39 | Tcl_HashTable *tablePtr; 40 | Tk_OptionTable optionTable; 41 | } Busy; 42 | -------------------------------------------------------------------------------- /win/wish.exe.manifest.in: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | Tcl/Tk windowing shell (wish) 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | true 37 | 38 | 39 | 40 | 41 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /doc/MapWindow.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_MapWindow 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_MapWindow, Tk_UnmapWindow \- map or unmap a window 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Tk_Window 18 | \fBTk_MapWindow\fR(\fItkwin\fR) 19 | .sp 20 | \fBTk_UnmapWindow\fR(\fItkwin\fR) 21 | .fi 22 | .SH ARGUMENTS 23 | .AS Tk_Window parent 24 | .AP Tk_Window tkwin in 25 | Token for window. 26 | .BE 27 | .SH DESCRIPTION 28 | .PP 29 | These procedures may be used to map and unmap windows 30 | managed by Tk. \fBTk_MapWindow\fR maps the window given 31 | by \fItkwin\fR, and also creates an X window corresponding 32 | to \fItkwin\fR if it does not already exist. See the 33 | \fBTk_CreateWindow\fR manual entry for information on 34 | deferred window creation. 35 | \fBTk_UnmapWindow\fR unmaps \fItkwin\fR's window 36 | from the screen. 37 | .PP 38 | If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was 39 | used to create a child window), then event handlers interested in map 40 | and unmap events are invoked immediately. If \fItkwin\fR is not an 41 | internal window, then the event handlers will be invoked later, after 42 | X has seen the request and returned an event for it. 43 | .PP 44 | These procedures should be used in place of the X procedures 45 | \fBXMapWindow\fR and \fBXUnmapWindow\fR, since they update 46 | Tk's local data structure for \fItkwin\fR. Applications 47 | using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR 48 | directly. 49 | .SH KEYWORDS 50 | map, unmap, window 51 | -------------------------------------------------------------------------------- /doc/chooseColor.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH tk_chooseColor n 4.2 Tk "Tk Built-In Commands" 8 | .so man.macros 9 | .BS 10 | '\" Note: do not modify the .SH NAME line immediately below! 11 | .SH NAME 12 | tk_chooseColor \- pops up a dialog box for the user to select a color. 13 | .SH SYNOPSIS 14 | \fBtk_chooseColor \fR?\fIoption value ...\fR? 15 | .BE 16 | .SH DESCRIPTION 17 | .PP 18 | The procedure \fBtk_chooseColor\fR pops up a dialog box for the 19 | user to select a color. The following \fIoption\-value\fR pairs are 20 | possible as command line arguments: 21 | .\" OPTION: -initialcolor 22 | .TP 23 | \fB\-initialcolor\fI color\fR 24 | . 25 | Specifies the color to display in the color dialog when it pops 26 | up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR 27 | function. 28 | .\" OPTION: -parent 29 | .TP 30 | \fB\-parent\fI window\fR 31 | . 32 | Makes \fIwindow\fR the logical parent of the color dialog. The color 33 | dialog is displayed on top of its parent window. 34 | .\" OPTION: -title 35 | .TP 36 | \fB\-title\fI titleString\fR 37 | . 38 | Specifies a string to display as the title of the dialog box. If this 39 | option is not specified, then a default title will be displayed. 40 | .LP 41 | If the user selects a color, \fBtk_chooseColor\fR will return the 42 | name of the color in a form acceptable to \fBTk_GetColor\fR. If the 43 | user cancels the operation, both commands will return the empty 44 | string. 45 | .SH EXAMPLE 46 | .PP 47 | .CS 48 | button .b -bg [tk_chooseColor -initialcolor gray -title "Choose color"] 49 | .CE 50 | .SH KEYWORDS 51 | color, color selection, dialog 52 | '\" Local Variables: 53 | '\" mode: nroff 54 | '\" End: 55 | -------------------------------------------------------------------------------- /doc/CoordToWin.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1993 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_CoordsToWindow \- Find window containing a point 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Tk_Window 18 | \fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AS Tk_Window tkwin 22 | .AP int rootX in 23 | X-coordinate (in root window coordinates). 24 | .AP int rootY in 25 | Y-coordinate (in root window coordinates). 26 | .AP Tk_Window tkwin in 27 | Token for window that identifies application. 28 | .BE 29 | .SH DESCRIPTION 30 | .PP 31 | \fBTk_CoordsToWindow\fR locates the window that contains a given point. 32 | The point is specified in root coordinates with \fIrootX\fR and 33 | \fIrootY\fR (if a virtual-root window manager is in use then 34 | \fIrootX\fR and \fIrootY\fR are in the coordinate system of the 35 | virtual root window). 36 | The return value from the procedure is a token for the window that 37 | contains the given point. 38 | If the point is not in any window, or if the containing window 39 | is not in the same application as \fItkwin\fR, then NULL is 40 | returned. 41 | .PP 42 | The containing window is decided using the same rules that determine 43 | which window contains the mouse cursor: if a parent and a child both 44 | contain the point then the child gets preference, and if two siblings 45 | both contain the point then the highest one in the stacking order 46 | (i.e. the one that's visible on the screen) gets preference. 47 | .SH KEYWORDS 48 | containing, coordinates, root window 49 | -------------------------------------------------------------------------------- /library/demos/vscale.tcl: -------------------------------------------------------------------------------- 1 | # vscale.tcl -- 2 | # 3 | # This demonstration script shows an example with a vertical scale. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .vscale 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Vertical Scale Demonstration" 15 | wm iconname $w "vscale" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 3.5i -justify left -text "An arrow and a vertical scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the size of the arrow." 19 | pack $w.msg -side top -padx .5c 20 | 21 | ## See Code / Dismiss buttons 22 | set btns [addSeeDismiss $w.buttons $w] 23 | pack $btns -side bottom -fill x 24 | 25 | frame $w.frame -borderwidth 7.5p 26 | pack $w.frame 27 | 28 | scale $w.frame.scale -orient vertical -length 213p -from 0 -to 250 \ 29 | -command "setHeight $w.frame.canvas" -tickinterval 50 30 | canvas $w.frame.canvas -width 37.5p -height 37.5p -bd 0 -highlightthickness 0 31 | $w.frame.canvas create polygon 0 0 1 1 2 2 -fill SeaGreen3 -tags poly 32 | $w.frame.canvas create line 0 0 1 1 2 2 0 0 -fill black -tags line 33 | frame $w.frame.right -borderwidth 11.25p 34 | pack $w.frame.scale -side left -anchor ne 35 | pack $w.frame.canvas -side left -anchor nw -fill y 36 | $w.frame.scale set 75 37 | 38 | proc setHeight {w height} { 39 | incr height 21 40 | set y2 [expr {$height - 30}] 41 | if {$y2 < 21} { 42 | set y2 21 43 | } 44 | $w coords poly 15 20 35 20 35 $y2 45 $y2 25 $height 5 $y2 15 $y2 15 20 45 | $w coords line 15 20 35 20 35 $y2 45 $y2 25 $height 5 $y2 15 $y2 15 20 46 | 47 | set scaleFactor [expr {$tk::scalingPct / 100.0}] 48 | $w scale poly 0 0 $scaleFactor $scaleFactor 49 | $w scale line 0 0 $scaleFactor $scaleFactor 50 | } 51 | -------------------------------------------------------------------------------- /doc/HandleEvent.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1992 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_HandleEvent \- invoke event handlers for window system events 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_HandleEvent\fR(\fIeventPtr\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS XEvent *eventPtr 21 | .AP XEvent *eventPtr in 22 | Pointer to X event to dispatch to relevant handler(s). It is important 23 | that all unused fields of the structure be set to zero. 24 | .BE 25 | .SH DESCRIPTION 26 | .PP 27 | \fBTk_HandleEvent\fR is a lower-level procedure that deals with window 28 | events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by 29 | \fBTcl_DoOneEvent\fR), and in a few other cases within Tk. 30 | It makes callbacks to any window event 31 | handlers (created by calls to \fBTk_CreateEventHandler\fR) 32 | that match \fIeventPtr\fR and then returns. In some cases 33 | it may be useful for an application to bypass the Tk event 34 | queue and call \fBTk_HandleEvent\fR directly instead of 35 | calling \fBTcl_QueueEvent\fR followed by 36 | \fBTcl_ServiceEvent\fR. 37 | .PP 38 | This procedure may be invoked recursively. For example, 39 | it is possible to invoke \fBTk_HandleEvent\fR recursively 40 | from a handler called by \fBTk_HandleEvent\fR. This sort 41 | of operation is useful in some modal situations, such 42 | as when a 43 | notifier has been popped up and an application wishes to 44 | wait for the user to click a button in the notifier before 45 | doing anything else. 46 | .SH KEYWORDS 47 | callback, event, handler, window 48 | -------------------------------------------------------------------------------- /library/demos/hscale.tcl: -------------------------------------------------------------------------------- 1 | # hscale.tcl -- 2 | # 3 | # This demonstration script shows an example with a horizontal scale. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .hscale 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Horizontal Scale Demonstration" 15 | wm iconname $w "hscale" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 3.5i -justify left -text "An arrow and a horizontal scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the length of the arrow." 19 | pack $w.msg -side top -padx .5c 20 | 21 | ## See Code / Dismiss buttons 22 | set btns [addSeeDismiss $w.buttons $w] 23 | pack $btns -side bottom -fill x 24 | 25 | frame $w.frame -borderwidth 7.5p 26 | pack $w.frame -side top -fill x 27 | 28 | canvas $w.frame.canvas -width 37.5p -height 37.5p -bd 0 -highlightthickness 0 29 | $w.frame.canvas create polygon 0 0 1 1 2 2 -fill DeepSkyBlue3 -tags poly 30 | $w.frame.canvas create line 0 0 1 1 2 2 0 0 -fill black -tags line 31 | scale $w.frame.scale -orient horizontal -length 213p -from 0 -to 250 \ 32 | -command "setWidth $w.frame.canvas" -tickinterval 50 33 | pack $w.frame.canvas -side top -expand yes -anchor s -fill x -padx 12p 34 | pack $w.frame.scale -side bottom -expand yes -anchor n 35 | $w.frame.scale set 75 36 | 37 | proc setWidth {w width} { 38 | incr width 21 39 | set x2 [expr {$width - 30}] 40 | if {$x2 < 21} { 41 | set x2 21 42 | } 43 | $w coords poly 20 15 20 35 $x2 35 $x2 45 $width 25 $x2 5 $x2 15 20 15 44 | $w coords line 20 15 20 35 $x2 35 $x2 45 $width 25 $x2 5 $x2 15 20 15 45 | 46 | set scaleFactor [expr {$tk::scalingPct / 100.0}] 47 | $w scale poly 0 0 $scaleFactor $scaleFactor 48 | $w scale line 0 0 $scaleFactor $scaleFactor 49 | } 50 | -------------------------------------------------------------------------------- /doc/GetPixmap.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Pixmap 18 | \fBTk_GetPixmap\fR(\fIdisplay, d, width, height, depth\fR) 19 | .sp 20 | \fBTk_FreePixmap\fR(\fIdisplay, pixmap\fR) 21 | .fi 22 | .SH ARGUMENTS 23 | .AS "Drawable" *pixelPtr 24 | .AP Display *display in 25 | X display for the pixmap. 26 | .AP Drawable d in 27 | Pixmap or window where the new pixmap will be used for drawing. 28 | .AP "int" width in 29 | Width of pixmap. 30 | .AP "int" height in 31 | Height of pixmap. 32 | .AP "int" depth in 33 | Number of bits per pixel in pixmap. 34 | .AP Pixmap pixmap in 35 | Pixmap to destroy. 36 | .BE 37 | .SH DESCRIPTION 38 | .PP 39 | These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR 40 | and \fBXFreePixmap\fR, except that they have extra code to manage X 41 | resource identifiers so that identifiers for deleted pixmaps can be 42 | reused in the future. 43 | It is important for Tk applications to use these procedures rather 44 | than \fBXCreatePixmap\fR and \fBXFreePixmap\fR; otherwise long-running 45 | applications may run out of resource identifiers. 46 | .PP 47 | \fBTk_GetPixmap\fR creates a pixmap suitable for drawing in \fId\fR, 48 | with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR, 49 | and returns its identifier. 50 | \fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes 51 | its resource identifier available for reuse. 52 | .SH KEYWORDS 53 | pixmap, resource identifier 54 | -------------------------------------------------------------------------------- /win/rc/tk.rc: -------------------------------------------------------------------------------- 1 | // 2 | // Version Resource Script 3 | // 4 | 5 | #include 6 | #include 7 | 8 | // 9 | // build-up the name suffix that defines the type of build this is. 10 | // 11 | #if DEBUG && !UNCHECKED 12 | #define SUFFIX_DEBUG "g" 13 | #else 14 | #define SUFFIX_DEBUG "" 15 | #endif 16 | 17 | #define SUFFIX SUFFIX_DEBUG 18 | 19 | 20 | VS_VERSION_INFO VERSIONINFO 21 | FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 22 | PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 23 | FILEFLAGSMASK 0x3fL 24 | #ifdef DEBUG 25 | FILEFLAGS VS_FF_DEBUG 26 | #else 27 | FILEFLAGS 0x0L 28 | #endif 29 | FILEOS VOS__WINDOWS32 30 | FILETYPE VFT_DLL 31 | FILESUBTYPE 0x0L 32 | BEGIN 33 | BLOCK "StringFileInfo" 34 | BEGIN 35 | BLOCK "040904b0" 36 | BEGIN 37 | VALUE "FileDescription", "Tk DLL\0" 38 | VALUE "OriginalFilename", "tk" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".dll\0" 39 | VALUE "FileVersion", TK_PATCH_LEVEL 40 | VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" 41 | VALUE "ProductName", "Tk " TK_VERSION " for Windows\0" 42 | VALUE "ProductVersion", TK_PATCH_LEVEL 43 | END 44 | END 45 | BLOCK "VarFileInfo" 46 | BEGIN 47 | VALUE "Translation", 0x409, 1200 48 | END 49 | END 50 | 51 | // 52 | // Include the base resources. 53 | // 54 | 55 | #include "tk_base.rc" 56 | 57 | // 58 | // This enables themed scrollbars in XP by trying to use comctl32 v6. 59 | // 60 | 61 | #ifndef RT_MANIFEST 62 | #define RT_MANIFEST 24 63 | #endif 64 | #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID 65 | #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 66 | #endif 67 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest" 68 | -------------------------------------------------------------------------------- /macosx/Wish.sdef: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /library/demos/label.tcl: -------------------------------------------------------------------------------- 1 | # label.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window containing 4 | # several label widgets. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .label 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Label Demonstration" 16 | wm iconname $w "label" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 4i -justify left -text "Five labels are displayed below: three textual ones on the left, and an image label and a text label on the right. Labels are pretty boring because you can't do anything with them." 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | set btns [addSeeDismiss $w.buttons $w] 24 | pack $btns -side bottom -fill x 25 | 26 | frame $w.left 27 | frame $w.right 28 | pack $w.left $w.right -side left -expand yes -padx 7.5p -pady 7.5p -fill both 29 | 30 | label $w.left.l1 -text "First label" 31 | label $w.left.l2 -text "Second label, raised" -relief raised 32 | label $w.left.l3 -text "Third label, sunken" -relief sunken 33 | pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -pady 1.5p -anchor w 34 | 35 | # Main widget program sets variable tk_demoDirectory 36 | image create photo label.ousterhout \ 37 | -file [file join $tk_demoDirectory images ouster.png] 38 | 39 | # Create a copy of the image just created, magnified according to the 40 | # display's DPI scaling level. Since the zooom factor must be an integer, 41 | # the copy will only be effectively magnified if $tk::scalingPct >= 200. 42 | image create photo label.ousterhout2 43 | label.ousterhout2 copy label.ousterhout -zoom [expr {$tk::scalingPct / 100}] 44 | 45 | label $w.right.picture -borderwidth 2 -relief sunken -image label.ousterhout2 46 | label $w.right.caption -text "Tcl/Tk Creator" 47 | pack $w.right.picture $w.right.caption -side top 48 | -------------------------------------------------------------------------------- /library/demos/ttkspin.tcl: -------------------------------------------------------------------------------- 1 | # ttkspin.tcl -- 2 | # 3 | # This demonstration script creates several Ttk spinbox widgets. 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .ttkspin 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Themed Spinbox Demonstration" 15 | wm iconname $w "ttkspin" 16 | positionWindow $w 17 | 18 | ttk::label $w.msg -font $font -wraplength 5i -justify left -text "Three different\ 19 | themed spin-boxes are displayed below. You can add characters by\ 20 | pointing, clicking and typing. The normal Motif editing characters\ 21 | are supported, along with many Emacs bindings. For example, Backspace\ 22 | and Control-h delete the character to the left of the insertion\ 23 | cursor and Delete and Control-d delete the chararacter to the right\ 24 | of the insertion cursor. For values that are too large to fit in the\ 25 | window all at once, you can scan through the value by dragging with\ 26 | mouse button2 pressed. Note that the first spin-box will only permit\ 27 | you to type in integers, and the third selects from a list of\ 28 | Australian cities." 29 | pack $w.msg -side top 30 | 31 | ## See Code / Dismiss buttons 32 | set btns [addSeeDismiss $w.buttons $w] 33 | pack $btns -side bottom -fill x 34 | 35 | ttk::frame $w.f 36 | pack $w.f -fill both -expand 1 37 | set w $w.f 38 | 39 | set australianCities { 40 | Canberra Sydney Melbourne Perth Adelaide Brisbane 41 | Hobart Darwin "Alice Springs" 42 | } 43 | 44 | ttk::spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \ 45 | -validatecommand {string is integer %P} 46 | ttk::spinbox $w.s2 -from 0 -to 3 -increment .5 -format %05.2f -width 10 47 | ttk::spinbox $w.s3 -values $australianCities -width 10 48 | 49 | $w.s1 set 1 50 | $w.s2 set 00.00 51 | $w.s3 set Canberra 52 | 53 | pack $w.s1 $w.s2 $w.s3 -side top -pady 3p -padx 7.5p 54 | -------------------------------------------------------------------------------- /generic/ttk/ttkThemeInt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Theme engine: private definitions. 3 | * 4 | * Copyright © 2004 Joe English. Freely redistributable. 5 | */ 6 | 7 | #ifndef _TTKTHEMEINT 8 | #define _TTKTHEMEINT 9 | 10 | #include "ttkTheme.h" 11 | 12 | typedef struct Ttk_TemplateNode_ Ttk_TemplateNode, *Ttk_LayoutTemplate; 13 | 14 | MODULE_SCOPE Ttk_ElementClass *Ttk_GetElement(Ttk_Theme, const char *name); 15 | MODULE_SCOPE const char *Ttk_ElementClassName(Ttk_ElementClass *); 16 | 17 | MODULE_SCOPE void Ttk_ElementSize( 18 | Ttk_ElementClass *, Ttk_Style, void *recordPtr, Tk_OptionTable, 19 | Tk_Window tkwin, Ttk_State state, 20 | int *widthPtr, int *heightPtr, Ttk_Padding*); 21 | MODULE_SCOPE void Ttk_DrawElement( 22 | Ttk_ElementClass *, Ttk_Style, void *recordPtr, Tk_OptionTable, 23 | Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state); 24 | 25 | MODULE_SCOPE Tcl_Obj *Ttk_QueryStyle( 26 | Ttk_Style, void *, Tk_OptionTable, const char *, Ttk_State state); 27 | 28 | MODULE_SCOPE Ttk_LayoutTemplate Ttk_ParseLayoutTemplate( 29 | Tcl_Interp *, Tcl_Obj *); 30 | MODULE_SCOPE Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_LayoutTemplate); 31 | MODULE_SCOPE Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec); 32 | MODULE_SCOPE void Ttk_FreeLayoutTemplate(Ttk_LayoutTemplate); 33 | MODULE_SCOPE void Ttk_RegisterLayoutTemplate( 34 | Ttk_Theme theme, const char *layoutName, Ttk_LayoutTemplate); 35 | 36 | MODULE_SCOPE Ttk_Style Ttk_GetStyle(Ttk_Theme themePtr, const char *styleName); 37 | MODULE_SCOPE Ttk_LayoutTemplate Ttk_FindLayoutTemplate( 38 | Ttk_Theme themePtr, const char *layoutName); 39 | 40 | MODULE_SCOPE const char *Ttk_StyleName(Ttk_Style); 41 | 42 | MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp); 43 | 44 | MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); 45 | 46 | #define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL 47 | 48 | #endif /* _TTKTHEMEINT */ 49 | -------------------------------------------------------------------------------- /doc/GetVRoot.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_GetVRootGeometry \- Get location and size of virtual root for window 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_GetVRootGeometry\fR(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_Window heightPtr 21 | .AP Tk_Window tkwin in 22 | Token for window whose virtual root is to be queried. 23 | .AP int xPtr out 24 | Points to word in which to store x-offset of virtual root. 25 | .AP int yPtr out 26 | Points to word in which to store y-offset of virtual root. 27 | .AP "int" widthPtr out 28 | Points to word in which to store width of virtual root. 29 | .AP "int" heightPtr out 30 | Points to word in which to store height of virtual root. 31 | .BE 32 | .SH DESCRIPTION 33 | .PP 34 | \fBTk_GetVRootGeometry\fR returns geometry information about the virtual 35 | root window associated with \fItkwin\fR. The 36 | .QW associated 37 | virtual root is the one in which \fItkwin\fR's nearest top-level ancestor (or 38 | \fItkwin\fR itself if it is a top-level window) has 39 | been reparented by the window manager. This window is identified by 40 | a \fB__SWM_ROOT\fR or \fB__WM_ROOT\fR property placed on the top-level 41 | window by the window manager. 42 | If \fItkwin\fR is not associated with a virtual root (e.g. 43 | because the window manager does not use virtual roots) then *\fIxPtr\fR and 44 | *\fIyPtr\fR will be set to 0 and *\fIwidthPtr\fR and *\fIheightPtr\fR 45 | will be set to the dimensions of the screen containing \fItkwin\fR. 46 | .SH KEYWORDS 47 | geometry, height, location, virtual root, width, window manager 48 | -------------------------------------------------------------------------------- /tests/canvPsArc.tcl: -------------------------------------------------------------------------------- 1 | # This file creates a screen to exercise Postscript generation 2 | # for bitmaps in canvases. It is part of the Tk visual test suite, 3 | # which is invoked via the "visual" script. 4 | 5 | catch {destroy .t} 6 | toplevel .t 7 | wm title .t "Postscript Tests for Canvases" 8 | wm iconname .t "Postscript" 9 | wm geom .t +0+0 10 | wm minsize .t 1 1 11 | 12 | set c .t.c 13 | 14 | message .t.m -text {This screen exercises the Postscript-generation abilities of Tk canvas widgets for arcs. Click on "Print" to print the canvas to your default printer. You can click on items in the canvas to delete them.} -width 6i 15 | pack .t.m -side top -fill both 16 | 17 | frame .t.bot 18 | pack .t.bot -side bottom -fill both 19 | button .t.bot.quit -text Quit -command {destroy .t} 20 | button .t.bot.print -text Print -command "lpr $c" 21 | pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1 22 | 23 | canvas $c -width 6i -height 6i -bd 2 -relief sunken 24 | pack $c -expand yes -fill both -padx 2m -pady 2m 25 | 26 | $c create arc .5i .5i 2i 2i -style pieslice -start 20 -extent 90 \ 27 | -fill black -outline {} 28 | $c create arc 2.5i 0 4.5i 1i -style pieslice -start -45 -extent -135 \ 29 | -fill {} -outline black -outlinestipple gray50 -width 3m 30 | $c create arc 5.0i .5i 6.5i 2i -style pieslice -start 45 -extent 315 \ 31 | -fill black -stipple gray25 -outline black -width 1m 32 | 33 | $c create arc -.5i 2.5i 2.0i 3.5i -style chord -start 90 -extent 270 \ 34 | -fill black -outline {} 35 | $c create arc 2.5i 2i 4i 6i -style chord -start 20 -extent 140 \ 36 | -fill black -stipple gray50 -outline black -width 2m 37 | $c create arc 4i 2.5i 8i 4.5i -style chord -start 60 -extent 60 \ 38 | -fill {} -outline black 39 | 40 | $c create arc .5i 4.5i 2i 6i -style arc -start 135 -extent 315 -width 3m \ 41 | -outline black -outlinestipple gray25 42 | $c create arc 3.5i 4.5i 5.5i 5.5i -style arc -start 45 -extent -90 -width 1m \ 43 | -outline black 44 | -------------------------------------------------------------------------------- /tests/flagup.xbm: -------------------------------------------------------------------------------- 1 | #define flagup_width 48 2 | #define flagup_height 48 3 | static char flagup_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 5 | 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00, 6 | 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00, 7 | 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00, 8 | 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00, 9 | 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00, 10 | 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00, 11 | 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00, 12 | 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00, 13 | 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00, 14 | 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 15 | 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00, 16 | 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00, 17 | 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00, 18 | 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, 19 | 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a, 20 | 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a, 21 | 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a, 22 | 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 23 | 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 24 | 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 25 | 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a, 26 | 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a, 27 | 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 28 | -------------------------------------------------------------------------------- /xlib/ximage.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ximage.c -- 3 | * 4 | * X bitmap and image routines. 5 | * 6 | * Copyright © 1995 Sun Microsystems, Inc. 7 | * 8 | * See the file "license.terms" for information on usage and redistribution of 9 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 10 | */ 11 | 12 | #include "tkInt.h" 13 | 14 | /* 15 | *---------------------------------------------------------------------- 16 | * 17 | * XCreateBitmapFromData -- 18 | * 19 | * Construct a single plane pixmap from bitmap data. 20 | * 21 | * NOTE: This procedure has the correct behavior on Windows and the 22 | * Macintosh, but not on UNIX. This is probably because the emulation for 23 | * XPutImage on those platforms compensates for whatever is wrong here 24 | * :-) 25 | * 26 | * Results: 27 | * Returns a new Pixmap. 28 | * 29 | * Side effects: 30 | * Allocates a new bitmap and drawable. 31 | * 32 | *---------------------------------------------------------------------- 33 | */ 34 | 35 | Pixmap 36 | XCreateBitmapFromData( 37 | Display *display, 38 | Drawable d, 39 | _Xconst char *data, 40 | unsigned int width, 41 | unsigned int height) 42 | { 43 | XImage *ximage; 44 | GC gc; 45 | Pixmap pix; 46 | 47 | pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1); 48 | gc = XCreateGC(display, pix, 0, NULL); 49 | if (gc == NULL) { 50 | Tk_FreePixmap(display, pix); 51 | return None; 52 | } 53 | ximage = XCreateImage(display, NULL, 1, XYBitmap, 0, (char*) data, width, 54 | height, 8, ((int)width + 7) / 8); 55 | if (ximage) { 56 | ximage->bitmap_bit_order = LSBFirst; 57 | _XInitImageFuncPtrs(ximage); 58 | TkPutImage(NULL, 0, display, pix, gc, ximage, 0, 0, 0, 0, width, height); 59 | ximage->data = NULL; 60 | XDestroyImage(ximage); 61 | } 62 | XFreeGC(display, gc); 63 | return pix; 64 | } 65 | 66 | /* 67 | * Local Variables: 68 | * mode: c 69 | * c-basic-offset: 4 70 | * fill-column: 78 71 | * End: 72 | */ 73 | -------------------------------------------------------------------------------- /tests/flagdown.xbm: -------------------------------------------------------------------------------- 1 | #define flagdown_width 48 2 | #define flagdown_height 48 3 | static char flagdown_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 6 | 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00, 7 | 0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, 8 | 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 9 | 0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07, 10 | 0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07, 11 | 0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07, 12 | 0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03, 13 | 0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00, 14 | 0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00, 15 | 0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 16 | 0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 17 | 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00, 18 | 0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, 19 | 0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, 20 | 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00, 21 | 0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00, 22 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 23 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 24 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 25 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 26 | 0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a, 27 | 0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19}; 28 | -------------------------------------------------------------------------------- /doc/SetVisual.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1992 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_SetWindowVisual \- change visual characteristics of window 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | int 18 | \fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR) 19 | .fi 20 | .SH ARGUMENTS 21 | .AS "Tk_Window int" colormap 22 | .AP Tk_Window tkwin in 23 | Token for window. 24 | .AP Visual *visual in 25 | New visual type to use for \fItkwin\fR. 26 | .AP "int" depth in 27 | Number of bits per pixel desired for \fItkwin\fR. 28 | .AP Colormap colormap in 29 | New colormap for \fItkwin\fR, which must be compatible with 30 | \fIvisual\fR and \fIdepth\fR. 31 | .BE 32 | .SH DESCRIPTION 33 | .PP 34 | When Tk creates a new window it assigns it the default visual 35 | characteristics (visual, depth, and colormap) for its screen. 36 | \fBTk_SetWindowVisual\fR may be called to change them. 37 | \fBTk_SetWindowVisual\fR must be called before the window has 38 | actually been created in X (e.g. before \fBTk_MapWindow\fR or 39 | \fBTk_MakeWindowExist\fR has been invoked for the window). 40 | The safest thing is to call \fBTk_SetWindowVisual\fR immediately 41 | after calling \fBTk_CreateWindow\fR. 42 | If \fItkwin\fR has already been created before \fBTk_SetWindowVisual\fR 43 | is called then it returns 0 and does not make any changes; otherwise 44 | it returns 1 to signify that the operation 45 | completed successfully. 46 | .PP 47 | Note that \fBTk_SetWindowVisual\fR should not be called if you just want 48 | to change a window's colormap without changing its visual or depth; 49 | call \fBTk_SetWindowColormap\fR instead. 50 | .SH KEYWORDS 51 | colormap, depth, visual 52 | -------------------------------------------------------------------------------- /library/demos/images/flagup.xbm: -------------------------------------------------------------------------------- 1 | #define flagup_width 48 2 | #define flagup_height 48 3 | static char flagup_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 5 | 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00, 6 | 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00, 7 | 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00, 8 | 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00, 9 | 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00, 10 | 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00, 11 | 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00, 12 | 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00, 13 | 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00, 14 | 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 15 | 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00, 16 | 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00, 17 | 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00, 18 | 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, 19 | 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a, 20 | 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a, 21 | 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a, 22 | 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 23 | 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 24 | 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a, 25 | 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a, 26 | 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a, 27 | 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 28 | -------------------------------------------------------------------------------- /doc/OwnSelect.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990-1994 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_OwnSelection \- make a window the owner of the primary selection 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) 18 | .fi 19 | .SH ARGUMENTS 20 | .AS Tk_LostSelProc clientData 21 | .AP Tk_Window tkwin in 22 | Window that is to become new selection owner. 23 | .AP Atom selection in 24 | The name of the selection to be owned, such as XA_PRIMARY. 25 | .AP Tk_LostSelProc *proc in 26 | Procedure to invoke when \fItkwin\fR loses selection ownership later. 27 | .AP void *clientData in 28 | Arbitrary one-word value to pass to \fIproc\fR. 29 | .BE 30 | .SH DESCRIPTION 31 | .PP 32 | \fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the 33 | new owner of the selection specified by the atom 34 | \fIselection\fR. After this call completes, future requests 35 | for the selection will be directed to handlers created for 36 | \fItkwin\fR using \fBTk_CreateSelHandler\fR. When \fItkwin\fR 37 | eventually loses the selection ownership, \fIproc\fR will be 38 | invoked so that the window can clean itself up (e.g. by 39 | unhighlighting the selection). \fIProc\fR should have arguments and 40 | result that match the type \fBTk_LostSelProc\fR: 41 | .CS 42 | typedef void \fBTk_LostSelProc\fR( 43 | void *\fIclientData\fR); 44 | .CE 45 | The \fIclientData\fR parameter to \fIproc\fR is a copy of the 46 | \fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is 47 | usually a pointer to a data structure containing application-specific 48 | information about \fItkwin\fR. 49 | .SH KEYWORDS 50 | own, selection owner 51 | -------------------------------------------------------------------------------- /library/demos/images/letters.xbm: -------------------------------------------------------------------------------- 1 | #define letters_width 48 2 | #define letters_height 48 3 | static char letters_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 9 | 0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 10 | 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e, 11 | 0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21, 12 | 0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21, 13 | 0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21, 14 | 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, 15 | 0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21, 16 | 0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21, 17 | 0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21, 18 | 0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f, 19 | 0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 20 | 0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 21 | 0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 22 | 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 23 | 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 24 | 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 28 | -------------------------------------------------------------------------------- /library/demos/fontchoose.tcl: -------------------------------------------------------------------------------- 1 | # fontchoose.tcl -- 2 | # 3 | # Show off the stock font selector dialog 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .fontchoose 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Font Selection Dialog" 15 | wm iconname $w "fontchooser" 16 | positionWindow $w 17 | 18 | catch {font create FontchooseDemoFont {*}[font actual TkDefaultFont]} 19 | 20 | # The font chooser needs to be configured and then shown. 21 | proc SelectFont {parent} { 22 | tk fontchooser configure -font FontchooseDemoFont \ 23 | -command ApplyFont -parent $parent 24 | tk fontchooser show 25 | } 26 | 27 | proc ApplyFont {font} { 28 | font configure FontchooseDemoFont {*}[font actual $font] 29 | } 30 | 31 | # When the visibility of the fontchooser changes, the following event is fired 32 | # to the parent widget. 33 | # 34 | bind $w <> { 35 | if {[tk fontchooser configure -visible]} { 36 | %W.f.font state disabled 37 | } else { 38 | %W.f.font state !disabled 39 | } 40 | } 41 | 42 | 43 | set f [ttk::frame $w.f -relief sunken -padding 1.5p] 44 | 45 | text $f.msg -font FontchooseDemoFont -width 40 -height 6 -borderwidth 0 \ 46 | -yscrollcommand [list $f.vs set] 47 | ttk::scrollbar $f.vs -command [list $f.msg yview] 48 | 49 | $f.msg insert end "Press the buttons below to choose a new font for the\ 50 | text shown in this window.\n" {} 51 | 52 | ttk::button $f.font -text "Set font ..." -command [list SelectFont $w] 53 | 54 | grid $f.msg $f.vs -sticky news 55 | grid $f.font - -sticky e 56 | grid columnconfigure $f 0 -weight 1 57 | grid rowconfigure $f 0 -weight 1 58 | 59 | ## See Code / Dismiss buttons 60 | set btns [addSeeDismiss $w.buttons $w] 61 | 62 | grid $f -sticky news 63 | grid $btns -sticky ew 64 | grid columnconfigure $w 0 -weight 1 65 | grid rowconfigure $w 0 -weight 1 66 | update idletasks 67 | grid propagate $f 0 68 | -------------------------------------------------------------------------------- /library/demos/images/flagdown.xbm: -------------------------------------------------------------------------------- 1 | #define flagdown_width 48 2 | #define flagdown_height 48 3 | static char flagdown_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 6 | 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00, 7 | 0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, 8 | 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 9 | 0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07, 10 | 0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07, 11 | 0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07, 12 | 0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03, 13 | 0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00, 14 | 0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00, 15 | 0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 16 | 0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 17 | 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00, 18 | 0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00, 19 | 0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00, 20 | 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00, 21 | 0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00, 22 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 23 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 24 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 25 | 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 26 | 0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a, 27 | 0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19}; 28 | -------------------------------------------------------------------------------- /library/demos/images/noletter.xbm: -------------------------------------------------------------------------------- 1 | #define noletters_width 48 2 | #define noletters_height 48 3 | static char noletters_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 5 | 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 6 | 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, 7 | 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, 8 | 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07, 9 | 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e, 10 | 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c, 11 | 0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38, 12 | 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70, 13 | 0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70, 14 | 0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0, 15 | 0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0, 16 | 0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0, 17 | 0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0, 18 | 0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70, 19 | 0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 0x40, 0x70, 20 | 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38, 21 | 0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c, 22 | 0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e, 23 | 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07, 24 | 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01, 25 | 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00, 26 | 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 27 | 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00}; 28 | -------------------------------------------------------------------------------- /library/demos/browse: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # the next line restarts using wish \ 3 | exec wish "$0" ${1+"$@"} 4 | 5 | # browse -- 6 | # This script generates a directory browser, which lists the working 7 | # directory and allows you to open files or subdirectories by 8 | # double-clicking. 9 | 10 | package require tk 11 | 12 | # Create a scrollbar on the right side of the main window and a listbox 13 | # on the left side. 14 | 15 | scrollbar .scroll -command ".list yview" 16 | pack .scroll -side right -fill y 17 | listbox .list -yscroll ".scroll set" -relief sunken -width 20 -height 20 \ 18 | -setgrid 1 19 | pack .list -side left -fill both -expand yes 20 | wm minsize . 1 1 21 | 22 | # The procedure below is invoked to open a browser on a given file; if the 23 | # file is a directory then another instance of this program is invoked; if 24 | # the file is a regular file then the Mx editor is invoked to display 25 | # the file. 26 | 27 | set browseScript [file join [pwd] $argv0] 28 | proc browse {dir file} { 29 | global env browseScript 30 | if {[string compare $dir "."] != 0} {set file $dir/$file} 31 | switch [file type $file] { 32 | directory { 33 | exec [info nameofexecutable] $browseScript $file & 34 | } 35 | file { 36 | if {[info exists env(EDITOR)]} { 37 | eval exec $env(EDITOR) $file & 38 | } else { 39 | exec xedit $file & 40 | } 41 | } 42 | default { 43 | puts stdout "\"$file\" isn't a directory or regular file" 44 | } 45 | } 46 | } 47 | 48 | # Fill the listbox with a list of all the files in the directory. 49 | 50 | if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."} 51 | foreach i [lsort [glob * .* *.*]] { 52 | if {[file type $i] eq "directory"} { 53 | # Safe to do since it is still a directory. 54 | append i / 55 | } 56 | .list insert end $i 57 | } 58 | 59 | # Set up bindings for the browser. 60 | 61 | bind all {destroy .} 62 | bind .list {foreach i [selection get] {browse $dir $i}} 63 | 64 | # Local Variables: 65 | # mode: tcl 66 | # End: 67 | -------------------------------------------------------------------------------- /changes.md: -------------------------------------------------------------------------------- 1 | 2 | The source code for Tk is managed by fossil. Tk developers coordinate all 3 | changes to the Tk source code at 4 | 5 | > [Tk Source Code](https://core.tcl-lang.org/tk/) 6 | 7 | Release Tk 9.1a1 arises from the check-in with tag `core-9-1-a1`. 8 | 9 | Tk 9.1a1 continues the Tk 9.x series of releases. The Tk 9.x series 10 | do not support Tcl 8.6. The Tk 9.1 series extends the Tcl 9.0 series. 11 | To make use of Tk 9.1a1, first a Tcl 9.0 or 9.1 release must be present. 12 | As new Tk features are developed, expect them to appear in Tk 9, but not 13 | necessarily in Tk 8. 14 | 15 | # 9.1 Features and Interfaces 16 | - [MS-Win: remove Windows XP dialog variants for tk_chooseDirectory and tk_getOpenFile](https://core.tcl-lang.org/tk/tktview/441c52) 17 | - [Handle negative screen distances](https://core.tcl-lang.org/tips/doc/trunk/tip/698.md) 18 | - [Extend Tk_CanvasTextInfo](https://core.tcl-lang.org/tips/doc/trunk/tip/704.md) 19 | - [Add new states to ttk::treeview and ttk::notebook](https://core.tcl-lang.org/tips/doc/trunk/tip/719.md) 20 | - [Limit tk_messageBox to physical screen width](https://core.tcl-lang.org/tk/info/e19f1d891) 21 | - [Constrain own Dialogs to the physical screen size](https://core.tcl-lang.org/tk/info/7c28f835) 22 | - [Add a ttk::toggleswitch widget to the core](https://core.tcl-lang.org/tips/doc/trunk/tip/727.md) 23 | - [Add a tk attribtable command to the core](https://core.tcl-lang.org/tips/doc/trunk/tip/729.md) 24 | - [Implement more X11 region functions on Windows and Aqua](https://core.tcl-lang.org/tk/info/50fdbc36ad) 25 | - [Add accessibility/screen reader support to the core](https://core.tcl-lang.org/tips/doc/trunk/tip/733.md) 26 | - [Scroll entry with mouse wheel](https://core.tcl-lang.org/tips/doc/trunk/tip/736.md) 27 | 28 | # Potential incompatibilities to 9.0 29 | - [MS-Win: the undocumented option -xpstyle was removed from tk_chooseDirectory and tk_getOpenFile](https://core.tcl-lang.org/tk/tktview/441c52) 30 | - [MS-Win: The "xpnative" ttk style is gone too, in favor of "vista"](https://core.tcl-lang.org/tk/tktview/441c52) 31 | -------------------------------------------------------------------------------- /tests/ttk/all.tcl: -------------------------------------------------------------------------------- 1 | # all.tcl -- 2 | # 3 | # This file contains a top-level script to run all of the ttk 4 | # tests. Execute it by invoking "source all.tcl" when running tktest 5 | # in this directory. 6 | # 7 | # Copyright © 2007 the Tk developers. 8 | # 9 | # See the file "license.terms" for information on usage and redistribution 10 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 11 | 12 | # 13 | # REQUIREMENTS 14 | # 15 | package require tk ;# This is the Tk test suite; fail early if no Tk! 16 | package require tcltest 2.2 17 | 18 | # 19 | # TCLTEST CONFIGURATION 20 | # 21 | 22 | # Set defaults for the Tk test suite 23 | tcltest::configure -singleproc 1 24 | 25 | # Handle command line parameters 26 | if {[llength $argv] & 1} { 27 | puts stderr "error: the number of command line parameters must be even (name - value pairs)." 28 | exit 1 29 | } 30 | set ignoredOptions [list -testdir] 31 | set ignoredIndices [list ] 32 | set index 0 33 | foreach {key value} $argv { 34 | if {$key in $ignoredOptions} { 35 | lappend ignoredIndices $index 36 | puts stderr "warning: the Tk test suite ignores the option \"$key\" on the command line." 37 | } 38 | incr index 2 39 | } 40 | set tcltestOptions $argv 41 | foreach index [lreverse $ignoredIndices] { 42 | set tcltestOptions [lreplace $tcltestOptions $index [expr {$index + 1}]] 43 | } 44 | tcltest::configure {*}$tcltestOptions 45 | unset ignoredIndices ignoredOptions index tcltestOptions 46 | 47 | # Set tcltest options that are not user-configurable for the Tk test suite 48 | tcltest::configure -testdir [file normalize [file dirname [info script]]] 49 | 50 | # Determine test files to skip 51 | set skipFiles [tcltest::configure -notfile] 52 | if {"vista" ni [ttk::style theme names]} { 53 | lappend skipFiles vsapi.test 54 | tcltest::configure -notfile [lsort -unique $skipFiles] 55 | } 56 | unset skipFiles 57 | 58 | # 59 | # RUN ALL TESTS 60 | # 61 | 62 | # Note: the environment variable ERROR_ON_FAILURES is set by Github CI 63 | if {[tcltest::runAllTests] && [info exists env(ERROR_ON_FAILURES)]} { 64 | exit 1 65 | } 66 | -------------------------------------------------------------------------------- /doc/QWinEvent.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. 3 | '\" 4 | '\" See the file "license.terms" for information on usage and redistribution 5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 6 | '\" 7 | .TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" 8 | .so man.macros 9 | .BS 10 | .SH NAME 11 | Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue 12 | .SH SYNOPSIS 13 | .nf 14 | \fB#include \fR 15 | .sp 16 | int 17 | \fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) 18 | .sp 19 | \fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) 20 | .fi 21 | .SH ARGUMENTS 22 | .AS Tcl_QueuePosition position 23 | .AP Display *display in 24 | Display for which to control motion event collapsing. 25 | .AP int collapse in 26 | Indicates whether motion events should be collapsed or not. 27 | .AP XEvent *eventPtr in 28 | An event to add to the event queue. It is important 29 | that all unused fields of the structure be set to zero. 30 | .AP Tcl_QueuePosition position in 31 | Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR, 32 | \fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR. 33 | .BE 34 | .SH DESCRIPTION 35 | .PP 36 | \fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event 37 | queue for eventual servicing. It creates a Tcl_Event structure, copies the 38 | event into that structure, and calls \fBTcl_QueueEvent\fR to add the event 39 | to the queue. When the event is eventually removed from the queue it is 40 | processed just like all window events. 41 | .PP 42 | When multiple motion events are received for the same window in rapid 43 | succession, they are collapsed by default. This behavior can be controlled 44 | with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always 45 | returns the previous value for collapse behavior on the \fIdisplay\fR. 46 | .PP 47 | The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has 48 | the same significance as for \fBTcl_QueueEvent\fR; see the 49 | documentation for \fBTcl_QueueEvent\fR for details. 50 | .SH KEYWORDS 51 | callback, clock, handler, modal timeout, events 52 | -------------------------------------------------------------------------------- /doc/InternAtom.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_InternAtom 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | Atom 18 | \fBTk_InternAtom\fR(\fItkwin, name\fR) 19 | .sp 20 | const char * 21 | \fBTk_GetAtomName\fR(\fItkwin, atom\fR) 22 | .fi 23 | .SH ARGUMENTS 24 | .AS Tk_Window parent 25 | .AP Tk_Window tkwin in 26 | Token for window. Used to map atom or name relative to a particular display. 27 | .AP "const char" *name in 28 | String name for which atom is desired. 29 | .AP Atom atom in 30 | Atom for which corresponding string name is desired. 31 | .BE 32 | .SH DESCRIPTION 33 | .PP 34 | These procedures are similar to the Xlib procedures 35 | \fBXInternAtom\fR and \fBXGetAtomName\fR. \fBTk_InternAtom\fR 36 | returns the atom identifier associated with string given by 37 | \fIname\fR; the atom identifier is only valid for the display 38 | associated with \fItkwin\fR. 39 | \fBTk_GetAtomName\fR returns the string associated 40 | with \fIatom\fR on \fItkwin\fR's display. The string returned 41 | by \fBTk_GetAtomName\fR is in Tk's storage: the caller need 42 | not free this space when finished with the string, and the caller 43 | should not modify the contents of the returned string. 44 | If there is no atom \fIatom\fR on \fItkwin\fR's display, 45 | then \fBTk_GetAtomName\fR returns the string 46 | .QW "?bad atom?" . 47 | .PP 48 | Tk caches 49 | the information returned by \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR 50 | so that future calls 51 | for the same information can be serviced from the cache without 52 | contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR 53 | are generally much faster than their Xlib counterparts, and they 54 | should be used in place of the Xlib procedures. 55 | .SH KEYWORDS 56 | atom, cache, display 57 | -------------------------------------------------------------------------------- /library/demos/labelframe.tcl: -------------------------------------------------------------------------------- 1 | # labelframe.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window containing 4 | # several labelframe widgets. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .labelframe 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Labelframe Demonstration" 16 | wm iconname $w "labelframe" 17 | positionWindow $w 18 | 19 | # Some information 20 | 21 | label $w.msg -font $font -wraplength 4i -justify left -text "Labelframes are\ 22 | used to group related widgets together. The label may be either \ 23 | plain text or another widget." 24 | pack $w.msg -side top 25 | 26 | ## See Code / Dismiss buttons 27 | set btns [addSeeDismiss $w.buttons $w] 28 | pack $btns -side bottom -fill x 29 | 30 | # Demo area 31 | 32 | frame $w.f 33 | pack $w.f -side bottom -fill both -expand 1 34 | set w $w.f 35 | 36 | # A group of radiobuttons in a labelframe 37 | 38 | labelframe $w.f -text "Value" -padx 1.5p -pady 1.5p 39 | grid $w.f -row 0 -column 0 -pady 2m -padx 2m 40 | 41 | foreach value {1 2 3 4} { 42 | radiobutton $w.f.b$value -text "This is value $value" \ 43 | -variable lfdummy -value $value 44 | pack $w.f.b$value -side top -fill x -pady 1.5p 45 | } 46 | 47 | 48 | # Using a label window to control a group of options. 49 | 50 | proc lfEnableButtons {w} { 51 | foreach child [winfo children $w] { 52 | if {$child == "$w.cb"} continue 53 | if {$::lfdummy2} { 54 | $child configure -state normal 55 | } else { 56 | $child configure -state disabled 57 | } 58 | } 59 | } 60 | 61 | labelframe $w.f2 -pady 1.5p -padx 1.5p 62 | checkbutton $w.f2.cb -text "Use this option." -variable lfdummy2 \ 63 | -command "lfEnableButtons $w.f2" -padx 0 64 | $w.f2 configure -labelwidget $w.f2.cb 65 | grid $w.f2 -row 0 -column 1 -pady 2m -padx 2m 66 | 67 | set t 0 68 | foreach str {Option1 Option2 Option3} { 69 | checkbutton $w.f2.b$t -text $str 70 | pack $w.f2.b$t -side top -fill x -pady 1.5p 71 | incr t 72 | } 73 | lfEnableButtons $w.f2 74 | 75 | 76 | grid columnconfigure $w {0 1} -weight 1 77 | -------------------------------------------------------------------------------- /xlib/xdraw.c: -------------------------------------------------------------------------------- 1 | /* 2 | * xdraw.c -- 3 | * 4 | * This file contains generic procedures related to X drawing primitives. 5 | * 6 | * Copyright © 1995 Sun Microsystems, Inc. 7 | * 8 | * See the file "license.terms" for information on usage and redistribution of 9 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. 10 | */ 11 | 12 | #include "tk.h" 13 | 14 | /* 15 | *---------------------------------------------------------------------- 16 | * 17 | * XDrawLine -- 18 | * 19 | * Draw a single line between two points in a given drawable. 20 | * 21 | * Results: 22 | * None. 23 | * 24 | * Side effects: 25 | * Draws a single line segment. 26 | * 27 | *---------------------------------------------------------------------- 28 | */ 29 | 30 | int 31 | XDrawLine( 32 | Display *display, 33 | Drawable d, 34 | GC gc, 35 | int x1, int y1, 36 | int x2, int y2) /* Coordinates of line segment. */ 37 | { 38 | XPoint points[2]; 39 | 40 | points[0].x = (short)x1; 41 | points[0].y = (short)y1; 42 | points[1].x = (short)x2; 43 | points[1].y = (short)y2; 44 | return XDrawLines(display, d, gc, points, 2, CoordModeOrigin); 45 | } 46 | 47 | /* 48 | *---------------------------------------------------------------------- 49 | * 50 | * XFillRectangle -- 51 | * 52 | * Fills a rectangular area in the given drawable. This procedure is 53 | * implemented as a call to XFillRectangles. 54 | * 55 | * Results: 56 | * None 57 | * 58 | * Side effects: 59 | * Fills the specified rectangle. 60 | * 61 | *---------------------------------------------------------------------- 62 | */ 63 | 64 | int 65 | XFillRectangle( 66 | Display *display, 67 | Drawable d, 68 | GC gc, 69 | int x, 70 | int y, 71 | unsigned int width, 72 | unsigned int height) 73 | { 74 | XRectangle rectangle; 75 | rectangle.x = (short)x; 76 | rectangle.y = (short)y; 77 | rectangle.width = (unsigned short)width; 78 | rectangle.height = (unsigned short)height; 79 | return XFillRectangles(display, d, gc, &rectangle, 1); 80 | } 81 | 82 | /* 83 | * Local Variables: 84 | * mode: c 85 | * c-basic-offset: 4 86 | * fill-column: 78 87 | * End: 88 | */ 89 | -------------------------------------------------------------------------------- /doc/raise.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH raise n 3.3 Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | '\" Note: do not modify the .SH NAME line immediately below! 12 | .SH NAME 13 | raise \- Change a window's position in the stacking order 14 | .SH SYNOPSIS 15 | \fBraise \fIwindow \fR?\fIaboveThis\fR? 16 | .BE 17 | .SH DESCRIPTION 18 | .PP 19 | If the \fIaboveThis\fR argument is omitted then the command raises 20 | \fIwindow\fR so that it is above all of its siblings in the stacking 21 | order (it will not be obscured by any siblings and will obscure 22 | any siblings that overlap it). 23 | If \fIaboveThis\fR is specified then it must be the path name of 24 | a window that is either a sibling of \fIwindow\fR or the descendant 25 | of a sibling of \fIwindow\fR. 26 | In this case the \fBraise\fR command will insert 27 | \fIwindow\fR into the stacking order just above \fIaboveThis\fR 28 | (or the ancestor of \fIaboveThis\fR that is a sibling of \fIwindow\fR); 29 | this could end up either raising or lowering \fIwindow\fR. 30 | .PP 31 | All \fBtoplevel\fR windows may be restacked with respect to each 32 | other, whatever their relative path names, but the window manager is 33 | not obligated to strictly honor requests to restack. 34 | .PP 35 | On macOS raising an iconified \fBtoplevel\fR window causes it to be 36 | deiconified. 37 | .SH EXAMPLE 38 | .PP 39 | Make a button appear to be in a sibling frame that was created after 40 | it. This is is often necessary when building GUIs in the style where 41 | you create your activity widgets first before laying them out on the 42 | display: 43 | .CS 44 | button .b -text "Hi there!" 45 | pack [frame .f -background blue] 46 | pack [label .f.l1 -text "This is above"] 47 | pack .b -in .f 48 | pack [label .f.l2 -text "This is below"] 49 | \fBraise\fR .b 50 | .CE 51 | .SH "SEE ALSO" 52 | lower(n) 53 | .SH KEYWORDS 54 | obscure, raise, stacking order 55 | '\" Local Variables: 56 | '\" mode: nroff 57 | '\" End: 58 | -------------------------------------------------------------------------------- /tests/bell.test: -------------------------------------------------------------------------------- 1 | # This file is a Tcl script to test out Tk's "bell" command. 2 | # 3 | # Copyright © 1994 The Regents of the University of California. 4 | # Copyright © 1998-2000 Scriptics Corporation. 5 | # All rights reserved. 6 | 7 | # 8 | # TESTFILE INITIALIZATION 9 | # 10 | 11 | package require tcltest 2.2; # needed in mode -singleproc 0 12 | 13 | # Load the main script main.tcl, which takes care of: 14 | # - setup for the application and the root window 15 | # - importing commands from the tcltest namespace 16 | # - loading of the testutils mechanism along with its utility procs 17 | # - loading of Tk specific test constraints (additionally to constraints 18 | # provided by the package tcltest) 19 | source [file join [tcltest::configure -testdir] main.tcl] 20 | 21 | # Ensure a pristine initial window state 22 | resetWindows 23 | 24 | # 25 | # TESTS 26 | # 27 | 28 | test bell-1.1 {bell command} -body { 29 | bell a 30 | } -returnCodes error -result {bad option "a": must be -displayof or -nice} 31 | 32 | test bell-1.2 {bell command} -body { 33 | bell a b 34 | } -returnCodes error -result {bad option "a": must be -displayof or -nice} 35 | 36 | test bell-1.3 {bell command} -body { 37 | bell -displayof gorp 38 | } -returnCodes error -result {bad window path name "gorp"} 39 | 40 | test bell-1.4 {bell command} -body { 41 | bell -nice -displayof 42 | } -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} 43 | 44 | test bell-1.5 {bell command} -body { 45 | bell -nice -nice -nice 46 | } -returnCodes {ok} -result {} ;#keep -result {} and -returnCodes {ok} for clarity? 47 | 48 | test bell-1.6 {bell command} -body { 49 | bell -displayof . -nice 50 | } -returnCodes {ok} -result {} 51 | 52 | test bell-1.7 {bell command} -body { 53 | bell -nice -displayof . -nice 54 | } -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} 55 | 56 | test bell-1.8 {bell command} -body { 57 | puts "Bell should ring now ..." 58 | flush stdout 59 | after 200 60 | bell -displayof . 61 | after 200 62 | bell -nice 63 | after 200 64 | bell 65 | } -result {} 66 | 67 | # 68 | # TESTFILE CLEANUP 69 | # 70 | 71 | cleanupTests 72 | -------------------------------------------------------------------------------- /tests/bgerror.test: -------------------------------------------------------------------------------- 1 | # This file is a Tcl script to test the bgerror command. 2 | # 3 | # Copyright © 1997 Sun Microsystems, Inc. 4 | # Copyright © 1998-1999 Scriptics Corporation. 5 | # All rights reserved. 6 | 7 | # NOTE 8 | # 9 | # Some testing of the default error dialog would be needed too, but that's 10 | # not easy at all to emulate. 11 | 12 | # 13 | # TESTFILE INITIALIZATION 14 | # 15 | 16 | package require tcltest 2.2; # needed in mode -singleproc 0 17 | 18 | # Load the main script main.tcl, which takes care of: 19 | # - setup for the application and the root window 20 | # - importing commands from the tcltest namespace 21 | # - loading of the testutils mechanism along with its utility procs 22 | # - loading of Tk specific test constraints (additionally to constraints 23 | # provided by the package tcltest) 24 | source [file join [tcltest::configure -testdir] main.tcl] 25 | 26 | # Ensure a pristine initial window state 27 | resetWindows 28 | 29 | # 30 | # TESTS 31 | # 32 | 33 | test bgerror-1.1 {bgerror / tkerror compat} -setup { 34 | set errRes {} 35 | proc tkerror {err} { 36 | global errRes; 37 | set errRes $err; 38 | } 39 | } -body { 40 | after 0 {error err1} 41 | vwait errRes; 42 | return $errRes; 43 | } -cleanup { 44 | catch {rename tkerror {}} 45 | } -result {err1} 46 | 47 | test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup { 48 | set errRes {} 49 | proc tkerror {err} { 50 | global errRes; 51 | lappend errRes $err; 52 | } 53 | } -body { 54 | after 0 {error err1} 55 | after 0 {error err2} 56 | after 0 {error err3} 57 | update 58 | return $errRes; 59 | } -cleanup { 60 | catch {rename tkerror {}} 61 | } -result {err1 err2 err3} 62 | 63 | test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} -setup { 64 | set errRes {} 65 | proc tkerror {err} { 66 | global errRes; 67 | lappend errRes $err; 68 | return -code break "skip!"; 69 | } 70 | } -body { 71 | after 0 {error err1} 72 | after 0 {error err2} 73 | after 0 {error err3} 74 | update 75 | return $errRes; 76 | } -cleanup { 77 | catch {rename tkerror {}} 78 | } -result {err1} 79 | 80 | # 81 | # TESTFILE CLEANUP 82 | # 83 | 84 | cleanupTests 85 | -------------------------------------------------------------------------------- /generic/ttk/ttkStubInit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is (mostly) automatically generated from ttk.decls. 3 | * It is compiled and linked in with the ttk package proper. 4 | */ 5 | 6 | #include "tkInt.h" 7 | #include "ttkTheme.h" 8 | 9 | MODULE_SCOPE const TtkStubs ttkStubs; 10 | 11 | 12 | #ifdef TK_NO_DEPRECATED 13 | # define Ttk_RegisterElementSpec 0 14 | #endif /* TK_NO_DEPRECATED */ 15 | 16 | #ifdef __GNUC__ 17 | /* 18 | * The rest of this file shouldn't warn about deprecated functions; they're 19 | * there because we intend them to be so and know that this file is OK to 20 | * touch those fields. 21 | */ 22 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 23 | #endif 24 | /* !BEGIN!: Do not edit below this line. */ 25 | 26 | const TtkStubs ttkStubs = { 27 | TCL_STUB_MAGIC, 28 | TTK_STUBS_EPOCH, 29 | TTK_STUBS_REVISION, 30 | 0, 31 | Ttk_GetTheme, /* 0 */ 32 | Ttk_GetDefaultTheme, /* 1 */ 33 | Ttk_GetCurrentTheme, /* 2 */ 34 | Ttk_CreateTheme, /* 3 */ 35 | Ttk_RegisterCleanup, /* 4 */ 36 | Ttk_RegisterElementSpec, /* 5 */ 37 | Ttk_RegisterElement, /* 6 */ 38 | Ttk_RegisterElementFactory, /* 7 */ 39 | Ttk_RegisterLayout, /* 8 */ 40 | 0, /* 9 */ 41 | Ttk_GetStateSpecFromObj, /* 10 */ 42 | Ttk_NewStateSpecObj, /* 11 */ 43 | Ttk_GetStateMapFromObj, /* 12 */ 44 | Ttk_StateMapLookup, /* 13 */ 45 | Ttk_StateTableLookup, /* 14 */ 46 | 0, /* 15 */ 47 | 0, /* 16 */ 48 | 0, /* 17 */ 49 | 0, /* 18 */ 50 | 0, /* 19 */ 51 | Ttk_GetPaddingFromObj, /* 20 */ 52 | Ttk_GetBorderFromObj, /* 21 */ 53 | Ttk_GetStickyFromObj, /* 22 */ 54 | Ttk_MakePadding, /* 23 */ 55 | Ttk_UniformPadding, /* 24 */ 56 | Ttk_AddPadding, /* 25 */ 57 | Ttk_RelievePadding, /* 26 */ 58 | Ttk_MakeBox, /* 27 */ 59 | Ttk_BoxContains, /* 28 */ 60 | Ttk_PackBox, /* 29 */ 61 | Ttk_StickBox, /* 30 */ 62 | Ttk_AnchorBox, /* 31 */ 63 | Ttk_PadBox, /* 32 */ 64 | Ttk_ExpandBox, /* 33 */ 65 | Ttk_PlaceBox, /* 34 */ 66 | Ttk_NewBoxObj, /* 35 */ 67 | 0, /* 36 */ 68 | 0, /* 37 */ 69 | 0, /* 38 */ 70 | 0, /* 39 */ 71 | Ttk_GetOrientFromObj, /* 40 */ 72 | }; 73 | 74 | /* !END!: Do not edit above this line. */ 75 | -------------------------------------------------------------------------------- /doc/SetClass.3: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Copyright (c) 1990 The Regents of the University of California. 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH Tk_SetClass 3 "" Tk "Tk Library Procedures" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | Tk_SetClass, Tk_Class \- set or retrieve a window's class 13 | .SH SYNOPSIS 14 | .nf 15 | \fB#include \fR 16 | .sp 17 | \fBTk_SetClass\fR(\fItkwin, class\fR) 18 | .sp 19 | Tk_Uid 20 | \fBTk_Class\fR(\fItkwin\fR) 21 | .fi 22 | .SH ARGUMENTS 23 | .AS Tk_Window parent 24 | .AP Tk_Window tkwin in 25 | Token for window. 26 | .AP char *class in 27 | New class name for window. 28 | .BE 29 | .SH DESCRIPTION 30 | .PP 31 | \fBTk_SetClass\fR is called to associate a class with a particular 32 | window. The \fIclass\fR string identifies the type of the 33 | window; all windows with the same general class of behavior 34 | (button, menu, etc.) should have the same class. By 35 | convention all class names start with a capital letter, and 36 | there exists a Tcl command with the same name as 37 | each class (except all in lower-case) which can be used to 38 | create and manipulate windows of that class. 39 | A window's class string is initialized to NULL 40 | when the window is created. 41 | .PP 42 | For main windows, Tk automatically propagates the name and class 43 | to the WM_CLASS property used by window managers. This happens 44 | either when a main window is actually created (e.g. in 45 | \fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR 46 | is called, whichever occurs later. If a main window has not been 47 | assigned a class then Tk will not set the WM_CLASS property for 48 | the window. 49 | .PP 50 | \fBTk_Class\fR is a macro that returns the 51 | current value of \fItkwin\fR's class. The value is returned 52 | as a Tk_Uid, which may be used just like a string pointer but also has 53 | the properties of a unique identifier (see the manual entry for 54 | \fBTk_GetUid\fR for details). 55 | If \fItkwin\fR has not yet been given a class, then 56 | \fBTk_Class\fR will return NULL. 57 | .SH KEYWORDS 58 | class, unique identifier, window, window manager 59 | -------------------------------------------------------------------------------- /library/demos/README: -------------------------------------------------------------------------------- 1 | This directory contains a collection of programs to demonstrate 2 | the features of the Tk toolkit. The programs are all scripts for 3 | "wish", a windowing shell. If wish has been installed on your path 4 | then you can invoke any of the programs in this directory just 5 | by typing its file name to your command shell under Unix. Otherwise 6 | invoke wish with the file as its first argument, e.g., "wish hello". 7 | The rest of this file contains a brief description of each program. 8 | Files with names ending in ".tcl" are procedure packages used by one 9 | or more of the demo programs; they can't be used as programs by 10 | themselves so they aren't described below. 11 | 12 | hello - Creates a single button; if you click on it, a message 13 | is typed and the application terminates. 14 | 15 | widget - Contains a collection of demonstrations of the widgets 16 | currently available in the Tk library. Most of the .tcl 17 | files are scripts for individual demos available through 18 | the "widget" program. 19 | 20 | ixset - A simple Tk-based wrapper for the "xset" program, which 21 | allows you to interactively query and set various X options 22 | such as mouse acceleration and bell volume. Thanks to 23 | Pierre David for contributing this example. 24 | 25 | rolodex - A mock-up of a simple rolodex application. It has much of 26 | the user interface for such an application but no back-end 27 | database. This program was written in response to Tom 28 | LaStrange's toolkit benchmark challenge. 29 | 30 | tcolor - A color editor. Allows you to edit colors in several 31 | different ways, and will also perform automatic updates 32 | using "send". 33 | 34 | rmt - Allows you to "hook-up" remotely to any Tk application 35 | on the display. Select an application with the menu, 36 | then just type commands: they'll go to that application. 37 | 38 | timer - Displays a seconds timer with start and stop buttons. 39 | Control-c and control-q cause it to exit. 40 | 41 | browse - A simple directory browser. Invoke it with and argument 42 | giving the name of the directory you'd like to browse. 43 | Double-click on files or subdirectories to browse them. 44 | Control-c and control-q cause the program to exit. 45 | -------------------------------------------------------------------------------- /library/demos/states.tcl: -------------------------------------------------------------------------------- 1 | # states.tcl -- 2 | # 3 | # This demonstration script creates a listbox widget that displays 4 | # the names of the 50 states in the United States of America. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .states 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Listbox Demonstration (50 states)" 16 | wm iconname $w "states" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 4i -justify left -text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by scanning. To scan, press button 2 in the widget and drag up or down." 20 | pack $w.msg -side top 21 | 22 | labelframe $w.justif -text Justification 23 | foreach c {Left Center Right} { 24 | set lower [string tolower $c] 25 | radiobutton $w.justif.$lower -text $c -variable just \ 26 | -relief flat -value $lower -anchor w \ 27 | -command "$w.frame.list configure -justify \$just" \ 28 | -tristatevalue "multi" 29 | pack $w.justif.$lower -side left -pady 1.5p -fill x 30 | } 31 | pack $w.justif 32 | 33 | ## See Code / Dismiss buttons 34 | set btns [addSeeDismiss $w.buttons $w] 35 | pack $btns -side bottom -fill x 36 | 37 | frame $w.frame -borderwidth .5c 38 | pack $w.frame -side top -expand yes -fill y 39 | 40 | ttk::scrollbar $w.frame.scroll -command "$w.frame.list yview" 41 | listbox $w.frame.list -yscroll "$w.frame.scroll set" -setgrid 1 -height 12 42 | pack $w.frame.scroll -side right -fill y 43 | pack $w.frame.list -side left -expand 1 -fill both 44 | 45 | $w.frame.list insert 0 Alabama Alaska Arizona Arkansas California \ 46 | Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois \ 47 | Indiana Iowa Kansas Kentucky Louisiana Maine Maryland \ 48 | Massachusetts Michigan Minnesota Mississippi Missouri \ 49 | Montana Nebraska Nevada "New Hampshire" "New Jersey" "New Mexico" \ 50 | "New York" "North Carolina" "North Dakota" \ 51 | Ohio Oklahoma Oregon Pennsylvania "Rhode Island" \ 52 | "South Carolina" "South Dakota" \ 53 | Tennessee Texas Utah Vermont Virginia Washington \ 54 | "West Virginia" Wisconsin Wyoming 55 | -------------------------------------------------------------------------------- /win/rc/wish.rc: -------------------------------------------------------------------------------- 1 | // 2 | // Version Resource Script 3 | // 4 | 5 | #include 6 | #include 7 | 8 | // 9 | // build-up the name suffix that defines the type of build this is. 10 | // 11 | #if STATIC_BUILD 12 | #define SUFFIX_STATIC "s" 13 | #else 14 | #define SUFFIX_STATIC "" 15 | #endif 16 | 17 | #if DEBUG && !UNCHECKED 18 | #define SUFFIX_DEBUG "g" 19 | #else 20 | #define SUFFIX_DEBUG "" 21 | #endif 22 | 23 | #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG 24 | 25 | 26 | VS_VERSION_INFO VERSIONINFO 27 | FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 28 | PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 29 | FILEFLAGSMASK 0x3fL 30 | #ifdef DEBUG 31 | FILEFLAGS VS_FF_DEBUG 32 | #else 33 | FILEFLAGS 0x0L 34 | #endif 35 | FILEOS VOS__WINDOWS32 36 | FILETYPE VFT_APP 37 | FILESUBTYPE 0x0L 38 | BEGIN 39 | BLOCK "StringFileInfo" 40 | BEGIN 41 | BLOCK "040904b0" 42 | BEGIN 43 | VALUE "FileDescription", "Wish Application\0" 44 | VALUE "OriginalFilename", "wish" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0" 45 | VALUE "FileVersion", TK_PATCH_LEVEL 46 | VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" 47 | VALUE "ProductName", "Tk " TK_VERSION " for Windows\0" 48 | VALUE "ProductVersion", TK_PATCH_LEVEL 49 | END 50 | END 51 | BLOCK "VarFileInfo" 52 | BEGIN 53 | VALUE "Translation", 0x409, 1200 54 | END 55 | END 56 | 57 | // 58 | // Icon 59 | // 60 | // The icon whose name or resource ID is lexigraphically first, is used 61 | // as the application's icon. 62 | // 63 | 64 | app ICON DISCARDABLE "wish.ico" 65 | 66 | #if STATIC_BUILD 67 | #include "tk_base.rc" 68 | #endif 69 | 70 | // 71 | // This enables themed scrollbars in XP by trying to use comctl32 v6. 72 | // 73 | 74 | #ifndef RT_MANIFEST 75 | #define RT_MANIFEST 24 76 | #endif 77 | #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID 78 | #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 79 | #endif 80 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest" 81 | -------------------------------------------------------------------------------- /doc/sysnotify.n: -------------------------------------------------------------------------------- 1 | .\" Text automatically generated by txt2man 2 | '\" 3 | '\" Copyright (c) 2020 Kevin Walzer. 4 | '\" 5 | '\" See the file "license.terms" for information on usage and redistribution 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. 7 | '\" 8 | .TH tk sysnotify n "" Tk "Tk Built-In Commands" 9 | .so man.macros 10 | .BS 11 | .SH NAME 12 | sysnotify \- Creates a notification window with a title and message. 13 | .SH SYNOPSIS 14 | \fBtk sysnotify\fI title message\fR 15 | .BE 16 | .SH DESCRIPTION 17 | .PP 18 | The \fBtk sysnotify\fR command creates a platform-specific system notification 19 | alert. Its intent is to provide a brief, unobtrusive notification to the user 20 | by popping up a window that briefly appears in a corner of the screen. 21 | .SH EXAMPLE 22 | .PP 23 | Here is an example of the \fBtk sysnotify\fR code: 24 | .PP 25 | .CS 26 | tk sysnotify "Alert" \e 27 | "This is just a test of the Tk System Notification Code." 28 | .CE 29 | .SH PLATFORM NOTES 30 | .PP 31 | The macOS and Windows versions are native implementations using system 32 | API's. The X11 version has a conditional dependency on libnotify, and 33 | falls back to a Tcl-only implementation if libnotify is not installed. On 34 | macOS and Linux, the notification includes a platform-specific default image to 35 | accompany the text. On Windows, the notification displays the same image as the one 36 | in the system tray; Windows images will display best if they are 32x32 pixels. 37 | .TP 38 | \fBmacOS\fR 39 | . 40 | The macOS version will request permission from the user to authorize 41 | notifications. This must be activated in Apple's System Preferences 42 | Notifications section. 43 | .RS 44 | .PP 45 | If deploying an application using the standalone version of Wish.app, 46 | setting the bundle ID in the applications Info.plist file to begin with 47 | .QW \fBcom\fR 48 | seems necessary for notifications to work. Using a different prefix 49 | for the bundle ID, such as something like 50 | .QW \fBtk.tcl.tkchat\fR , 51 | will cause notifications to silently fail. 52 | .RE 53 | .TP 54 | \fBWindows\fR 55 | . 56 | The image is taken from the system tray, i.e., \fBsysnotify\fR can only be 57 | called when a \fBsystray\fR was installed. 58 | . 59 | .SH KEYWORDS 60 | notify, alert 61 | -------------------------------------------------------------------------------- /generic/ttk/ttkStubLib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * We need to ensure that we use the tcl stub macros so that this file 3 | * contains no references to any of the tcl stub functions. 4 | */ 5 | 6 | #undef USE_TCL_STUBS 7 | #define USE_TCL_STUBS 8 | 9 | #include "tkInt.h" 10 | 11 | #define USE_TTK_STUBS 1 12 | #include "ttkTheme.h" 13 | 14 | MODULE_SCOPE const TtkStubs *ttkStubsPtr; 15 | const TtkStubs *ttkStubsPtr = NULL; 16 | 17 | /* 18 | *---------------------------------------------------------------------- 19 | * 20 | * TtkInitializeStubs -- 21 | * Load the Ttk package, initialize stub table pointer. 22 | * Do not call this function directly, use Ttk_InitStubs() macro instead. 23 | * 24 | * Results: 25 | * The actual version of the package that satisfies the request, or 26 | * NULL to indicate that an error occurred. 27 | * 28 | * Side effects: 29 | * Sets the stub table pointer. 30 | * 31 | */ 32 | MODULE_SCOPE const char * 33 | TtkInitializeStubs( 34 | Tcl_Interp *interp, const char *version, int epoch, int revision) 35 | { 36 | int exact = 0; 37 | const char *packageName = "ttk"; 38 | const char *errMsg = NULL; 39 | void *pkgClientData = NULL; 40 | const char *actualVersion = Tcl_PkgRequireEx( 41 | interp, packageName, version, exact, &pkgClientData); 42 | const TtkStubs *stubsPtr; 43 | 44 | if (!actualVersion) { 45 | packageName = "Ttk"; 46 | actualVersion = Tcl_PkgRequireEx( 47 | interp, packageName, version, exact, &pkgClientData); 48 | if (!actualVersion) { 49 | return NULL; 50 | } 51 | } 52 | 53 | stubsPtr = (const TtkStubs *)pkgClientData; 54 | if (!stubsPtr) { 55 | errMsg = "missing stub table pointer"; 56 | goto error; 57 | } 58 | if (stubsPtr->epoch != epoch) { 59 | errMsg = "epoch number mismatch"; 60 | goto error; 61 | } 62 | if (stubsPtr->revision < revision) { 63 | errMsg = "require later revision"; 64 | goto error; 65 | } 66 | 67 | ttkStubsPtr = stubsPtr; 68 | return actualVersion; 69 | 70 | error: 71 | Tcl_ResetResult(interp); 72 | Tcl_AppendResult(interp, 73 | "Error loading ", packageName, " package", 74 | " (requested version '", version, 75 | "', loaded version '", actualVersion, "'): ", 76 | errMsg, 77 | NULL); 78 | return NULL; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /win/rc/tktest.rc: -------------------------------------------------------------------------------- 1 | // 2 | // Version Resource Script 3 | // 4 | 5 | #include 6 | #include 7 | 8 | // 9 | // build-up the name suffix that defines the type of build this is. 10 | // 11 | #if STATIC_BUILD 12 | #define SUFFIX_STATIC "s" 13 | #else 14 | #define SUFFIX_STATIC "" 15 | #endif 16 | 17 | #if DEBUG && !UNCHECKED 18 | #define SUFFIX_DEBUG "g" 19 | #else 20 | #define SUFFIX_DEBUG "" 21 | #endif 22 | 23 | #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG 24 | 25 | 26 | VS_VERSION_INFO VERSIONINFO 27 | FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 28 | PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL 29 | FILEFLAGSMASK 0x3fL 30 | #ifdef DEBUG 31 | FILEFLAGS VS_FF_DEBUG 32 | #else 33 | FILEFLAGS 0x0L 34 | #endif 35 | FILEOS VOS__WINDOWS32 36 | FILETYPE VFT_APP 37 | FILESUBTYPE 0x0L 38 | BEGIN 39 | BLOCK "StringFileInfo" 40 | BEGIN 41 | BLOCK "040904b0" 42 | BEGIN 43 | VALUE "FileDescription", "Tktest Application\0" 44 | VALUE "OriginalFilename", "tktest" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0" 45 | VALUE "FileVersion", TK_PATCH_LEVEL 46 | VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" 47 | VALUE "ProductName", "Tk " TK_VERSION " for Windows\0" 48 | VALUE "ProductVersion", TK_PATCH_LEVEL 49 | END 50 | END 51 | BLOCK "VarFileInfo" 52 | BEGIN 53 | VALUE "Translation", 0x409, 1200 54 | END 55 | END 56 | 57 | // 58 | // Icon 59 | // 60 | // The icon whose name or resource ID is lexigraphically first, is used 61 | // as the application's icon. 62 | // 63 | 64 | app ICON DISCARDABLE "wish.ico" 65 | 66 | #if STATIC_BUILD 67 | #include "tk_base.rc" 68 | #endif 69 | 70 | // 71 | // This enables themed scrollbars in XP by trying to use comctl32 v6. 72 | // 73 | 74 | #ifndef RT_MANIFEST 75 | #define RT_MANIFEST 24 76 | #endif 77 | #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID 78 | #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 79 | #endif 80 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest" 81 | -------------------------------------------------------------------------------- /library/demos/icon.tcl: -------------------------------------------------------------------------------- 1 | # icon.tcl -- 2 | # 3 | # This demonstration script creates a toplevel window containing 4 | # buttons that display bitmaps instead of text. 5 | 6 | if {![info exists widgetDemo]} { 7 | error "This script should be run from the \"widget\" demo." 8 | } 9 | 10 | package require tk 11 | 12 | set w .icon 13 | catch {destroy $w} 14 | toplevel $w 15 | wm title $w "Iconic Button Demonstration" 16 | wm iconname $w "icon" 17 | positionWindow $w 18 | 19 | label $w.msg -font $font -wraplength 5i -justify left -text "This window shows three ways of using bitmaps or images in radiobuttons and checkbuttons. On the left are two radiobuttons, each of which displays a bitmap and an indicator. In the middle is a checkbutton that displays a different image depending on whether it is selected or not. On the right is a checkbutton that displays a single bitmap but changes its background color to indicate whether or not it is selected." 20 | pack $w.msg -side top 21 | 22 | ## See Code / Dismiss buttons 23 | set btns [addSeeDismiss $w.buttons $w] 24 | pack $btns -side bottom -fill x 25 | 26 | # Main widget program sets variable tk_demoDirectory 27 | image create bitmap flagup \ 28 | -file [file join $tk_demoDirectory images flagup.xbm] \ 29 | -maskfile [file join $tk_demoDirectory images flagup.xbm] 30 | image create bitmap flagdown \ 31 | -file [file join $tk_demoDirectory images flagdown.xbm] \ 32 | -maskfile [file join $tk_demoDirectory images flagdown.xbm] 33 | frame $w.frame -borderwidth 7.5p 34 | pack $w.frame -side top 35 | 36 | checkbutton $w.frame.b1 -image flagdown -selectimage flagup \ 37 | -indicatoron 0 38 | $w.frame.b1 configure -selectcolor [$w.frame.b1 cget -background] 39 | checkbutton $w.frame.b2 \ 40 | -bitmap @[file join $tk_demoDirectory images letters.xbm] \ 41 | -indicatoron 0 -selectcolor SeaGreen1 42 | frame $w.frame.left 43 | pack $w.frame.left $w.frame.b1 $w.frame.b2 -side left -expand yes -padx 5m 44 | 45 | radiobutton $w.frame.left.b3 \ 46 | -bitmap @[file join $tk_demoDirectory images letters.xbm] \ 47 | -variable letters -value full 48 | radiobutton $w.frame.left.b4 \ 49 | -bitmap @[file join $tk_demoDirectory images noletter.xbm] \ 50 | -variable letters -value empty 51 | pack $w.frame.left.b3 $w.frame.left.b4 -side top -expand yes 52 | -------------------------------------------------------------------------------- /library/demos/msgbox.tcl: -------------------------------------------------------------------------------- 1 | # msgbox.tcl -- 2 | # 3 | # This demonstration script creates message boxes of various type 4 | 5 | if {![info exists widgetDemo]} { 6 | error "This script should be run from the \"widget\" demo." 7 | } 8 | 9 | package require tk 10 | 11 | set w .msgbox 12 | catch {destroy $w} 13 | toplevel $w 14 | wm title $w "Message Box Demonstration" 15 | wm iconname $w "messagebox" 16 | positionWindow $w 17 | 18 | label $w.msg -font $font -wraplength 4i -justify left -text "Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box." 19 | pack $w.msg -side top 20 | 21 | pack [addSeeDismiss $w.buttons $w {} { 22 | ttk::button $w.buttons.vars -text "Message Box" -command "showMessageBox $w" 23 | }] -side bottom -fill x 24 | #pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1 25 | 26 | frame $w.left 27 | frame $w.right 28 | pack $w.left $w.right -side left -expand yes -fill y -pady .5c -padx .5c 29 | 30 | label $w.left.label -text "Icon" 31 | frame $w.left.sep -relief ridge -bd 1 -height 2 32 | pack $w.left.label -side top 33 | pack $w.left.sep -side top -fill x -expand no 34 | 35 | set msgboxIcon info 36 | foreach i {error info question warning} { 37 | radiobutton $w.left.b$i -text $i -variable msgboxIcon \ 38 | -relief flat -value $i -width 16 -anchor w 39 | pack $w.left.b$i -side top -pady 1.5p -anchor w -fill x 40 | } 41 | 42 | label $w.right.label -text "Type" 43 | frame $w.right.sep -relief ridge -bd 1 -height 2 44 | pack $w.right.label -side top 45 | pack $w.right.sep -side top -fill x -expand no 46 | 47 | set msgboxType ok 48 | foreach t {abortretryignore ok okcancel retrycancel yesno yesnocancel} { 49 | radiobutton $w.right.$t -text $t -variable msgboxType \ 50 | -relief flat -value $t -width 16 -anchor w 51 | pack $w.right.$t -side top -pady 1.5p -anchor w -fill x 52 | } 53 | 54 | proc showMessageBox {w} { 55 | global msgboxIcon msgboxType 56 | set button [tk_messageBox -icon $msgboxIcon -type $msgboxType \ 57 | -title Message -parent $w\ 58 | -message "This is a \"$msgboxType\" type messagebox with the \"$msgboxIcon\" icon"] 59 | 60 | tk_messageBox -icon info -message "You have selected \"$button\"" -type ok\ 61 | -parent $w 62 | } 63 | --------------------------------------------------------------------------------