I was pointed in this direction by a kindly soul from the GEOS newsgroup.
Since nobody on usenet could answer my questions, perhaps you know of
someone who could give me a bump-start. Here's what I posted yesterday...
Greetings, fellow programmers.
I'm a complete novice to GEOS, with about 6 days' experience of the OS and
API. It certainly seems to be a powerful and well thought out system, but I
have to say there is just a little bit of a learning curve involved!
I've been charged with writing a fairly complex program in a relatively
short period of time, and I was hoping that some friendly programmer with
GEOS experience could help me out with some handy hints, so that I don't
waste too much time on the wrong things. If you can answer any of my
questions, I'd be grateful.
1. I need to create a configurable toolbar at the top of the screen, so
that when I click on an icon, it does the same thing as selecting a menu
option that I've defined. Am I right in saying that to implement this, I
have to create my own type of custom controller and write fairly involved
message handlers, in the same vein as a point size controller? This seems
to be a lot of work to go to, to implement what must surely be a common
feature. Or am I barking up the wrong tree?
2. At the bottom of my window, I have a grouping (for geometry reasons) of
a GenGlyphClass object and a GenTextClass object (used as status
indicators). I've written a simple function to update the monikers and text
of these objects, along the lines of
@send MyObj::MSG_GEN_REPLACE_VIS_MONIKER_TEXT(szText, VUM_NOW);
@send MyObj::MSG_VIS_TEXT_REPLACE_ALL_PTR(szContent, 0);
@send BothObjs::MSG_VIS_REDRAW_ENTIRE_OBJECT();
The function does work, but quite often, the objects will be drawn, and
then disappear in a flash. Then when I do something like adjust the size of
the window frame, they will be redrawn again. When I hit the maximize
button, the GenTextClass object disappears again. I think this is probably
a matter of sending the right messages out at the right time, but I'm
surprised that these stock objects don't sort themselves out - especially
as they are being told to update VUM_NOW.
3. It's very easy to incorporate, for example, a point size controller, and
associate it with a text window. But what about the situation where you
don't have a targetable text window in the app? Say you want a dialog box
that will allow you to select a font that will be used in situations A, B
and C (radio buttons), e.g. I want bank credits to printed in a choice of
my color and overdrafts printed in another color (just an example!). What's
the best way of using the existing controllers in such a dialog box?
Incidentally, if anybody at GeoWorks is reading this, the documentation
example for GenFileSelectorClass on page 969 of the Objects book is all
wrong! When I tried it, the prototype was wrong (giving me the wrong
parameters) and the MSG_MY_APP_FILE_SELECTED could never work, because one
of the tests ANDs a flags value with zero (which will never be true). I
suspect there should be a == instead.
Thanks very much, in advance.
Mike