[SOLVED] forcing style relayout



Found a workaround/fix.

Recap the problem:
On 3 August 2012 22:46, Amy C <mathematical coffee gmail com> wrote:
> On 2 August 2012 23:51, Amy C <mathematical coffee gmail com> wrote:
>> I'm patching in a new stylesheet via
>>
>> theme.unload_stylesheet(oldstylesheet);
>> theme.load_stylesheet(newstylesheet);
>>
>> These affect a St.Bin with St.BoxLayout inside with St.Buttons inside
>> (style affects them all).
>>
>> When I perform this the elements do not update their style straight
>> away - when I start the looking glass though, they seem to realise
>> their style has changed and reload it.
>>
...
> Any ideas on this? I've noticed that on unloading the old
> sheet/loading the new one, when I run my mouse pointer over the
> elements in question the new style is loaded (prior to that the old
> style remains).

What worked in the end was (building off the idea that running the
mouse cursor over the buttons forced a relayout of the style):

this.actor.grab_key_focus();

In this case 'actor' was the St.Bin containing everything (but I think
doing this to each individual button or any of the parents would have
worked too).

Woohoo!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]