GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.TextEntryDialog
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.TextEntryDialog — wxPython 4.3.2 Docs

phoenix_title wx.TextEntryDialog¶

This class represents a dialog that requests a one-line text string from the user.

It is implemented as a generic wxWidgets dialog.

See also

TextEntryDialog Overview


class_hierarchy Class Hierarchy¶

Inheritance diagram for class TextEntryDialog:

Inheritance diagram of TextEntryDialog


appearance Control Appearance¶


wxMSW

wxMSW¶

wxGTK

wxGTK¶

wxMAC

wxMAC¶


sub_classes Known Subclasses¶

wx.PasswordEntryDialog


method_summary Methods Summary¶

__init__

Default constructor.

Create

ForceUpper

Convert all text entered into the text control used by the dialog to upper case.

GetClassDefaultAttributes

GetValue

Returns the text that the user has entered if the user has pressed wx.OK, or the original value if the user has pressed Cancel.

SetHint

Sets the hint shown in the empty text control.

SetMaxLength

This function sets the maximum number of characters the user can enter into this dialog.

SetValue

Sets the default text value.

ShowModal

Shows the dialog, returning wx.ID_OK if the user pressed wx.OK, and wx.ID_CANCEL otherwise.


property_summary Properties Summary¶

Value

See GetValue and SetValue


api Class API¶

class wx.TextEntryDialog(Dialog)¶

Possible constructors:

TextEntryDialog() -> None

TextEntryDialog(parent, message, caption=GetTextFromUserPromptStr,
                value='', style=TextEntryDialogStyle, pos=DefaultPosition,
                sz=DefaultSize) -> None

This class represents a dialog that requests a one-line text string from the user.


Methods¶

__init__(self, *args, **kw)¶

overload Overloaded Implementations:



__init__ (self)

Default constructor.

Call Create to really create the dialog later.

Return type:

None

Added in version 2.9.5.



__init__ (self, parent, message, caption=GetTextFromUserPromptStr, value=’’, style=TextEntryDialogStyle, pos=DefaultPosition, sz=DefaultSize)

Constructor.

Use ShowModal to show the dialog.

See Create method for parameter description.

Parameters:
  • parent (wx.Window)

  • message (string)

  • caption (string)

  • value (string)

  • style (long)

  • pos (wx.Point)

  • sz (wx.Size)

Return type:

None





Create(self, parent, message, caption=GetTextFromUserPromptStr, value='', style=TextEntryDialogStyle, pos=DefaultPosition, sz=DefaultSize)¶
Parameters:
  • parent (wx.Window) – Parent window.

  • message (string) – Message to show on the dialog.

  • caption (string) – The caption of the dialog.

  • value (string) – The default value, which may be the empty string.

  • style (long) – A dialog style, specifying the buttons (wx``wx.OK``, wx.CANCEL) and an optional wx.CENTRE style. Additionally, most wx.TextCtrl styles (such as TE_PASSWORD or TE_MULTILINE ) may be specified here, but TE_READONLY may not be used, as it doesn’t make sense for this dialog, used for text input.

  • pos (wx.Point) – Dialog position.

  • sz (wx.Size) – The size of the dialog (this parameter is only available since wxWidgets 3.3.0).

Return type:

bool

Added in version 2.9.5.



ForceUpper(self)¶

Convert all text entered into the text control used by the dialog to upper case.

Call this method to ensure that all text entered into the text control used by the dialog is converted on the fly to upper case. If the text control is not empty, its existing contents is also converted to upper case.

Return type:

None

Added in version 4.1/wxWidgets-3.1.0.

See also

wx.TextEntry.ForceUpper



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes



GetValue(self)¶

Returns the text that the user has entered if the user has pressed wx.OK, or the original value if the user has pressed Cancel.

Return type:

str



SetHint(self, hint)¶

Sets the hint shown in the empty text control.

Parameters:

hint (string)

Return type:

None

Added in version 4.3/wxWidgets-3.3.2.

See also

wx.TextEntry.SetHint



SetMaxLength(self, len)¶

This function sets the maximum number of characters the user can enter into this dialog.

Parameters:

len (long)

Return type:

None

Added in version 2.9.5.

See also

wx.TextEntry.SetMaxLength



SetValue(self, value)¶

Sets the default text value.

Parameters:

value (string)

Return type:

None



ShowModal(self)¶

Shows the dialog, returning wx.ID_OK if the user pressed wx.OK, and wx.ID_CANCEL otherwise.

Call GetValue to retrieve the values of the string entered by the user after showing the dialog.

Return type:

int


Properties¶

Value¶

See GetValue and SetValue

© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.