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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-01-2003, 12:47 PM
|
#1
|
Member
Registered: Jul 2003
Location: Boston, MA, USA
Distribution: RedHat, SuSE, Gentoo, Slackware, Mandrake ...
Posts: 111
Rep:
|
Making XWindows interfaces fallback to ncurses?
I'm trying to make a program that will present a nice XWindows interface when run on the desktop, but will fall back to a ncurses interface if X is not available. The idea is to have a nice interface when I can, but still provide a windowing interface on systems that don't have X installed. I know SuSE's YaST2 admin tool does this, and I'm wondering if there are any packages out there that provide this ability.
What I'd like ideally is a library which abstracts the UI, so I just write to one API and it takes care of deciding if it should use a graphical or a text interface. Does anyone know of such a library, or any projects that are trying to develop one?
|
|
|
08-01-2003, 11:07 PM
|
#2
|
Member
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446
Rep:
|
What you have to do is to write two interfaces to the program.
First test if DISPLAY is set , or -display host:0.0 is given on the command line.
Try to connect to the DISPLAY.
If it succeeds, go into the X loop part of the code.
It if fails, go into the ncurses interface part of the code.
|
|
|
All times are GMT -5. The time now is 03:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|