LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-25-2015, 10:25 AM   #1
honest_abe
LQ Newbie
 
Registered: Apr 2015
Posts: 20

Rep: Reputation: Disabled
zenity with pango? Am I missing software package?


System: Ubuntu 14. Downloaded April 2015

People have posted about using pango in a zenity command. Something like this should work:
zenity --info --text '<span color="green"></span>'"Hi mom"
but no color change occurs in the zenity box.

Do I need another package to make it work?

Last edited by honest_abe; 04-27-2015 at 04:07 PM. Reason: Typo
 
Old 04-27-2015, 07:43 PM   #2
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 305

Rep: Reputation: 89
I think you need to check your quotes. Maybe try putting quotes around the entire 'text' argument.
Code:
zenity --info --text "<span color=\"green\">Hi mom</span>"
This works for me but I'm using zenity version 2.32.
 
1 members found this post helpful.
Old 04-28-2015, 10:31 AM   #3
honest_abe
LQ Newbie
 
Registered: Apr 2015
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ordealbyfire83 View Post
I think you need to check your quotes. Maybe try putting quotes around the entire 'text' argument.
Code:
zenity --info --text "<span color=\"green\">Hi mom</span>"
This works for me but I'm using zenity version 2.32.
Thanks for your reply. I tried it exactly as you wrote but no luck. I have a minimal system so only openbox and X. That's what made me think I might need another package.

The manner of writing it with single quotes around the whole span section was copied from someone in a posting somewhere who was telling another poster how to do it.

No error from zenity. No green either.
 
Old 04-29-2015, 04:54 PM   #4
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 305

Rep: Reputation: 89
You could try using an older version of zenity. You would probably need to compile a gtk2 version of zenity (like 2.32) against gtk2 and go from there. The new versions are built for GTK3 and of course inherit everything that comes along with that. Many features in GTK3 are getting removed.

Here you can get an idea of the build dependencies. You should be able to use all of the build dependencies from your current distro.

Also note that I moved the </span> to after Hi mom. The color needs to "span" the text or else the instruction to change color ends before your text gets parsed.
 
Old 04-30-2015, 05:05 PM   #5
honest_abe
LQ Newbie
 
Registered: Apr 2015
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ordealbyfire83 View Post

Also note that I moved the </span> to after Hi mom. The color needs to "span" the text or else the instruction to change color ends before your text gets parsed.
The span at the end fixed the --info option and, in fact, allowed my real zenity command (zenity --list --radiolist) to also output what is in --text in large green font. However, the --column does not allow a span nor does the data lines.
 
Old 05-03-2015, 10:31 PM   #6
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 305

Rep: Reputation: 89
I'm not too sure that's going to work. First of all, I presume you have something like
Code:
zenity  --list --title "Window Title"  --text "Some text here." --radiolist  --column "Select" --column "Item" FALSE "1" FALSE "2" FALSE "3" FALSE "4"
According to this thread it only looks like a handful of options support markup with (radio)lists' entries not being among them.

There is a fork of zenity called yad that supposedly has some improvements. Unfortunately I haven't had the time to look into it yet.
 
Old 05-04-2015, 07:50 AM   #7
honest_abe
LQ Newbie
 
Registered: Apr 2015
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ordealbyfire83 View Post
I'm not too sure that's going to work. First of all, I presume you have something like
Code:
zenity  --list --title "Window Title"  --text "Some text here." --radiolist  --column "Select" --column "Item" FALSE "1" FALSE "2" FALSE "3" FALSE "4"
According to this thread it only looks like a handful of options support markup with (radio)lists' entries not being among them.

There is a fork of zenity called yad that supposedly has some improvements. Unfortunately I haven't had the time to look into it yet.
I started using yad and abandoned zenity. It works far far better and I would encourage abandoning zenity for new projects. However, like zenity, it has insufficient examples and so it is difficult to figure out how to accomplish tasks. It seems that most of the examples are repeats of the same thing.

Thanks for all replies.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I broke my linux :( I did apt-get remove zenity. Now my desktop is missing. jessregan Linux - Newbie 2 02-24-2012 08:25 AM
error in the creation of `etc/pango/pango.modules` okeyla Linux - Newbie 3 07-02-2011 08:06 PM
Pango source and package ptothed Linux - Software 3 12-03-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration