Web App issues

I’m exploring/creating a web app with Xojo for the first time and discovering all sorts of issues. My latest is I can’t get a PRESSED event to happen from a canvas. The event handler allows it, I’ve got it in place, but I can press till I’m blue in the face and nothing happens.

Is this a bug?

Can you share a sample of your code? I can use the pressed event from a canvas.
What version of Xojo are you using?

Well, at this point there’s nothing to share on the Pressed event other than BREAK. It won’t break. I had some code there before and it didn’t execute.

I’m using Windows 10 Pro. The version of Xojo I’m using is the latest (I believe): 2021 Release 3.1

Further, I have three canvases on my window and none of them seem to allow the Pressed event to happen. Pressed does mean “Mouse down,” right?

I’m using a mac, I have a WebCanvas with this Opening/Pressed events code

Sub Opening() Handles Opening
  me.Style.BackgroundColor = color.Red
End Sub
Sub Pressed(x as Integer, y as Integer) Handles Pressed
  MessageBox("Pressed")
End Sub

when I click the red canvas, the messagebox shows like this:
image

Pressed mean clicked. If you left your mouse down it will not execute pressed until you release your mouse, at least with my mac.

Edit: if you press, hold and move outside the canvas, the pressed event will not fire, you need to click/release on the canvas
press_clic

Thanks for that. I am pressing and releasing with8n canvas to no effect. I don’t have an Opening event. I’ll insert and see if that somehow lets the Pressed event to occur. I do have a Paint event which works fine.

Can you save your project and share it with dropbox or google drive?
Just to see if it works on my mac.

Yeah. I’ll do that.

How do I do that?

You go to your dropbox or google drive and use the share functions.
If you don’t have dropbox or google drive you can use a sharing service like wetransfer.com
image
just upload the file and get the share link, post it here.

See if this works …

TrialWebApp.xojo_binary_project

No, that is not a correct share link, see if this works in your computer.

I get the red rectangle but no press action.

I switched browsers to see if that was the issue but it isn’t. I would note that labels press event work fine.

Here’s another try to upload link. btw, it asks for an email recipient but I don’t know who to send to.

TrialWebApp.xojo_binary_project

No, it doesn’t work.

You need to click the 3 dots to change the option from email transfer to transfer link. It doesn’t matter, if my example doesn’t work on your machine, your example will work on mine.

I don’t have Windows 10 to test. I hope someone else can confirm your problem or help you. Do you have anything special on your machine? Touch screen? If so, can you test using the touch screen if it makes a difference?

Great idea. I’ll test the touch screen.

Aaaannnddd … voila! That worked! So it’s a touch screen issue. Any suggestion how to look for that?

But … the x and y values it gives me are 0/0 every time no matter where I touch (press) the canvas.

Found this bug report marked as fixed (you need the feedback app to see it, download from Xojo download page):
64545 - WebImageView and Canvas Pressed event does not fire on devices with multiple input support
don’t know if your case is the same or different. Maybe the problem is back.

I can’t test Windows 10 touch (don’t have the hardware).

Thanks so much for the help. I will continue with project using workarounds. I should have looked in the bug reports myself, just didn’t know to. I guess I should report it.

Again, thanks. I appreciate your help immensely.

1 Like