sjg@zen.void.oz.au (Simon J. Gerraty) (12/06/90)
I am having some trouble converting one of my simple SunView
apps to run under XView (OpenWindows 2.0 on a 386i).
The thing is a simple time-sheet generator. I often have to
account for time spent on various projects and being lazy, I
tend not to do it unless it is _very_ easy. Enter "StopWatch",
which displays a list of buttons representing Task-codes, and a
description of each. Pressing a particular button causes a log
entry agains that task for the current "project". All very
simple.
The main problems I am having are:
1/ controlling location of objects within a window.
In SunView I used things like:
task_item[i] = panel_create_item(task_panel, PANEL_BUTTON,
PANEL_LABEL_IMAGE,
panel_button_image(task_panel,
tsk, 0, 0),
PANEL_CLIENT_DATA, tsk,
PANEL_NOTIFY_PROC, task_proc,
PANEL_LABEL_X, ATTR_COL(0),
PANEL_LABEL_Y, ATTR_ROW(i),
0);
panel_create_item(task_panel, PANEL_MESSAGE,
PANEL_LABEL_STRING, des,
PANEL_LABEL_X, ATTR_COL(8),
PANEL_LABEL_Y, ATTR_ROW(i),
0);
To locate each button and its associated description (which are
either the built in defaults or read from a file at startup).
Under XView, I can't work out the equivalent. Creating the
Button is easier for sure, but simply specifying PANEL_LAYOUT,
PANEL_{VERTICAL,HORIZONTAL} is not enough. The closest I have
come so far is using two separate pannels for the buttons and
the descriptions but it is still not right. I'm sure this
should be easy...
2/ fitting windows.
Because I create my main pannel "on the fly", I have no real
idea of its dimensions beforehand. With SunView, simply doing
window_fit(base_panel);
window_fit(base_frame);
Did the job.
Under XView the results are less than impressive :-(
One of the subwindows includes a ttysw, this one is a disaster
after window_fit()!
3/ Changing icon
Under SunView I used to change the icon to a picture of a
running stopwatch when a task was active, and to a stopped
stopwatch otherwise.
The call:
xv_set(base_frame, FRAME_ICON, icon, 0);
seems to have no effect.
Any (helpful) suggestions?
Please e-mail BTW.
P.S. One other problem. On a color screen I can set
Window.Color.Background: black
Window.Color.Foreground: white
or any other color for that matter. On a monochrome system
(same OW2.0) these have no effect.
I find white text on a dark background much easier on my eyes.
With SunView I simply added -i to the command line.
How do I get white on black on a monochrome screen?
Thanks
--
Simon J. Gerraty <sjg@zen.void.oz.au>
#include <disclaimer>
#include "something_very_witty"
--
Simon J. Gerraty <sjg@zen.void.oz.au>
#include <disclaimer>
#include "something_very_witty"