Page 1 of 1

reload buttons via script?

Posted: Thu Jun 16, 2011 2:18 pm
by Tomka
Hi,

got a (hopefully) simple question:

I got a skinned button. The icons are imported on a substack. But if I exchange the IDs of the imported images (on the substack) - the icon of the buttons in the current stack wont change inmedently - first I have to hover above the buttons.

Is there a way to "reload" the buttons, so they change their skin? Or maybe is there a message I could send to the buttons?

Thanks alot

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 2:32 pm
by Klaus
Hi Tomka,

you could try:
...
lock screen
## do your skinning stuff
## ...
unlock screen
...
That should work.


Best

Klaus

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 2:41 pm
by Tomka
I'm sad because it doesnt...

The button is shown with the old skin-image until I hover with mouse over it.

Maybe I should reload the whole stack but it will makes it a bit more difficult :)

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:01 pm
by Klaus
Hi Tomka,

hm... damn!
OK, reloading the stack is also not the solution.

I presume you are just setting the icons to the new image ids right?
Sorry, no idea so far...


Best

Klaus

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:09 pm
by Tomka
Hi,

I dont change anything on the button-proporties. I exchange the IDs of the 2 imported images :)

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:17 pm
by Klaus
Hä???
How do you exspect the button to know about that fact? 8)

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:26 pm
by Tomka
Ok let me explain :)

For example "button 1": the setting for icon=1007 (property-inspector). The image1 with ID 1007 is an image imported as control on a substack.

If the user changes the language of the program the script will change ID of those image1 to <xyz> (any unused ID) and then the ID of the second image2 to 1007.

If the user changes the language again the script will set the ID of image1 back to 1007 :)


It really works good but the great problem is that the user have first to mouseover the buttons to see the new skin.

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:45 pm
by Klaus
AHA! :D

But I have still no idea how to solve this problem.

Any chance that you do NOT change the image IDs, which is an erm... rather unusual approach 8)
but only set the icons of your buttons? I am sure that will work fine.


Best

Klaus

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 3:46 pm
by bn
Hi Tomka,

you could try to:

Code: Select all

 set the hilite of btn "b1" to not the hilite of btn "b1"
   set the hilite of btn "b1" to not the hilite of btn "b1"
do it twice to restore the hilite before the command.

It seems to work

Kind regards

Bernd

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 4:08 pm
by Tomka
@Klaus:

It would makes it more difficult because I also use a substack which is not loaded when the user can change the language. So I dont need to add anything in its preopenstack-script. Its all done with the script in the 2 buttons.

@Bernd:

It works great! Thats what I was looking for. Great thx!

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 4:45 pm
by Klaus
Hi Jungs,

aha, wieder was gelernt :D


Best

Klaus

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 4:52 pm
by bn
Tomka,

it wasn't after Klaus asked for what exactly it was you wanted that I understood what you were trying to do. It might help to explain a little what you want to do in the first place :)

Kind regards

Bernd

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 4:56 pm
by Klaus
bn wrote:... It might help to explain a little what you want to do in the first place :)
Das ist hier im Forum aber eigentlich nicht üblich! :D

Re: reload buttons via script?

Posted: Thu Jun 16, 2011 5:42 pm
by Tomka
Next time ill try to explain better :) ...