wxTextEntryDialog(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸŽ€ NAME πŸŽ€

ok bestie, so wxTextEntryDialog β€” this is a class that pops up a dialog asking the user for a one-line text string. That's it, that's the whole job. One line. No novel-length input, just a lil string. πŸ’…


✨ DESCRIPTION ✨

It's implemented as a generic wxWidgets dialog β€” no cap.

πŸ‘€ See also: Overview cmndlg

This class is derived from β€” and can absolutely use functions from β€” these icons:

  • wxDialog
  • wxTopLevelWindow
  • wxWindow
  • wxEvtHandler

πŸ“š wxWidgets docs: wxTextEntryDialog


πŸ¦‹ DATA TYPES πŸ¦‹

wxTextEntryDialog() :: wx:wx_object().

slay, it's just a wx:wx_object() and honestly that's the vibe πŸ’œ


🌸 FUNCTIONS 🌸

πŸ’€ destroy

destroy(This :: wxTextEntryDialog()) -> ok.

Destroys the object. yeah. gone. poof. it's giving cleanup era 🧹✨


πŸ” getValue

getValue(This) -> unicode:charlist()
                    when This :: wxTextEntryDialog().

Returns the text the user typed in β€” but only if they hit OK. πŸ™Œ If they pressed Cancel instead, you get back the original value. So no matter what, you're getting something back, not an error. lowkey merciful ngl 😭


🐣 new

new() -> wxTextEntryDialog().

Default constructor. That's it. That's the constructor. ✨

⚠️ Calling this alone doesn't actually build the dialog yet β€” you gotta call Create() (not implemented in wx) afterward to really create the dialog later.

Since: 2.9.5 πŸ•°οΈ


🌈 new/3

new(Parent, Message, [Option]) -> wxTextEntryDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Option ::
                     {caption, unicode:chardata()} |
                     {value, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}}.

Constructor β€” the one with ✨options✨. Here's the tea on the args:

  • Parent :: wxWindow:wxWindow() β€” who's the parent window, bestie
  • Message :: unicode:chardata() β€” the message you want to show
  • Option :: a list of optional tuples, and they are:
    • {caption, unicode:chardata()}
    • {value, unicode:chardata()}
    • {style, integer()}
    • {pos, {X :: integer(), Y :: integer()}}

Use wxDialog:showModal/1 to actually show the dialog. πŸ‘‘

For what all the parameters mean, go peek at the Create() method (not implemented in wx) β€” that's where the parameter description lives πŸ“


πŸ’– setValue

setValue(This, Value) -> ok
                    when
                        This :: wxTextEntryDialog(),
                        Value :: unicode:chardata().

Sets the default text value. So like, pre-fill the box with whatever you want the user to see first. Iconic little convenience πŸŽ€


that's the whole page, bestie β€” wxTextEntryDialog from the Ericsson AB girlies, version wx 2.6, and yes it's still serving the classic wxTextEntryDialog(3) energy πŸ’…βœ¨ go forth and collect exactly one (1) line of text 🫢

πŸ“¦ where this page comes from