blt::tile(3tcl)
π blt::tile β tiling versions of Tk widgets π
okay bestie, so this is blt::tile, a page from the BLT Built-In Commands manual. it's literally about giving your Tk widgets textured backgrounds, and it's lowkey iconic. let's get into it π«Ά
β¨ NAME β¨
tile β tiling versions of Tk widgets. yes that's the whole vibe. π
πΈ SYNOPSIS πΈ
tile::button pathName option value...
tile::checkbutton pathName option value...
tile::frame pathName option value...
tile::label pathName option value...
tile::radiobutton pathName option value...
tile::scrollbar pathName option value...
tile::toplevel pathName option value...
π DESCRIPTION π
so the tile widgets let you create textured backgrounds, which is giving main character energy fr fr. the texture is a Tk image, and it gets tiled over the entire background of the widget. π¦
the offset of the tile usually aligns with the toplevel window, so that all the sub-tiles line up and nothing looks cursed. however β and this is the important bit β image names containing an exclamation mark "!" (usually as the last char) are tiled absolutely. no cap. β οΈ
π INTRODUCTION π
with the advent of Tk 4.0, images are now easy to create and use in applications. images add interest to applications and they convey more information. but one area where Tk hasn't taken advantage of images is using images as textures for widgets. since tiling is a standard feature of windowing systems, it's very easy to use images as textures. slay. β¨
note: Wize now adds a-tileoption to Tk widgets natively. however, these are retained to provide the-shadowoption. so don't come for them, they're still here for a reason π
tiled widgets take the standard Tk 4.0 widgets and add tiling configuration options to them. textures are specified by the name of the image you wish to be tiled across the background of the widget. periodt. π
π EXAMPLE π
to add tiling to a widget, you simply create an image using Tk's image command and use the image name as the value for the -tile configuration option of the widget. it's giving effortless. π§
image create photo my_texture -file tan_paper.gif
blt::tile::frame .f -tile my_texture
the image my_texture is added to the frame. and bestie, if my_texture is updated, so will the widget background. live updates?? obsessed. π
image create photo my_texture -file rain.gif
the tile widget commands reside in the "blt::tile" namespace, so as not to collide with the normal Tk widgets. an easy way to add tiling to existing programs is to import the tile widget commands into the global namespace. π«
image create photo my_texture -file tan_paper.gif
namespace import -force blt::tile::*
frame .f -tile my_texture
to use one image for all texturing, you can use the "Tile" option class name to specify the same image for all tile widgets. one image, every widget, that's the dream fr fr πΈ
image create photo my_texture -file tan_paper.gif
option add *Tile my_texture
π OPTIONS π
the following configurations options are added to the widgets. if a -tile or -activetile option is specified, it overrides the background color of the widget. (yes, it wins. no arguments. π)
-activetileimage β specifies a textured background to display when the widget is active. this option is available for thetilebutton,tilecheckbutton,tileradiobutton, andtilescrollbarwidgets. image is the name an image created using Tk'simagecommand. the background of the widget is tiled with image. if image is"", then the active background color is displayed. the default is"".-tileimage β specifies a textured background to display for the widget. image is the name an image created using Tk'simagecommand. the background of the widget is tiled with image. if image is"", then the normal background color is displayed. the default is"".-shadowshadow β set shadow for text.-rotatedegrees β support for rotating text in degrees, eg.90,180.-checksizenum β specify the size of check/radio button indicator.-iconsimages β give a list of 0, or 2-9 images to use for the indicators. the first three are for normal,selected,tristate. the next three repeat but for the active state. the next three repeat but for the disabled state.-bdimageimage β a border image that resizes to fit the widget.-activebdimageimage β a border image that resizes to fit the widget.-disabledbdimageimage β a border image that resizes to fit the widget.-bdflagsint β set to-1to perform inner rather than outer mirror.
π₯ KEYWORDS π₯
tile, texture, button, label, radiobutton, checkbutton, scrollbar, frame, toplevel
and that's the whole page bestie, you ate that π this was BLT 2.5, blt::tile(3tcl) β go forth and tile your widgets, mwah πβ¨π¦
π¦ where this page comes from
- debian bookworm: blt-dev 2.5.3+dfsg-4.1
- debian trixie: blt-dev 2.5.3+dfsg-8
- ubuntu jammy: blt-dev 2.5.3+dfsg-4.1build2
- ubuntu noble: blt-dev 2.5.3+dfsg-7build1
- ubuntu questing: blt-dev 2.5.3+dfsg-8
- ubuntu resolute: blt-dev 2.5.3+dfsg-8build1
- ubuntu stonking: blt-dev 2.5.3+dfsg-9
- Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms