Help with OpenWindows
Chuck Musciano
chuck at trantor.harris-atd.com
Wed Feb 28 03:59:17 AEST 1990
I am just beginning to use OpenWindows, and have discovered that the
documentation is missing one important part: the OpenWindows Programmers
Guide. While the API Reference Manual and Porting Guide are fine in their
own right, you cannot get any real work done without a programmer's guide.
In particular, the API reference has absolutely no example code in it to
help you out.
Am I missing something fundamental? Did I not get a complete manual set?
Where do I turn for example code and a more tutorial approach? I am a
wizened SunView veteran, and I want to learn XView as a complete system,
not just how to convert tools.
My flails are prompted by some problems in opening a font. The font
attributes include FONT_FAMILY, and FONT_STYLE. The API reference says
that these attributes accept character strings for their values. (What a
help, huh?) Perusing the include files (which I should NEVER have to do)
tells me that things like FONT_FAMILY_LUCIDA and FONT_STYLE_BOLDITALIC are
acceptable values for these attributes (I think). However, using these
attributes results in the default font, I think. Here is my code:
#include <stdio.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/font.h>
main(argc, argv)
int argc;
char **argv;
{ Frame frame;
Panel panel;
Xv_font font;
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
font = xv_create(NULL, FONT,
FONT_FAMILY, FONT_FAMILY_LUCIDA,
FONT_SIZE, 14,
FONT_STYLE, FONT_STYLE_BOLD_ITALIC,
0);
frame = xv_create(NULL, FRAME, XV_LABEL, "A simple window", 0);
panel = xv_create(frame, PANEL,
XV_WIDTH, 400,
XV_HEIGHT, 200,
0);
xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "A Button",
PANEL_LABEL_FONT, font,
0);
window_fit(frame);
window_main_loop(frame);
}
My button is always displayed in the default font. What gives? How do I
know what values are appropriate for these attributes? Where is some real
documentation on this?
Chuck Musciano ARPA : chuck at trantor.harris-atd.com
Harris Corporation Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912 AT&T : (407) 727-6131
Melbourne, FL 32902 FAX : (407) 727-{5118,5227,4004}
I'm glad you asked, son. Being popular
is the most important thing in the world. -- Homer Simpson
More information about the Comp.sys.sun
mailing list