?
Solved

X Windows C++ examples

Posted on 2006-05-08
7
Medium Priority
?
1,351 Views
Last Modified: 2013-12-27
Can someone help me to find an example of an X-Windows graphical program written in C++ or C.
I'm looking for something like a hello world application. I'd like to see how to implement a button or some simple control.

Thanks
ff
0
Comment
Question by:funkyfinger
  • 4
  • 2
7 Comments
 
LVL 2

Author Comment

by:funkyfinger
ID: 16644941
I'm starting to realize that this is a very broad question, as I research it I'm finding that the desktop I want to use GNOME uses a x window system called sawfish. I don't know if I can write generic code for both GNOME and KDE or for any x window system.

Still looking..
0
 
LVL 11

Accepted Solution

by:
cup earned 200 total points
ID: 16651996
If you want to go multi platform, you have
1) QT
2) WxWindows
3) FLTK

Might be easier using one of these as you can switch from Unix to Windows and not worry about it.  The examples are with the sources that you download.
0
 
LVL 2

Author Comment

by:funkyfinger
ID: 16664338
I'm not worried about MS Windows at all. I just want to program for any (I should say most or hopefully some) Linux distributions.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:leisner
leisner earned 200 total points
ID: 16664919
Xwindows run on almost any machine -- cygwin is pretty good (for mswindows machines).

But saying "I want to write an X window application" -- there are so many approaches:
  1) raw X
  2) toolkit (i.e. kde, wxwidgets)
  3) scripting language (i.e. tcl/tk)

All of these are viable and useful.

0
 
LVL 2

Author Comment

by:funkyfinger
ID: 16665574
Hmm,, maybe there is something I'm not getting. Or maybe I'm not communicating well.
I'm a pretty fair programmer, but I'm new to linux.  Normally I'd use MS's MFC to write graphical programs.  But in Linux I'm clueless.
I'd like to use C++ to write the graphical program. (by graphical program I mean a form with buttons, textboxes, checkboxes and so forth.)

I'm concerned about standard controls, for instance a clickable button. In MS Windows the space bar can be used to simulate a button click, or toggle a checkbox, also the tab key cycles though these controls. I want to keep with standard controls if they exist. I don't know if linux has standard controls like this.  I want to learn about how to go about writing this type of progam.

After I am comforable with this I  plan to go wth linux full force and get my company to adopt open source solutions.

Thanks for your help
ff
0
 
LVL 2

Author Comment

by:funkyfinger
ID: 16665599
Ahh,, thanks for your help
0
 
LVL 3

Expert Comment

by:leisner
ID: 16672581
The  beauty of Unix systems is "if you don't like something, do it your own way"

Hence a plethora of shells, window toolkits, etc.

I guess if you're talking about a "standard way"  -- like Andy Tanenbaum says "the wonderful thing about standards is there are so many of them".

The windowing system is just another application you talk to .

At the lowest level (I guess  the "standard") is X11.

Then there are lots of "toolkits" built upon them them you can use.

I would imagine there is an article aimed at exactly what you want to do...

I guess pick one and go with it...QT is fine...

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question