PyGUIBox

A simple cross-platform tool for creating GUI message boxes.


Keywords
Message, Box, GUI, Alert, Input, MsgBox
License
MIT
Install
pip install PyGUIBox==0.4

Documentation

PyGUIBox | Version 0.4

PyGUIBox is a simple cross-platform tool for creating GUI message boxes.

pip install pyguibox

Example Usage

Show an custom message box

Displays the box message that you have customized.
You can customize the icons and buttons in this section.
Acceptable icons = 1, 2, 3
Acceptable modes = 1, 2, 3, 4, 5
-----[ Icons ]-----
1 : Warning icon
2 : Info icon
3 : Error icon
-----[ Modes Buttons ]-----
1 : Ok
2 : Ok, Cancel
3 : Yes, No, Cancel
4 : Yes, No
5 : Ok, Help

Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> box = messagebox(message="This is a test", title="Test Title", mode=3, icon=3)
    'Yes'
    >>> box = messagebox(message="This is a test", title="Test Title", mode=2, icon=2)
    'Cancel'
    >>> box = messagebox(message="This is a test", title="Test Title", mode=1, icon=1)
    'OK'

Show an alert box

Displays a simple message box with text and a single OK button.
Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> pyguibox.alert("This is a test")
    'OK'
    >>> pyguibox.alert("This is a test", title="Message box title")
    'OK'

Show an error box

Displays a simple message box with error icon and a single OK button.
Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> pyguibox.error("This is a test")
    'OK'
    >>> pyguibox.error("This is a test", title="Message box title")
    'OK'

Show an info box

Displays a simple message box with info icon and a single OK button.
Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> pyguibox.info("This is a test")
    'OK'
    >>> pyguibox.info("This is a test", title="Message box title")
    'OK'

Show an warn box

Displays a simple message box with warn icon and a single OK button.
Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> pyguibox.warn("This is a test")
    'OK'
    >>> pyguibox.warn("This is a test", title="Message box title")
    'OK'

Show an confirm box

Displays a simple confirm box.
You can customize the text and title of this message box.
This message box also has the ability to change the mode.
Mode 1 buttons: OK, Cancel
Mode 2 buttons: Yes, No, Cancel
Returns the text of the button clicked on.

  • You can also set the title of the message box.
    Buttons for this message: OK
    >>> import pyguibox
    >>> box = pyguibox.confirm("This is a test", mode=1)
    'OK'
    >>> box = pyguibox.confirm("This is a test", mode=2)
    'Yes'
    >>> box = pyguibox.confirm("This is a test", mode=1, title="Message box title")
    'Cance;'
    >>> box = pyguibox.confirm("This is a test", mode=2, title="Message box title")
    'No'

Show an input box

Displays a message box with text input.
You can customize the text and title of this message box.
Returns text entered by the user.
(None return: The user has not entered anything)
(Cancel return: The user has clicked the cancel button)

  • You can also set the title of the message box.
    Mode 1 buttons: OK, Cancel
    >>> import pyguibox
    >>> box = pyguibox.prompt("Enter your name :")
    'Cancel'
    >>> box = pyguibox.prompt("This is a test")
    'None'
    >>> box = pyguibox.prompt("This is a test")
    'this is a test'

Show an password input box

Displays a message box with text input.
(The text entered by the user is displayed as *)
You can customize the text and title of this message box.
Returns text entered by the user.
(None return: The user has not entered anything)
(Cancel return: The user has clicked the cancel button)

  • You can also set the title of the message box.
    Mode 1 buttons: OK, Cancel
    >>> import pyguibox
    >>> box = pyguibox.password("Enter your name :")
    'Cancel'
    >>> box = pyguibox.password("This is a test")
    'None'
    >>> box = pyguibox.password("This is a test")
    'abcdefgh'

How Does PyGUIBox Work?

This library is currently running on Windows.
After installing the library on the system, you can use the library