Home | Contents | Index | Help | < Browse

 Writing for compability

 If you want to write a selector script that other people will use,
 for example a GUI for your shell type program, or a starting panel
 for your programs etc. Then you are welcome to do so. You can
 include the executable file "selector" with your scripts and distribute
 it in any way you like. But when you write scripts that other people
 will use, you must think of some important things.
 
 ----------------

 First, even if you include the latest version of selector with your
 scripts, the user may still have an old version of selector resident
 in memory, and then some of the commands you are using may not be
 present in this old version. To prevent this from happening, just
 use the version command, and the user will be aware of the problem.
 
 ----------------

 Second, the user may have a settings file. If he has,
 then your script will not look the same on his computer. If he for
 example has choosen his default colors and patterns stupidly, then
 the text of your window could be hidden. There are three ways of
 preventing this from happening:
 
 1. Don't change the colors! We must assume that the users own settings
    looks nice on his own system. So if we don't change the colors, then
    the default button and text color set by the user is used. If you
    want to change the color to emphasize something, then you can do this
    without really changing the colors by using the tempcol command.
    And if you do this, then set both back and foreground color, as you
    don't know what background the user is using. Don't use color numbers
    0-15. The user may have changed these with the palette command, or
    replaced them with patterns. Use direct colors. For example:
    
	tempcol yellow black
	text "Really important!"

 2. The second way is to use the settings command to disable the settings!
    If you rather wish, you can set the settings file to a file provided
    with your scripts.

 3. Choose the commands carefully and allways start with a background
    and a color command (Right after the version command.)
    Don't use color numbers 0-15. The user may have changed these with
    the palette command, or replaced them with patterns.
    Use direct color definitions instead. Here is an example:
 
	Version 9.0
	background gray
	color black
 
	text "Hello!"
	color FA4 black
	text "Hello!"

    Be sure to use these first three commands first in your script.
    This is in most cases sufficient for your window to look about
    the same.
  
    But if you want your window to look exactly the same, then it's
    better to use the settings command, else you have to put in all
    commands that the user may have changed in his settings file,
    like gap or font.

 ----------------

 Third, don't use colors to close to another. If you for example
 do this:
 
 color light_green dark_green
 text "Hello!"
 
 Then the user may not see the text. I can't see it on my workbench
 as I only have one green color in my palette! So, be careful and
 test your window on many different screens in your system. Useful
 tip: Most people has black, white and gray in their systems!
 
 Use Topaz 8 or 9 as the user may not have any other fonts. And if
 you want to use another font anyway, then use the orDefault option.
 Then it doesn't matter if the font doesn't exist.
 
 If you want to use patterns... DON'T! The user may
 not have the same workbench palette as you do!
 
 If you want to use patterns anyway: Only use MagicWB patterns. Include
 the patterns with yor script, use the ShowPatterns MagicWB
 command and use the orDefault option with the pattern command.
 
 ----------------

 Ok, now you know the problems of writing for compability. To test your
 window some, you can open your window on different screens in your own
 system, to check if the color look right. When you do this, you can put
 in a:
 
 Screen Jump
 
 command in your script, and then the window will jump from screen to screen.
 Just don't forget to remove it again. :-)
 
 ----------------
 
 When you are writing a script for your own system, it is not a good idea
 to follow these guidelines! Then you can't use the prefs script to
 change the appearance of your selector windows.


 

Home | Contents | Index | Help | < Browse