iwidgets::promptdialog(1)

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

okay bestie, welcome to iwidgets::promptdialog(1), part of the [incr Widgets] fam, living in section 1 of your man pages. this is the prompt dialog widget and she is literally the moment. let's get into it 🫢


✨ NAME ✨

iwidgets::promptdialog β€” create and manipulate a prompt dialog widget. yes that's the whole job and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

iwidgets::promptdialog pathName ?options?

πŸ¦‹ INHERITANCE πŸ¦‹

the family tree is giving royal lineage, no cap:

itk::Toplevel    <-   iwidgets::Dialogshell   <-   iwidgets::Dialog   <-
iwidgets::Promptdialog

so she inherits from itk::Toplevel, which feeds iwidgets::Dialogshell, which feeds iwidgets::Dialog, which feeds iwidgets::Promptdialog. a whole dynasty πŸ‘‘


⭐ STANDARD OPTIONS ⭐

these are the classic ones everybody gets:

  • background
  • borderWidth
  • cursor
  • exportSelection
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • insertBorderWidth
  • insertOffTime
  • insertOnTime
  • insertWidth
  • relief
  • selectBackground
  • selectBorderWidth
  • selectForeground

see the options manual entry for the deets on all of the above standard options.


πŸŽ€ ASSOCIATED OPTIONS πŸŽ€

this one comes straight from the entry widget:

  • show

see the entry widget manual entry for details on the above associated options.

these cuties come from entryfield:

  • invalid
  • textBackground
  • textFont
  • validate

see the entryfield widget manual entry for details on the above associated options.

and these come from labeledwidget:

  • labelFont
  • labelPos
  • labelText

see the labeledwidget widget manual entry for details on the above associated options.


🌈 INHERITED OPTIONS 🌈

from dialogshell, we're borrowing:

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

see the dialogshell widget manual entry for details on the above inherited options.

from shell:

  • height
  • master
  • modality
  • width

see the shell widget manual entry for details on the above inherited options.

and from Toplevel:

  • title

see the Toplevel widget manual entry for details on the above inherited options.</purole>


πŸ’œ DESCRIPTION πŸ’œ

the iwidgets::promptdialog command creates a prompt dialog that's basically the OSF/Motif standard prompt dialog composite widget's spiritual twin. she's derived from the dialog class, and she's composed of an EntryField plus commands to manipulate the dialog buttons. it's giving "small widget, big responsibilities" πŸŽ€


✨ METHODS ✨

the iwidgets::promptdialog command makes a brand new Tcl command whose name is pathName. you use that command to invoke all kinds of operations on the widget. the general form is:

pathName option ?arg arg ...?

Option and the args decide exactly what the command does. here's what's possible for promptdialog widgets:

πŸ“ ASSOCIATED METHODS

from the entry widget, we've got:

  • delete
  • get
  • icursor
  • index
  • insert
  • scan
  • selection
  • xview

see the entry widget manual entry for details on the above associated methods.

from entryfield:

  • clear

see the entryfield widget manual entry for details on the above associated methods.

🧚 INHERITED METHODS

from buttonbox, serving us:

  • add
  • buttonconfigure
  • defaulthide
  • invoke
  • show

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

from dialogshell:

  • childsite

see the dialogshell widget manual entry for details on the above inherited methods.

from shell:

  • activate
  • center
  • deactivate

see the shell widget manual entry for details on the above inherited methods.

πŸ‘‘ WIDGET-SPECIFIC METHODS

  • pathName cget option β€” hands you the current value of the configuration option you named in option. Option can be literally any of the values the iwidgets::promptdialog command accepts. easy peasy.
  • pathName configure ?option? ?value option value ...? β€” query or modify the widget's configuration options. if you pass no option at all, you get back a list describing every available option for pathName (peep Tk_ConfigureInfo for how that list is formatted). if you pass an 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. and if you pass 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. Option may have any of the values accepted by the iwidgets::promptdialog command. periodt.

🌸 COMPONENTS 🌸

  • Name: prompt
  • Class: Entryfield

the prompt component is the entry field where the user types their input in the prompt dialog. see the entryfield widget manual entry for details on the prompt component item πŸŽ€


πŸ”₯ EXAMPLE πŸ”₯

here's the whole vibe in action, verbatim, no edits:

package require Iwidgets 4.0
option add *textBackground white

iwidgets::promptdialog .pd -modality global -title Password -labeltext
Password: -show *
.pd hide Apply

if {[.pd activate]} {
    puts "Password entered: [.pd get]"
} else {
    puts "Password prompt cancelled"
}

not her hiding the Apply button and gating the whole thing behind an if πŸ’€ iconic behaviour honestly.


πŸ’– AUTHOR πŸ’–

Mark L. Ulferts β€” thank you for your service, king 🫢


⭐ KEYWORDS ⭐

promptdialog, dialog, dialogshell, shell, widget


and that's the whole page, bestie! this one's from the Tk corner of the world, filed under iwidgets::promptdialog(1) β€” go forth and prompt, you've got this πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from