Managing Your Replicants: XShelfInspector and XContainer

Body

The source discussed in this article can be found here.

The original BeOS distribution from Be. Inc. contains two applications to help you manage your replicants: ShelfInspector and Container. Both can be found in the .../sample-code/application_kit/ folder. It's a good idea to read Be's original readme.txt concerning ShelfInspector. Both enhanced applications -- XShelfInspector and XContainer -- are working closely together like the original ones; however, some improvements have been added so one can use them more comfortably. The most interesting question is: How can I test my new replicant using these applications?

First, launch the XShelfInspector application. XContainer will then be launched, too.

Figure 1: XShelfInspector and XContainer
Figure 1: XShelfInspector and XContainer

Now drop your freshly built replicant to the "Drop Zone." let's use the well-known RepliShow replicant. If XContainer's container view accepts the replicant, fine, the first step is done. Next step: Try to drag the replicant around using the small dragger, then release the mouse button, and if the replicant is still there, fine again. Then check the functionality of the dragger's pop-up menu. Then comes the most crucial part of testing: Push the "Test Replicants" button. The XContainer application will be terminated and all replicants be saved to an archive. XShelfInspector will restart XContainer immediately, and hopefully your replicant will be rebuilt properly. Alternatively, you can close XShelfInspector and launch it again - you should see the same behavior. How can we get rid of the replicant? One way is to use the above-mentioned pop-up menu and to select "Delete". Repeat the "Test Replicant" procedure - no replicant should be reconstructed any more. When you drop your replicant to the "Drop Zone" again, it should reappear.

However, after deleting a replicant the backing store file still contains the replicant's data, and during the development phase it's recommended you clear this file using the "Remove all Replicants and Backing Store File" button.

What other things can we do now? Since your replicant is looking sane we can dare to drop it onto the Desktop window.

Figure 2: Replicant Pop-Up Menu
Figure 2: Replicant Pop-Up Menu

After doing this select "Desktop Window" from XShelfinspector's "Target Shelf" pop-up menu and you'll see the loaded replicants and the loaded libraries. (This is not working when you use Be's original ShelfInspector application!) Another thing you can do is to clone the replicant. Select the desired replicant in the "Loaded Replicants" scrollview and press the "Copy to Container ..." button.

Figure 3: Copy to Container
Figure 3: Copy to Container

Let's have a look at some typical mistakes that could happen while developing a replicant:

'Figure
Figure 4: The line AddString("add_on", "application/x-vnd.BeNews-RepliShow") is missing inside the Archive() function.

Figure 5: A missing resource file.
Figure 5: A missing resource file.

Figure 6
Figure 6: You have forgotten to add your own "About Requested" function.

One important fact I will not forget to tell you: Only keep a single version of your replicant application on your system at the same time. If multiple apps with the same signature are flying around, during reconstruction the replicant is highly confused in finding the right application. You might getting confused, too, and wonder why your code changes are being ignored.

A final word about XShelfInspector and XContainer: When closing these applications the window size and position is saved in a separate settings file.

Figure 7: Settings.
Figure 7: Settings.

Here you see the settings of both apps, and XContainer is also keeping the backing store file XContainer_data. If your replicant is so corrupt that XContainer will not launch without crashing, you only need to delete this file.

The GUIs of both apps were done with the help of IE (Interface Elements) from Attila Mezei, an archive-based tool for building nice interfaces. More about replicants and IE will come in the next issues.