Zenity display text in message dialog

by Daniel Pham
Published: Updated:
This entry is part 12 of 13 in the series GUI for bash script using Zenity

Zenity supports a number of message types. This article will guide you through these types of messages. To make the message dialog very simple, just use the --text option with the message type option.

The dialog dialog dialog supports the following four message types:

  • Information
  • Question
  • Warning
  • Error

Create an information dialog

To create the information dialog, use the following command:

zenity --info --text="WriteBash.com demo info message dialog"

And see the result as image below.

Zenity display text in message dialog
An information dialog.

Create a question dialog

To create a question dialog, use the following command:

zenity --question --text="Do you like WriteBash blog?"

And see the result as image below.

Zenity display text in message dialog
A question dialog.

Create a warning dialog

Read moreCreate a form dialog.

Use the following command to create a warning dialog:

zenity --warning --text="WriteBash.com demo a warning message"

And see the result as image below.

Zenity display text in message dialog
A warning dialog.

Create an error dialog

Use the following command to create an error dialog:

zenity --error --text="WriteBash demo an error message"

And see the result as image below.

Zenity display text in message dialog
An error dialog.

Conclusion

Through this article, you can create simple message dialogs. Supports 4 types of message dialog, you can use it flexibly. And I think that these dialogs will be used a lot in your program.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

GUI for bash script using Zenity

Zenity create a text entry dialog Zenity create a text information dialog
0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.