[futurebasic] Hello (again) and a few PG questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1998 : Group Archive : Group : All Groups

From: Wayne Campbell <shimmer@...>
Date: Wed, 9 Dec 1998 12:42:37 -0700
Hiya everyone. For some of you, this is ltns, for others hello for the
first time.

After a lengthy (and undesired) haiatus, I am back now. To those who's
first question will be "did you ever finish converting those old FB
archives?", the answer (unfortunately) is no, but I still have them all and
the work is just as I left it. Hopefully in the near future I can finish
them, but for now my plate (and my HD) is rather full, so it has to wait
abit.

I have recently decided to try my hand at writing a FB app once again (boy
am I rusty! ;), and this time it seems that the app I wish to write is
better suited to being done with PG than straight FB (as my knowledge of
some things is still lacking).

Problem is, I have never been able to fully grasp PG, even with the
examples included. In addition, I have found what appears to be a bug in PG
that has me stymied.

First the bug. I am adding 2 lists to the window, one to display the
resource names of CICN resources, the second to display the resource names
of PICT resources. I noticed in the "Ultimate LCMD" example that 2 of the 4
lists have bold title and contents and the other 2 have plain text title
and contents (though 1 is color red and the other is uncolored).

Upon trying to set the lists in my window to display in bold (they
originally drew as plain text), I found the following:

 * If I use the text tool and click the list title, it becomes an edit field,
   but selecting bold from the style menu does nothing (and the bold item does
   not get selected (check-marked) in the menu).

 * If I click on the list box with the same tool, I get the STR# editor, and I
   can select bold from the style menu, but then both plain and bold are
   selected (check-marked) in the menu, but no change happens to the list
   contents or title.

In addition, another bug surfaced, but needs more explanation. I recently
began to use Kaleidoscope, and the bug I am about to describe ONLY happened
when Kaleidoscope was DISABLED. I decided to see if setting the window to
bold text would make a difference, so selecting 'Text and Textures' from
the Window menu, I then selected bold from the style menu.

 * With Kaleidoscope enabled, this worked as expected, except that the lists
   never displayed as bold. All of the other text items (ie. editable text
   fields) displayed bold text (seemed that the static text fields were
   unaffected tho, but I may be remembering this wrong), but not the lists.

 * With Kaleidoscope disabled, when PG started to redraw the window, my system
   froze and I had to keyboard-restart to get out. This happened every time I
   tried it with Kaleidoscope disabled.

Please don't tell me I have to recreate the window from scratch because
it's somehow gotten corrupted! :(( I don't want to! <pleading and banging
fist on desk> hehehe

While I'm on the subject of lists and bold vs plain text, is there a way I
can make the list title bold and leave the list contents plain text?

Now to a question that I believe was covered before on this list, tho I
don't recall an answer and haven't found an answer in the archives I have.

When I select a background pattern for my window with PG, the editable
picture and text fields are filled with the pattern. The list boxes remain
white background and aren't affected by the pattern. How do I make it so
the picture and text edit fields aren't filled with the pattern? (I want
them to have white backgrounds within the editable portion of the fields.)

OK, that's it for that part of my problems. Now on to the real problem. As
I stated previously, I have never gotten a grasp of using PG. I mean this
in the context of using the source-code it produces.

I need for my app to read CICN and PICT resources by name. I have looked at
the functions in runtime.INCL, and found that (apart from the pGreplaceXRes
function) the one I'll prolly need most is the pGGet1NamedRes (I think
that's it) function. However, I will be dealing with more than one named
resource at the same time. I know that there's another toolbox function
(getNamedRes or something like that), but am not sure what the difference
is between the 2.

Also, I need to be able to update the resources according to the name of
the resource. While existing resources aren't a problem (I have an existing
ID # to use, once the resource has been found) adding new resources will be
a problem for me. I need to be able to add them by name, with the app
assigning a unique ID# to new resources.

Additionally, does anyone have a PG function for opening the resource fork
of a file? (PG doesn't seem to have a function for that and I'm not sure
how to write it.)

Now, the edit menu and related functions. I have never been able to get an
answer on how you cause a picture field to be hilighted when it is selected
(using the current hilite color). My picture fields are set to be 4 pixels
wider and 4 pixels taller than the image they will contain, so that there
is a pixel for the border and a pixel around the image for the hilite to
show up in.

Next, I have also never seen any examples of how to create or use the
graphic selection rectangle (I need it for when an image is pasted into a
picture field to show that the image is currently selected and movable).

And a final question (for now). I want my app to do the following at startup:

 First time run:

 * Look in the current folder for either a file named 'facefile', or for the
   same file in a subfolder in the current folder who's name is 'Faces'.

 * Upon not finding either of the above, display the open dialog with the
   message 'Where is 'facefile'?'

 * Upon 'facefile' being located, store the location in it's prefs and open the
   file, determining if it is already in use by another app (and if so closing
   it, if that's even necessary or wise, and informing the user to close the
   other app first).

 Subsequent runs:

 * Open the file using the previously stored location and perform step 3 above.
   The open dialog would then only be used if the file wasn't found in the
   stored location.

Help?

Thanks in advance.

Wayne

DALnet: Shimmerling
UnderNet, ChatNet, EscapeNet: Randii