PDA

View Full Version : Forcing descln handler to update



aurora
07-08-2005, 01:15 PM
How do I force the descln callback handler to update fo a
LWCustomObject? I have custom parameter file load features which loads
different types of objects. I then append the type of object to the
plugin name which descln displays. But when I change the inst->desc
which I use for the descln callback it does not seem to update. My
code is generic setup.

LWCustomObjHandler *local = reinterpret_cast<LWCustomObjHandler
*>(locPtr);
~
local->inst->descln = hDescLn;
~


XCALL_(static const char *)
hDescLn(LWInstance lwinst)
{
attData *inst = reinterpret_cast<attData *>(lwinst);

sprintf(inst->desc, "PluginName - %s", inst->attType);
return inst->desc;
}

I'm using xpanels and using a xpanf->viewRefresh(inst->panel); does not help.

Lightwolf
07-09-2005, 05:40 AM
I wonder... have you tried the instance update global?

"A handler plug-in calls this to synchronize LightWave with changes to the plug-in's instance data. LightWave will refresh its own interface and will usually call the handler's evaluation function in the process."

That should do the trick, since a refresh of LWs interface should also mean a new call to your description function.

Cheers,
Mike

aurora
07-09-2005, 06:49 AM
Yeah, actually I have. Thats why I'm so stuck and confused. I actually use it several time throughout the code and it works for everything except for when I load new files into the plugin. But loading the files in is also the one time where a user does not make a change to the UI which I wondering if thats not the key secret somehow.

Lightwolf
07-09-2005, 09:02 AM
Hi Aurora,

Strange. Then again I'm stuck with a similar problem.

I'd like to update a shader/procedural preview (and VIPER) after the user has selected an item presented in a context menu on an XPanel preview control. I've also tried everything and got no refresh. I just assume that LW doesn't refresh everything as required.
The last option I can think of is to use the undocumented commands global to issue a "RefreshNow" command, I haven't tried that yet though.

Cheers,
Mike

Lightwolf
07-09-2005, 09:50 AM
Okey dokey, I tried to issue commands to solve my problem and that didn't work, so I assume it doesn't help with your description either.

Back to square 1... :thumbsdow

Cheers,
Mike :bangwall:

aurora
07-09-2005, 04:36 PM
Yeah, its a really bizzare situation that has me totally baffeled. I can't find any reason why it won;t work, and yet, well it doesn't. Its easy enough for a user to manually cause an update by just clicking on the dropdown list that displays the current type and then it updates the description just fine.
Oh well, At least its a minor bug :o

Lightwolf
07-10-2005, 03:52 AM
Oh well, At least its a minor bug :o
I know how you feel. I have a couple of those in my current project as well. I still find them annoying because they turn a perfectly integrated product into a cludged on one, if you know what I mean.
And sometimes, it takes more time to make something "fit" into the look and feel of LW than to actually code the core that does the magic... *sigh*

Cheers,
Mike - back to coding.

aurora
07-10-2005, 08:24 AM
And sometimes, it takes more time to make something "fit" into the look and feel of LW than to actually code the core that does the magic... *sigh*

Oh yeah, it only took me a half a dya to get the core working in a workbench app, but a couple of weeks to make it a decent user happy plugin.