?
Solved

Creating a simple input dialog box using X11 Motif...

Posted on 2001-07-07
9
Medium Priority
?
1,659 Views
Last Modified: 2013-12-27
Hi,

I am new to XWindows programming. I am interested in creating a simple dialog box with a couple of text input fields and an OK and a Cancel button. (Sort of like a login box). This will be for the UNIX/Linux platforms. Can anyone please tell me how I could program this dialog box? Example code showing how to accomplish this will be appreciated!

Thanks in advance!
0
Comment
Question by:baigmz
  • 3
  • 3
  • 3
9 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 225 total points
ID: 6262527
It depends on what toolkit you want to use, currently the most popular are GTK (used by Gnome) and QT (used by KDE), head over to http://www.gtk.org or http://www.trolltech.com for starters. You might also find http://www.linuxprogramming.com handy, especially this section http://www.linuxprogramming.com/Information_and_Documentation .
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6263080
how about Tcl/Tk http://www.scriptics.com/
looks like:

echo 'pack [button .b -text "make me red" -command ".b config -bg red"]'| wish
0
 
LVL 17

Expert Comment

by:dorward
ID: 6263243
Damm, just noticed the work Motiff in the question header!

Try here: http://www.lesstif.org/links.html
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:baigmz
ID: 6263341
Thanks, I'll try the links this week and let you know.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6264041
yes I recogniced the question header, and even the EE Topic.
But the question looked to me that baigmz wants a quick&easy solution, not really X/Motif-programming.
PLease correct me if I'm wrong.
0
 
LVL 17

Expert Comment

by:dorward
ID: 6264896
ahoffmann: I made the correction becuase I sent him up the path of gnome/kde, not becuase of your tcl answer.
0
 

Author Comment

by:baigmz
ID: 6265234
Okay, I don't know what the differences between GTK QT and TK approaches to my requirement are but what I am looking for a is a quick and easy C language approach to write a dialog box, which takes in two inputs (a username and a password). It should also (obviously) have the OK and  Cancel buttons. I intend to call this dialog box from a C program written on Linux (Redhat 7.0). Once the dialog box works, I intend to use the SAME dialog box code on a version of Unix from the same C-code ported for that platform.

Please let me know if the links you have sent to me would help. I would prefer a pointer to chapter or a topic which shows me how to do that instead of an entire Motif or XWindows programming website.

Thanks in advance!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6269775
> .. C language approach ..
then go with dorward's suggestion

> .. quick and easy C language approach ..
No way. X and X/Motif isn't quick and easy. Be prepared for a few dozent lines of code just having a simple Button. The have fun porting to other UNIX platforms, 'cause each needs its own Motif-license.

With Tcl/TK you'll have a simple and short GUI. It's running on any UNIX where Tcl/TK is available without changing a single character. It even runs um M$'s NT and w3k (usually also without changes).
You may call the TK-program from within your C-program using the system() call, or better using pipes if you need to process the values entered in the GUI.
You even may use TK-functionality from within your C-program directly using the libtk.a (sorry can't help you in this scenario).
0
 

Author Comment

by:baigmz
ID: 6270533
After spending some time looking around from these the linux programming links, I managed to find a tutorial which has taught me how to program the UI I need. Thanks for your answer.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

755 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