LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-01-2003, 12:47 PM   #1
MacKtheHacK
Member
 
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, 11:07 PM   #2
Corin
Member
 
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.
 
  


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

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

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

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