Solved

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

Posted on 2001-07-07
9
1,616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.:
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.

615 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