Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 08-01-2003, 11:47 AM   #1
Registered: Jul 2003
Location: Boston, MA, USA
Distribution: RedHat, SuSE, Gentoo, Slackware, Mandrake ...
Posts: 111

Rep: Reputation: 15
Question 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?
Old 08-01-2003, 10:07 PM   #2
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
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.


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
making WiFi settings in /etc/network/interfaces permanent Lleb_KCir Linux - General 3 05-10-2005 11:22 PM
Making XWindows interfaces fallback to ncurses? MacKtheHacK Programming 3 08-01-2003 04:32 PM
wired to wireless fallback blackrose Linux - Wireless Networking 0 07-08-2003 10:01 AM
procmail fallback mazzo Linux - Newbie 3 06-09-2003 07:52 AM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:46 PM.

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