realbasic-plugins
[Top] [All Lists]

Re: How to load control pictures on Windows?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: How to load control pictures on Windows?
From: Alfred Van Hoek <vanhoek at mac dot com>
Date: Tue, 22 Feb 2005 09:58:26 -0500
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
on 2/22/05 8:53 AM, Christian Schmitz at support at monkeybreadsoftware dot de
wrote:

Alright then, one last try to help you out:

>>> How would REALGetPluginFolder help me as the plugin does not know in
>>> which plugin file to look. I really don't want to hard code that.
>> 
>> What is your problem exactly?
> 
> To load a picture from the virtual file system from inside the plugin.

k. That's what I understood, and a solution to this problem was provided.
Your statement "the plugin does not know in which plugin file to look" would
suggest that a picture in one of your plugins is located. If you ask for an
api from REALbasic, then you know a method needs to be implemented that will
search all of the plugins in the plugins folder. Most likely, the folks of
RS will use direct or dynamic access. They might want to write this method
in pure REALbasic first, using instances of vv's and folderitems and test
every folder in the vv's for a file named "myfile". They could then
translate this code in C, using REALnewInstance, and all what is needed.


 I presume you could write such a method in pure REALbasic your self.

The cool thing is that RS has provided dynamic access apis that will allow
you to translate pure REALbasic code into pure C/C++ code. The upshot is it
is a cross-platform method, written in pure C/C++. Your request "REALstring
LoadPluginResource(REALstring path)" is now almost implemented, the only
thing you need are the specific OS apis, which are also at your own disposal
to allow for what you want "LoadPluginResource".

Thus, and assuming you know how to use REALbasic, there is already a
LoadPluginResource api, but it requires a bit of work to get at it.


> 
>> Isn't it you who will put a file in the .rbx folder?
> 
> The plugin converter does.


Right, the plugin converter limits the plugin vv to contain only those
folders REALbasic will scan. These folders have specific names, and are
hard-coded in the RB runtimes. Control icons are part of this. The folders
do allow you to put other things in it. You can also write your own plugin
converter, allowing you to add more folders somewhere else, but RB does not
know what it should do with all of these. It assumes that the plugin will
take care of it.

Anyway, instead of you scanning all of the plugins, you could add the
"myfile" in the plugin that needs this for IDE display. As was shown in an
earlier post you do not need to hard-code the path of this file. You can use
a simplified vv-scanner that does not require the scanning of all of the
plugins.

Mind you: once you locate "myfile" in the plugin vv, you need to copy the
file out, load the picture, and delete the file.

But if you prefer RB as a mind-reader, feel free to file a feature request.

best,

Alfred

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>