clearing background colour, causes event problems.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clearing background colour, causes event problems.

rjuli...@gmail.com
Hello...this might be a support question, but thought I would pose it hear first.

The situation I am about to describe occurs in 2 separate places, but they
both have a common theme.

On some of my screens, I setup a callback on an event.
For example, for one text field, I use...

aPart widget addEventHandler: ButtonReleaseMask
receiver: self
selector: #doSomethingInteresting:clientData:eventData:
clientData: nil.

in the specified selctor, I test for Button3, and if true, I do something.
This allows me to right-click in a text field to cause something to happen.

Now...this field can also be typed in....and if the user types something
invalid, I change the colour to yellow, to indicate that (using the #changed
event).

Here is where the problem occurs......if the user corrects their mistake,
I then set the colour back to default by sending backgroundColor: nil.

But once I do that,my event never fires again.
If I inspect the part's widget, and look in cwHandlers.  My event handler is no longer there.
Changing the colour back does not help...I can only close and open the window.

Some variations:
If I set the background colour to a different colour, instead of nil, there is no problem.
Only setting it to nil cause the issue.

When I set the colour to nil, if I set the event handler again (which is what I am currently
doing), then everything works again.

Even though my right-click event never triggers again.....my changed event DOES...so the
colour will still change to yellow, and back, with user input.

And the other situation I mentioned earlier, is that I have a similar thing happen on another
window, in which I have set up a text field as a Drop target (for drag/drop)...which stops
working when I set the backgound colour to nil.


Ok....perhaps I gone on too much...but wanted to provide lots of detail.

Any thoughts?
Instantiations guys.....is this a bug?  Or am I missing something obvious?

Thanks in advance for any help....

Julian




--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: clearing background colour, causes event problems.

Bob Brodd
Hi Julian,

This could be a bug, so I will open a support case and look into this issue for you. 

Thanks,
Bob

On Wednesday, February 20, 2019 at 10:37:21 PM UTC-5, [hidden email] wrote:
Hello...this might be a support question, but thought I would pose it hear first.

The situation I am about to describe occurs in 2 separate places, but they
both have a common theme.

On some of my screens, I setup a callback on an event.
For example, for one text field, I use...

aPart widget addEventHandler: ButtonReleaseMask
receiver: self
selector: #doSomethingInteresting:clientData:eventData:
clientData: nil.

in the specified selctor, I test for Button3, and if true, I do something.
This allows me to right-click in a text field to cause something to happen.

Now...this field can also be typed in....and if the user types something
invalid, I change the colour to yellow, to indicate that (using the #changed
event).

Here is where the problem occurs......if the user corrects their mistake,
I then set the colour back to default by sending backgroundColor: nil.

But once I do that,my event never fires again.
If I inspect the part's widget, and look in cwHandlers.  My event handler is no longer there.
Changing the colour back does not help...I can only close and open the window.

Some variations:
If I set the background colour to a different colour, instead of nil, there is no problem.
Only setting it to nil cause the issue.

When I set the colour to nil, if I set the event handler again (which is what I am currently
doing), then everything works again.

Even though my right-click event never triggers again.....my changed event DOES...so the
colour will still change to yellow, and back, with user input.

And the other situation I mentioned earlier, is that I have a similar thing happen on another
window, in which I have set up a text field as a Drop target (for drag/drop)...which stops
working when I set the backgound colour to nil.


Ok....perhaps I gone on too much...but wanted to provide lots of detail.

Any thoughts?
Instantiations guys.....is this a bug?  Or am I missing something obvious?

Thanks in advance for any help....

Julian




--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: clearing background colour, causes event problems.

rjuli...@gmail.com
Hi, Bob!!!  Looking forward to seeing you in March!!

And thank you for looking into this.
I got your EMail with the case number.  I will get you a simple test application
tomorrow or Friday.

Priority is not high on this....but it would be nice to know why this happens,
and to have a reliable solution.

THANKS!

Julian

On Wednesday, February 27, 2019 at 12:34:33 PM UTC-5, Bob Brodd wrote:
Hi Julian,

This could be a bug, so I will open a support case and look into this issue for you. 

Thanks,
Bob

On Wednesday, February 20, 2019 at 10:37:21 PM UTC-5, [hidden email] wrote:
Hello...this might be a support question, but thought I would pose it hear first.

The situation I am about to describe occurs in 2 separate places, but they
both have a common theme.

On some of my screens, I setup a callback on an event.
For example, for one text field, I use...

aPart widget addEventHandler: ButtonReleaseMask
receiver: self
selector: #doSomethingInteresting:clientData:eventData:
clientData: nil.

in the specified selctor, I test for Button3, and if true, I do something.
This allows me to right-click in a text field to cause something to happen.

Now...this field can also be typed in....and if the user types something
invalid, I change the colour to yellow, to indicate that (using the #changed
event).

Here is where the problem occurs......if the user corrects their mistake,
I then set the colour back to default by sending backgroundColor: nil.

But once I do that,my event never fires again.
If I inspect the part's widget, and look in cwHandlers.  My event handler is no longer there.
Changing the colour back does not help...I can only close and open the window.

Some variations:
If I set the background colour to a different colour, instead of nil, there is no problem.
Only setting it to nil cause the issue.

When I set the colour to nil, if I set the event handler again (which is what I am currently
doing), then everything works again.

Even though my right-click event never triggers again.....my changed event DOES...so the
colour will still change to yellow, and back, with user input.

And the other situation I mentioned earlier, is that I have a similar thing happen on another
window, in which I have set up a text field as a Drop target (for drag/drop)...which stops
working when I set the backgound colour to nil.


Ok....perhaps I gone on too much...but wanted to provide lots of detail.

Any thoughts?
Instantiations guys.....is this a bug?  Or am I missing something obvious?

Thanks in advance for any help....

Julian




--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.