It is currently July 10th, 2020, 5:55 am

Strange issue with InputText

Report bugs with the Rainmeter application and suggest features.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Strange issue with InputText

Post by soyelrafa »

Hello, I'm having a strange issue with InputBox that I can't replicate because it doesn't happens always. There are times that doesn't happens, and times that happens always. Even with the same input box, for creating this post I have to click much times to get it.

The issue is that the inputbox dissappear after appearing, and rainmeter log throws this warning:

InputText: Exception System.ObjectDisposedException: No se puede obtener acceso al objeto desechado.
Nombre del objeto: 'InputBox'. (Lauhdutin\Game\Game.ini - [Input])

Using google I think this is the issue translated to english: InputText: Exception System.ObjectDisposedException: 'Cannot access a disposed object. Object name: InputBox'

I got this issue with Lauhdutin, on game.ini when editing a game info.

This skin has a lot of code, so I put here all the code I think handles that input (development-3 branch):

dist/Game/Game.ini

Code: Select all

[Script]
Measure=Script
ScriptFile=#@#game\init.lua
UpdateDivider=-1

[Input]
Measure=Plugin
Plugin=InputText
SolidColor=#WindowBackgroundColor#
X=0
Y=0
W=0
H=0
DefaultValue=
StringAlign=Left
StringStyle=Bold
FontSize=12
FontColor=#WindowSlotValueFontColor#
DynamicVariables=1
Command1=[!CommandMeasure "Script" "OnEditedProcessOverride('$UserInput$;')"]
Command2=[!CommandMeasure "Script" "OnCreatedTag('$UserInput$;')"]
Command3=[!CommandMeasure "Script" "OnEditedHoursPlayed('$UserInput$;')"]
Command4=[!CommandMeasure "Script" "OnEditedPlatformOverride('$UserInput$;')"]
Command5=[!CommandMeasure "Script" "OnEditedPath('$UserInput$;')"]
OnDismissAction=[!CommandMeasure "Script" "OnDismissedInput()"]

@include=#@#colors.inc

[Slot1Value]
Meter=String
Text=SLOT 1 VALUE
X=0r
Y=-4R
W=(#WindowWidth# - 30)
H=18
StringStyle=Bold
StringAlign=LeftCenter
FontSize=12
FontColor=#WindowSlotValueFontColor#
ClipString=1
AntiAlias=1
dist/@Resources/game/init.lua

Code: Select all

local startEditing
startEditing = function(slotIndex, batchIndex, defaultValue)
  local meter = SKIN:GetMeter(('Slot%dValue'):format(slotIndex))
  SKIN:Bang(('[!SetOption "Input" "X" "%d"]'):format(meter:GetX() - 1))
  SKIN:Bang(('[!SetOption "Input" "Y" "%d"]'):format(meter:GetY() - 1))
  SKIN:Bang(('[!SetOption "Input" "W" "%d"]'):format(meter:GetW()))
  SKIN:Bang(('[!SetOption "Input" "H" "%d"]'):format(20))
  if defaultValue == nil then
    defaultValue = ''
  end
  SKIN:Bang(('[!SetOption "Input" "DefaultValue" "%s"]'):format(defaultValue))
  SKIN:Bang(('[!CommandMeasure "Input" "ExecuteBatch %d"]'):format(batchIndex))
  STATE.ACTIVE_INPUT = true
end
I try to replicate on another skin but I failed. And I don't know if there is an issue with the skin or with the plugin. But the issue is so annoying because some times I have to click 9 times on the slot to be able to edit some info.

Regards.

EDIT: I forget to put the Rainmeter info:

Code: Select all

Rainmeter 4.4.0.3350 beta (64-bit)
Language: Spanish (3082)
Build time: 2020-05-13  7:49:21
Commit Hash: 467019e6
Windows 10 Pro 1909 64-bit (build 18363) - Spanish (3082)
Path: C:\Program Files\Rainmeter\
SkinPath: C:\Users\User\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\User\AppData\Roaming\Rainmeter\
IniFile: C:\Users\User\AppData\Roaming\Rainmeter\Rainmeter.ini
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Strange issue with InputText

Post by balala »

soyelrafa wrote:
May 28th, 2020, 5:53 pm
EDIT: I forget to put the Rainmeter info:
This in most cases is not too important. What would be much more important is to pack the whole dist config and upload the package. Would be much easier for us to replicate the issue and see what's going on there.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Strange issue with InputText

Post by soyelrafa »

balala wrote:
May 28th, 2020, 6:51 pm
This in most cases is not too important. What would be much more important is to pack the whole dist config and upload the package. Would be much easier for us to replicate the issue and see what's going on there.
Here you have it.

But like I said, I can't achieve to replicate it when I want. For example, right now I try it like 30 times and it works perfect. But others times at the first time it fails. Others times, at the 5 time fails. I don't know why...

Steps that sometimes makes the issue arises:

1-Load the skin.
2-Middle click on Valorant.
3-Left click on 'Hours played'.
4-The inputbox will appears if the issue is not happening. Press enter to close inputbox and repeat 3 and 4 until the inputbox doesn't appear and the rainmeter log shows that warning.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Strange issue with InputText

Post by balala »

soyelrafa wrote:
May 29th, 2020, 10:25 am
2-Middle click on Valorant.
On which one? Because when I'm hovering the mouse over the skin, a second Valorant is shown, beside a play button and a "0 minutes played" message.
soyelrafa wrote:
May 29th, 2020, 10:25 am
3-Left click on 'Hours played'.
What "Hours played" is? If this is the above said "0 minutes played" message, if I click everything disappears, but the skin is still kept loaded. Also no error message in the log.
soyelrafa wrote:
May 29th, 2020, 10:25 am
4-The inputbox will appears if the issue is not happening. Press enter to close inputbox and repeat 3 and 4 until the inputbox doesn't appear and the rainmeter log shows that warning.
It never is shown, no matter how many times did I try the above procedure.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Strange issue with InputText

Post by soyelrafa »

balala wrote:
May 29th, 2020, 3:32 pm
On which one? Because when I'm hovering the mouse over the skin, a second Valorant is shown, beside a play button and a "0 minutes played" message.

What "Hours played" is? If this is the above said "0 minutes played" message, if I click everything disappears, but the skin is still kept loaded. Also no error message in the log.

It never is shown, no matter how many times did I try the above procedure.
Here I let you a gif of the procedure. When appears the subconfig is when I click middle button (mouse wheel button) on Valorant.
GIF.gif
And like I said, it's not happen when I want to, it's totally random. In the gif doesn't happen for example.

EDIT: About disappearing, it's because it has enabled the option of "hide skin while playing". The skin should appear after stop playing the game, but you don't played the game because there is no shortcut, so never will come back.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Strange issue with InputText

Post by balala »

soyelrafa wrote:
May 29th, 2020, 4:59 pm
Here I let you a gif of the procedure. When appears the subconfig is when I click middle button (mouse wheel button) on Valorant.
I still sustain there are two Valorant strings. and a second skin is never activated for me. Nor when I (left-, right- or whatever) click on Valorant, nor other times.
Still can't get your skin to work as it should.
soyelrafa wrote:
May 29th, 2020, 4:59 pm
The skin should appear after stop playing the game, but you don't played the game because there is no shortcut, so never will come back.
Not the shortcut is missing, but the whole game. I don't have the needed game installed.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Strange issue with InputText

Post by soyelrafa »

balala wrote:
May 29th, 2020, 5:23 pm
I still sustain there are two Valorant strings. and a second skin is never activated for me.
I don't understand then where is the issue. I just used the last rainmeter version in its portable edition, and with the skin I put in my previous commentary I don't have any problem on opening the subconfig.

About the second string, I only have one string, and when I hover the mouse on the slot of Valorant appears the overlay with its name again and the hours of play (0 in this case). So I don't know neither what is going on here.
balala wrote:
May 29th, 2020, 5:23 pm
Nor when I (left-, right- or whatever) click on Valorant, nor other times.
Still can't get your skin to work as it should.
Left and Right click are not supposed to do anything in this skin I send you, so there isn't any issue with that. Middle click should work though.
balala wrote:
May 29th, 2020, 5:23 pm

Not the shortcut is missing, but the whole game. I don't have the needed game installed.
That is not an issue neither, since you can edit a game without executing it. The only issue is the second string that shouldn't appear and the middle click not working. But I don't have any idea what is going on since It's work perfect on my side...
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Strange issue with InputText

Post by balala »

soyelrafa wrote:
May 29th, 2020, 6:35 pm
About the second string, I only have one string, and when I hover the mouse on the slot of Valorant appears the overlay with its name again and the hours of play (0 in this case). So I don't know neither what is going on here.
I'm sorry, but there definitely are two of them:
GIF.gif
You do not have the required permissions to view the files attached to this post.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Strange issue with InputText

Post by soyelrafa »

balala wrote:
May 29th, 2020, 7:22 pm
I'm sorry, but there definitely are two of them:
GIF.gif
Then you have the answer on my previous reply:
About the second string, I only have one string, and when I hover the mouse on the slot of Valorant appears the overlay with its name again and the hours of play (0 in this case). So I don't know neither what is going on here.
This is the expected behaviour. The reason is the game should have a banner, and when you hover on it shows the name, like this:
GIF.gif
But this has nothing to do with the issue that you have that when clicking the middle button of the mouse when over the game you didn't get the game configuration skin...
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4040
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Strange issue with InputText

Post by eclectic-tech »

Aside from getting the example to work...

I have also had this 'exception' occur intermittently while using InputText measures...

I was able to correct by adding FocusDismiss=0 to the measure; this will cause the input box to maintain focus until either 'Enter' or 'Escape' are pressed. Not sure if this will help with your issue, but it corrected it for me. :welcome: