Article View: comp.windows.x
Article #8137Re: Help Wanted: XView PANEL_MULTILINE_TEXT problem
From: Liam R. E. Quin
Date: Tue, 15 Sep 1992 23:12
Date: Tue, 15 Sep 1992 23:12
124 lines
3180 bytes
3180 bytes
nzhang@umiacs.umd.edu (Ning Zhang) writes:
>I sent a request a few days ago but I did not get a workaround. Here
>is a simple program reproducing the problem (tested on 4.1.1 with
>Openwin 3.0 FCS and 4.1.3/w Openwin 3.0 patches).
You don't say what the problem is. You are setting the X of the text item's
VALUE to be rather small, so that it overlaps the label.
Here is a version that is more likely to be what you wanted.
Note that you don't need a Quit button, and OPEN LOOK UI programs in
general should not have one, as the window manager provides that function.
Lee
/*
* Test PANEL_MULTILINE_TEXT bug
*/
#include <xview/xview.h>
#include <xview/frame.h>
#include <xview/panel.h>
Frame frame;
Panel panel;
Frame cmd_frame;
Panel cmd_panel;
Panel mlinetxt;
char mlinetxtbuf[161];
void test();
void disp();
void quit();
main (argc, argv)
int argc;
char *argv[];
{
xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
frame = (Frame)xv_create(NULL, FRAME,
FRAME_LABEL, argv[0],
XV_WIDTH, 200,
XV_HEIGHT, 100,
NULL);
panel = (Panel)xv_create(frame, PANEL, NULL);
(void) xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Display",
PANEL_NOTIFY_PROC, disp,
NULL);
(void) xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Quit",
PANEL_NOTIFY_PROC, quit,
NULL);
xv_main_loop(frame);
}
void
test()
{
cmd_frame = xv_create(frame, FRAME_CMD,
XV_X, 0,
XV_Y, 0,
XV_HEIGHT, 100,
XV_WIDTH, 200,
XV_LABEL, "TEST",
XV_SHOW, TRUE,
NULL);
cmd_panel = xv_get(cmd_frame, FRAME_CMD_PANEL);
mlinetxt = panel_create_item(cmd_panel, PANEL_MULTILINE_TEXT,
#if 0
PANEL_LABEL_X, 10,
PANEL_LABEL_Y, 10,
PANEL_VALUE_X, 10,
PANEL_VALUE_X, 30,
#endif
PANEL_LABEL_STRING, "DETAIL DESCRPTION",
PANEL_VALUE, mlinetxtbuf,
PANEL_VALUE_DISPLAY_LENGTH, 80,
PANEL_VALUE_STORED_LENGTH, 320,
NULL);
window_fit(cmd_panel);
window_fit(cmd_frame);
}
void
disp()
{
static int count = 0;
printf("disp() count = %d\n", count);
if (count == 0)
{
test();
}
count++;
(void) sprintf(mlinetxtbuf, "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah %d\n", count);
xv_set(mlinetxt, PANEL_VALUE, mlinetxtbuf, NULL);
}
void
quit()
{
exit(0);
}
--
Liam Quin, lee@sq.com, SoftQuad, Toronto, 416 239-4801; the barefoot programmer
lq-text (Unix text retrieval package) mailing list: lq-text-request@sq.com
Technical Details
Message-ID:
<1992Sep15.231234.12890@sq.sq.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wildcan!sq!leeReferences:
<60310@mimsy.umd.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.x Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wildcan!sq!lee From: lee@sq.sq.com (Liam R. E. Quin) Subject: Re: Help Wanted: XView PANEL_MULTILINE_TEXT problem Message-ID: <1992Sep15.231234.12890@sq.sq.com> Organization: SoftQuad Inc., Toronto, Canada X-Feet: bare References: <60310@mimsy.umd.edu> Date: Tue, 15 Sep 92 23:12:34 GMT Lines: 125