WriteBash - In this article, I will introduce the rest of zenity, which is to create a text information dialog. This will help you create dialogs that display information from a text file. Normally, you will see dialog boxes displaying copyright information while installing certain software.
Creates a text information dialog
To create a text information dialog, use the zenity command with the
A blank dialog will appear.
If you just use the above then it seems to have no idea what for us. Now we see the other options supported for text-info. Using these new options really helps you do something.
Text info options
The following table lists the support options:
|The path to the file you want to display its content in the dialog. For example: |
|Allows you to edit text content when displayed in the dialog box. The edit information will be returned in the command window, not saved to the original text file. You can scale the dialog box using this option. You can try using and do not use this option.|
|Select the font to display the text in the dialog box. I rarely use this option.|
|Activate the checkbox in the text box as text “I have read and agree to the policies”.|
|Supports displaying html code in text file to dialog box.|
|Use url path instead of filename. This option is only available when using |
Below, I will open a text file that I created earlier. In that text file, I write simple content that includes a little html code.
Read more: Display text in a message dialog.
I will use the following command to create a text information dialog and display content that does not support html.
zenity --text-info --title="WriteBash.com - demo text-info dialog" --filename=/home/danie/Desktop/test.txt --editable
Next, I use the command with the html support option, let’s see how the results.
zenity --text-info --title="WriteBash.com - demo text-info dialog" --filename=/home/danie/Desktop/test.txt --editable --html
The remaining options, please try your own and experience how the results.
With just a few simple lines of code, you can create a text information dialog, in a very simple way. Using your imagination, you can use it in many different situations.If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.