Solved

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

Posted on 2001-07-07
9
1,573 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 75 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

828 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