iwidgets::finddialog(1)

πŸ’– NAME πŸ’–

okay bestie, gather round β€” this is the manual page for iwidgets::finddialog(1), and it does exactly what the name says: Create and manipulate a find dialog widget ✨


🌸 SYNOPSIS 🌸

iwidgets::finddialog pathName ?options?

that's it. that's the whole summoning ritual. πŸͺ„


πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, and yes she comes from good stock:

itk::Toplevel ← iwidgets::Shell ← iwidgets::Dialogshell ← iwidgets::Finddialog

four generations deep, main character energy all the way down πŸ’…


✨ STANDARD OPTIONS ✨

  • activeBackground
  • activeForeground
  • background
  • borderWidth
  • cursor
  • disabledForeground
  • font
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • insertBorderWidth
  • insertOffTime
  • insertOnTime
  • insertWidth
  • selectBackground
  • selectBorderWidth
  • selectColor
  • selectForeground

fr fr, see the options manual entry for the deets on all of the standard options πŸ‘‘


πŸŽ€ ASSOCIATED OPTIONS πŸŽ€

  • selectColor β€” the checkbutton one. See the checkbutton widget manual entry for details on the above associated options 🫢
  • selectColor β€” yep, again, but this time it's the entryfield one. See the entryfield widget manual entry for details on the above associated options 🫢
  • labelFont β€” see the labeledwidget widget manual entry for details on the above associated options 🫢

two different selectColors living their separate lives, iykyk πŸ’œ


πŸ’… INHERITED OPTIONS πŸ’…

  • buttonBoxPadX
  • buttonBoxPadY
  • buttonBoxPos
  • padX
  • padY
  • separator
  • thickness

all seven of those? straight from the dialogshell widget manual entry, go peek for details πŸ’–

  • height
  • master
  • modality
  • width

these four came over from the shell widget manual entry β€” details live there πŸ¦‹

  • title

and title is the Toplevel one, see the Toplevel widget manual entry for details ⭐


πŸ”₯ WIDGET-SPECIFIC OPTIONS πŸ”₯

now THIS is the good part, the options that are just hers ✨

  • -clearcommand β€” Name: clearCommand, Class: Command, Command-Line Switch: -clearcommand. You hand it a command and it gets invoked following a clear operation. The whole point is notification β€” letting you know the clear actually happened so other stuff can react, like disabling a find again menu πŸ’«
  • -matchcommand β€” Name: matchCommand, Class: Command, Command-Line Switch: -matchcommand. A command invoked following a find operation. It's called with a match point as an argument, and that match point identifies exactly where in the text or scrolledtext widget the match is located. If no match was found, that match point is {}. Again it's a notification thing β€” the find operation finished, so go do your other actions, like disabling a find again menu option when the match point came back as {} πŸ”
  • -patternbackground β€” Name: patternBackground, Class: Background, Command-Line Switch: -patternbackground. The background color of the text matching the search pattern. Takes any of the forms accepted by Tk_GetColor. Default is gray44 🎨
  • -patternforeground β€” Name: patternForeground, Class: Background, Command-Line Switch: -patternforeground. The foreground color of the text matching the search pattern. Any of the forms accepted by Tk_GetColor. Default is white 🀍
  • -searchbackground β€” Name: searchBackground, Class: Background, Command-Line Switch: -searchbackground. The background color of the line containing the matching the search pattern. Any of the forms accepted by Tk_GetColor. Default is gray77 🌫️
  • -searchforeground β€” Name: searchForeground, Class: Background, Command-Line Switch: -searchforeground. The foreground color of the line containing the matching the search pattern. Any of the forms accepted by Tk_GetColor. Default is black πŸ–€
  • -textwidget β€” Name: textWidget, Class: TextWidget, Command-Line Switch: -textwidget. Specifies the text or scrolledtext widget to be searched 🎯

🌈 DESCRIPTION 🌈

so what IS this thing? The iwidgets::finddialog command creates a find dialog that works in conjunction with a text or scrolledtext widget to provide a means of performing search operations. The user gets prompted for a text pattern to be found in the text or scrolledtext widget πŸ’–

And the search can be for all occurances, by regular expression, considerate of the case, or backwards πŸŒ€


⭐ METHODS ⭐

The iwidgets::finddialog command creates a new Tcl command whose name is pathName. That command is what you use to invoke various operations on the widget. General form:

pathName option ?arg arg ...?

option and the args determine the exact behavior of the command. The following commands are possible for finddialog widgets πŸ‘‡

πŸ’« INHERITED METHODS πŸ’«

  • add
  • buttonconfigure
  • defaulthide
  • invoke
  • show

see the buttonbox widget manual entry for details on the above inherited methods 🫢

  • activate
  • center
  • deactivate

see the shell widget manual entry for details on the above inherited methods πŸ’œ

πŸ‘‘ WIDGET-SPECIFIC METHODS πŸ‘‘

pathName cget option

Returns the current value of the configuration option given by option. option may have any of the values accepted by the iwidgets::finddialog command.

pathName clear

Clears the pattern in the entry field and the pattern matchin indicators in the text or scrolledtext widget. 🧹

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

Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. option may have any of the values accepted by the iwidgets::finddialog command.

pathName find

Search for a specific text string in the text widget given by the -textwidget option. This method is the standard callback for the Find button. It is made available such that it can be bound to a find again action. πŸ”Ž


🧩 COMPONENTS 🧩

  • all β€” Class: Checkbutton. The all component specifies that all the matches of the pattern should be found when performing the search. See the checkbutton widget manual entry for details on the all component item βœ…
  • backwards β€” Class: Checkbutton. The backwards component specifies that the search should continue in a backwards direction towards the beginning of the text or scrolledtext widget. See the checkbutton widget manual entry for details on the backwards component item βͺ
  • case β€” Class: Checkbutton. The case component specifies that the case of the pattern should be taken into consideration when performing the search. See the checkbutton widget manual entry for details on the case component item πŸ” 
  • pattern β€” Class: Entryfield. The pattern component provides the pattern entry field. See the entryfield widget manual entry for details on the pattern component item ⌨️
  • regexp β€” Class: Checkbutton. The regexp component specifies that the pattern is a regular expression. See the checkbutton widget manual entry for details on the regexp component item 🧠

🌟 EXAMPLE 🌟

here's the whole vibe in action, no cap:

package require Iwidgets 4.0
iwidgets::scrolledtext .st
pack .st
.st insert end "Now is the time for all good men\n"
.st insert end "to come to the aid of their country"

iwidgets::finddialog .fd -textwidget .st
.fd center .st
.fd activate

literally that's it and you're searching πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

Mark L. Ulferts πŸ‘‘


πŸ”‘ KEYWORDS πŸ”‘

finddialog, dialogshell, shell, widget


and that's a wrap bestie!! this was the iwidgets::finddialog(1) page from the Tk corner of the world β€” go find yourself some patterns, slay, and remember: match point {} means she didn't find it, no hard feelings πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from