iwidgets::extbutton(1)
π iwidgets::extbutton β the manual, but make it make sense π
okay bestie, welcome to iwidgets::extbutton, a page from the [incr Widgets] manual set. it's a Tk button that leveled up, fr fr. let's get into it πΈ
β¨ NAME β¨
iwidgets::extbutton β it extends the behavior of the Tk button by letting a bitmap or an image coexist with text. yes, both. at the same time. iconic π
π SYNOPSIS π
iwidgets::extbutton pathName ?options?
π¦ INHERITANCE π¦
itk::Widget <- iwidgets::Extbutton
so it's giving itk::Widget, and iwidgets::Extbutton is the main character downstream of it π
β STANDARD OPTIONS β
these are the classics, the standard-issue ones:
activebackgroundactiveforegroundbitmapbackgroundbdcursordisabledforegroundfontforegroundimagejustifyrelieftext
heads up bestie: go read the "options" manual entry for the details on all of these standard options. that's where the lore lives π
π WIDGET-SPECIFIC OPTIONS π
these are the options that make this widget this widget. no cap.
-bitmapforegroundβ Name:bitmapforeground, Class:Foreground, Command-Line Switch:-bitmapforeground. Configures the foreground color of the bitmap. that's it, that's the job π-commandβ Name:command, Class:Command, Command-Line Switch:-command. Associate a command with the extbutton. it simulates a Tk button's-commandoption. it gets invoked by either<1>events or by explicitly calling the publicinvoke()method. your call, bestie π«Ά-defaultringβ Name:defaultring, Class:DefaultRing, Command-Line Switch:-defaultring. A boolean describing whether the extbutton displays its default ring, given in any of the forms acceptable toTcl_GetBoolean. the default is false. periodt.-defaultringpadβ Name:defaultringpad, Class:Pad, Command-Line Switch:-defaultringpad. Specifies the amount of space to be allocated to the indentation of the default ring, given in any of the forms acceptable toTcl_GetPixels. β οΈ this option has no effect if thedefaultringoption is set to false. the default is 4 pixels.-imageposβ Name:imagePos, Class:Position, Command-Line Switch:-imagepos. Specifies the image position relative to the message text:n,ne,nw,s,se,sw,w,wn,ws,e,en, ores. the default is w. lowkey a whole compass up in here π§-ringbackgroundβ Name:ringBackground, Class:Background, Command-Line Switch:-ringbackground. Configures the background color of the default ring frame (if-defaultringis set to boolean true). β¨
π« DESCRIPTION π«
The extbutton extends the behavior of the atomic Tk button by allowing text and an image or bitmap to coexist. yep, coexist. they're roommates, they get along π€
You can use the -image or -bitmap options to specify an image, plus the -imagepos option to specify where that image sits relative to the text.
π¨ real talk: the extbutton is not intended to be used without an image/bitmap. There will be an empty space next to the text if no image/bitmap is specified. (yes, the original says "emtpy" β we keep it real here. no image = no image, just vibes and a gap π)
πͺ METHODS πͺ
The iwidgets::extbutton command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget.
It has the following general form:
pathName option ?arg arg ...?
πΈ INHERITED METHODS πΈ
Each of the following methods are inherited from itk::Archetype. Go read that man page for the details, bestie:
pathName cgetpathName componentpathName configpathName configure
π WIDGET-SPECIFIC METHODS π
pathName invokeβ Evaluates the command fragment associated with the-commandoption. π₯pathName flashβ Simulates the Tk button's flash command. β‘
π₯ EXAMPLES π₯
okay, this is the part where it all comes together. look at her go:
package require Iwidgets 4.0 iwidgets::extbutton .eb -text "Bitmap
example" -bitmap info \
-background bisque -activeforeground red -bitmapforeground blue \
-defaultring 1 -command {puts "Bisque is beautiful"} pack .eb -expand
1
and the glow-up version with an actual image:
iwidgets::extbutton .eb -text "Image example" -relief ridge -image \
[image create photo -file
$itk::library/../iwidgets/demos/images/clear.gif] \
-font 9x15bold -background lightgreen -imagepos e \
-activebackground lightyellow pack .eb -expand 1
"Bisque is beautiful" β honestly? a mood. π
π AUTHOR π
Chad Smith π
π KEYWORDS π
button, pushbutton
and that's the whole page, bestie!! this one ships out of the Tk manual set, part of [incr Widgets] β iwidgets::extbutton(1), and it lives right there in the Tk family. go forth and make pretty buttons with text and images, you absolute icon ππβ¨
π¦ where this page comes from
- debian bookworm: iwidgets4-doc 4.1.1-2.1
- debian trixie: iwidgets4-doc 4.1.1-4
- ubuntu jammy: iwidgets4-doc 4.1.1-2.1
- ubuntu noble: iwidgets4-doc 4.1.1-2.1
- ubuntu resolute: iwidgets4-doc 4.1.1-4
- ubuntu stonking: iwidgets4-doc 4.1.1-4
- Copyright (c) 1995 DSC Technologies Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms