home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!fauern!uni-erlangen.de!cip.informatik.uni-erlangen.de!fkmunker
- From: fkmunker@cip.informatik.uni-erlangen.de (Frank Munkert)
- Newsgroups: comp.windows.x.motif
- Subject: Re: Label Widget HELP!!
- Date: Wed, 30 Dec 1992 09:10:20 GMT
- Organization: CSD., University of Erlangen
- Distribution: inet
- Message-ID: <1hrp1sEINN98k@uni-erlangen.de>
- References: <1992Dec29.165336.719@uoft02.utoledo.edu>
- NNTP-Posting-Host: faui00a.informatik.uni-erlangen.de
- Lines: 54
-
- dsriniv@uoft02.utoledo.edu writes:
-
- >I am learning X-Windows (Motif) and trying to change the
- >resources of a label widget for a simple sample program
- >which just displays the label in a window. I am trying
- >to center the label string (which is of 3 lines) where
- >each line should be in the center of the window. But it is
- >getting left justified. I also don't know where to keep
- >the resource file for my label widget i.e which directory.
-
- Try this:
-
-
- 1. Compile and link the following program:
-
- #include <Xm/Label.h>
-
- Widget appshell, the_label;
-
- void main (argc, argv)
- int argc;
- char *argv[];
- {
- appshell = XtInitialize (argv[0], "LabelTest", NULL, 0, &argc, argv);
- the_label = XmCreateLabel (appshell, "TheLabel", NULL, 0);
- XtManageChild (the_label);
- XtRealizeWidget (appshell);
- XtMainLoop ();
- exit (0);
- }
-
-
- 2. Create a resource file with the name "LabelTest" and the following content:
-
- *TheLabel.labelString: First line\nThe Second line\n3rd line
-
- and put the resource file in a directory, say $HOME/test/app-defaults.
-
- 3. Now assign the name of this directory + "/%N" to the environment variable
- XUSERFILESEARCHPATH:
-
- setenv XUSERFILESEARCHPATH ${HOME}/test/app-defaults/%N
-
- 4. Run the program; it should display the Label widget with three centered
- lines.
-
- Greetings,
- Frank (fkmunker@cip.informatik.uni-erlangen.de)
-
- ---
- Frank Munkert | Uni Erlangen
- Zum Froschbruecklein 5 |
- 8500 Nuernberg 10 | <fkmunker@cip.informatik.uni-erlangen.de>
- Germany | or: <fmu@pki-nbg.philips.de>
-