It is currently April 27th, 2024, 8:00 pm

Still having problems with some of the dexpot measures

Report bugs with the Rainmeter application and suggest features.
User avatar
bobgrosh
Posts: 134
Joined: May 1st, 2011, 10:33 pm

Still having problems with some of the dexpot measures

Post by bobgrosh »

This line of code WORKS:

Code: Select all

buttoncommand=!Execute [!ToggleMeterGroup CisChanged "#CURRENTCONFIG#"][!HideMeterGroup b "#CURRENTCONFIG#"][!ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"]
This line of code does NOT work;

Code: Select all

VDOnDeactivate=!Execute [!ToggleMeterGroup CisChanged "#CURRENTCONFIG#"][!HideMeterGroup b "#CURRENTCONFIG#"][!ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"]
Notes:
The first line is in a button meter, and it works.
The two lines are IDENTICAL past the equal sign
The Second Line is in this plugin measure
Here is the complete measure:

Code: Select all

[VDMActive]
Measure=Plugin
Plugin=VirtualDesktops
VDManager=Dexpot
VDMeasureType=VDMActive
VDOnActivate=!Execute [!ToggleMeterGroup CisChanged "#CURRENTCONFIG#"][!HideMeterGroup b "#CURRENTCONFIG#"][!ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"]
In the VDOnActivate line everything executes up to the bang !ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"

The problem seems to be that DesktopCount is wrong, it is 0 but it should be between 1 and 20

The code that sets DesktopCount is as follows:

Code: Select all

[DesktopCount]
Measure=Plugin
Plugin=VirtualDesktops
VDManager=Dexpot
VDMeasureType=DesktopCount
VDOnChange=!Execute [!ToggleMeterGroup CisChanged "#CURRENTCONFIG#"][!ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"]

The group I am trying to show is a row of buttons for each Virtual desktop. The number of buttons depends on how many virtual desktops are configured in Dexpot. IE: if there are 6 virtual desktop then the bang [!ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"] should resolve to [!ShowMeterGroup b6 dexpot] and buttons 1 through 6 should display.

Here is the code for the buttons:

Code: Select all

[b1]
Meter=button
MeasureName=SwitchDesktop
ButtonImage=#CURRENTPATH#images\1.png
x=24
y=22
buttoncommand=!Execute [!CommandMeasure "SwitchDesktop" "1"][!hidegroup Clock][!ShowGroup Clock1][!hidegroup Art][!ShowGroup Art1]
group=b | b1 | b2 | b3 | b4 | b5 | b6 | b7 | b8 | b9 | b10
hidden=0

[b2]
Meter=button
MeasureName=SwitchDesktop
ButtonImage=#CURRENTPATH#images\2.png
x=24r
y=22
buttoncommand=!Execute [!CommandMeasure "SwitchDesktop" "2"][!hidegroup Clock][!ShowGroup Clock2][!hidegroup Art][!ShowGroup Art2]
group=b | b2 | b3 | b4 | b5 | b6 | b7 | b8 | b9 | b10
hidden=0
.
.
.

.
.
.

[b9]
Meter=button
MeasureName=SwitchDesktop
ButtonImage=#CURRENTPATH#images\9.png
x=24r
y=22
buttoncommand=!Execute [!CommandMeasure "SwitchDesktop" "9"]
group=b | b9 | b10
hidden=0

[b10]
Meter=button
MeasureName=SwitchDesktop
ButtonImage=#CURRENTPATH#images\10.png
x=24r
y=22
buttoncommand=!Execute [!CommandMeasure "SwitchDesktop" "10"]
group=b | b10
hidden=0
My goal here is to have the buttons update and reflect the number of virtual desktops automatically when the number changes, REGARDLESS OF HOW THE NUMBER CHANGES. (Either by the Dexpot interface or plus/minus buttons in the Rainmeter skin.) Of course I also want the changes to the count to also be reflected when the skin is loaded, even if the count was changed while the skin is unloaded.

Here are my two best guesses as to what is causing my problem.
(1) The VDOnActivate=!bang executes the bang when you start to activae Dexpot, not when Dexpot is ACTIVATED. That means that any other values the skin gets from Dexpot, such as DesktopCount, CurrentDesktop or DesktopName return 0 or a blank string because Dexopt is not really active when the bang ie executed, it is still in the process of starting.

(2) The Bang is executed after Dexpot has started, but the value for DesktopCount has not been updated by Rainmeter. Unfortunately all my attempts to code arround that problem have failed, I guess I flunked Rainmeter 101. [/list]
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Still having problems with some of the dexpot measures

Post by poiru »

bobgrosh wrote:In the VDOnActivate line everything executes up to the bang !ShowMeterGroup b[DesktopCount] "#CURRENTCONFIG#"
The VirtualDesktops plugin has not been updated to the new API (yet), so [measures] are not replaced in the plugin-specific actions.
User avatar
bobgrosh
Posts: 134
Joined: May 1st, 2011, 10:33 pm

Re: Still having problems with some of the dexpot measures

Post by bobgrosh »

poiru wrote: The VirtualDesktops plugin has not been updated to the new API (yet), so [measures] are not replaced in the plugin-specific actions.
:-(

OK, Well. I'll take a coffee break!
User avatar
bobgrosh
Posts: 134
Joined: May 1st, 2011, 10:33 pm

Re: Still having problems with some of the dexpot measures

Post by bobgrosh »

OK, An Update!
I did a workaround that works.
I reset a counter in the VDOnActivate bang and then made the buttons update when the counter reaches 1
Why I hadn't figured that out, I don't know!

Don't even get me started on the problems I am having with the VDOnDeactivate bang. LOL