iwidgets::pushbutton(1)

πŸ’– iwidgets::pushbutton β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to iwidgets::pushbutton(1), the incr Widgets manual entry. yes it's a manual page. no it does not have to be boring. let's go 🫢


✨ NAME ✨

iwidgets::pushbutton β€” bestie, it creates and manipulates a push button widget. that's the whole vibe. a button. you push it. iconic.


✨ SYNOPSIS ✨

iwidgets::pushbutton pathName ?options?

like. that's it. that's the whole summoning ritual πŸ•―οΈ


πŸ¦‹ INHERITANCE πŸ¦‹

itk::Widget <- iwidgets::Pushbutton

so it inherits from itk::Widget β€” it's giving nepo baby but in a cute way, it earned it πŸ’…


🌈 STANDARD OPTIONS 🌈

these are the options it got from the family. all of them. every single one, no skips:

  • activeBackground
  • activeForeground
  • background
  • bitmap
  • borderWidth
  • command
  • cursor
  • disabledForeground
  • font
  • foreground
  • highlightBackground
  • highlightColor
  • highlightThickness
  • image
  • padX
  • padY
  • state
  • text
  • underline
  • wrapLength

fr fr, if you wanna know what any of these do, go read the options manual entry. it's all in there, i'm not retyping the whole thing, that's a them problem.


πŸŽ€ WIDGET-SPECIFIC OPTIONS πŸŽ€

these ones are hers. her own little options. obsessed.

  • Name: defaultRing Β· Class: DefaultRing Β· Command-Line Switch: -defaultring

a Boolean (any form Tcl_GetBoolean will accept, bestie) that says whether the button shows its default ring or not. the default is false. so like, off unless you ask. respect.

  • Name: defaultRingPad Β· Class: Pad Β· Command-Line Switch: -defaultringpad

how much space gets allocated to the indentation of the default ring β€” given in any of the forms acceptable to Tcl_GetPixels. heads up tho: this option does literally nothing if defaultring is set to false. the default is 2 pixels.

  • Name: height Β· Class: Height Β· Command-Line Switch: -height

the height of the button, inclusive of any default ring, in any form acceptable to Tk_GetPixels. and if you set it to 0? the push button decides the height itself based on the requested height plus highlightring and defaultringpad. she's autonomous. let her cook πŸ”₯

  • Name: width Β· Class: Width Β· Command-Line Switch: -width

same energy, but sideways: the width of the button, inclusive of any default ring, any form Tk_GetPixels likes. set it to 0 and the push button figures the width out from the requested width plus highlightring and defaultringpad. queen behavior πŸ‘‘


🌸 DESCRIPTION 🌸

the iwidgets::pushbutton command creates a push button with an optional default ring that's used for default designation and traversal. that ring? it's the little "hey, i'm the default one" moment. main character energy for real.


πŸ’œ METHODS πŸ’œ

so the iwidgets::pushbutton command makes a brand new Tcl command, and its name is pathName. you use that command to do stuff to the widget. general form goes like this:

pathName option ?arg arg ...?

option and the args decide exactly what happens. these are the commands you can run on pushbutton widgets:


🧚 ASSOCIATED METHODS 🧚

  • flash
  • invoke

and for the deets on those, go check the button manual entry. iykyk 🫢


⭐ WIDGET-SPECIFIC METHODS ⭐

  • pathName cget option

hands you back the current value of whatever configuration option you named in option. and option can be literally any of the values the iwidgets::pushbutton command accepts. easy.

  • pathName configure ?option? ?value option value ...?

query or modify the widget's configuration options, your call. the tea:

  • no option at all? you get a list describing all the available options for pathName. (peep Tk_ConfigureInfo if you wanna know the format of that list, bestie.)
  • option with no value? you get a list describing just that one named option. and it'll be identical to the matching sublist of the value you'd get with no option specified. consistent. we love that.
  • one or more option-value pairs? the command modifies the given widget option(s) to have the given value(s), and in that case it returns an empty string. that's it, that's the whole return.
  • and again, option can be any of the values the iwidgets::pushbutton command accepts.

πŸ’€ COMPONENTS πŸ’€

  • Name: pushbutton Β· Class: Button

this component is the button, surrounded by the optional default ring. that's the whole thing. for the details on the pushbutton component item, go read the button widget manual entry. i'm not gatekeeping, i'm just pointing you to the source 🫢


πŸ”₯ EXAMPLE πŸ”₯

here's the moment you've been waiting for:

package require Iwidgets 4.0 iwidgets::pushbutton .pb -text "Hello"
-command {puts "Hello World"} -defaultring 1 pack .pb -padx 10 -pady 10

it makes a button that says Hello, and when you push it, it puts "Hello World". and it's got the default ring. slay.


πŸ‘‘ AUTHOR πŸ‘‘

Bret A. Schuhmacher Mark L. Ulferts


πŸ“ KEYWORDS πŸ“

pushbutton, widget


okay that's the whole page bestie, you're now fluent in pushbutton. go push something. πŸ’…

and a lil sign-off for the very end: this page lives under the Tk source, and it's iwidgets::pushbutton(1) β€” that's the manual, that's the section, that's the whole flex. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from