G4P elements missing mouse actions?

Hi!

It seems, mouse clicks are being missed quite often.

In this trivial test 4 out of 10 clicks showed the yellow flash of the button when clicked, but the counter didn’t change. I can’t tell anything about other elements, but with buttons and check boxes, I’ve seen it very frequently.

Main tab:

import g4p_controls.*;

public int n=0;

public void setup(){
  size(480, 320, P3D);
  createGUI();
}

public void draw(){
  background(230);
}

Tab gui:

public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:590660:
  println("button1 - GButton >> GEvent." + event + " @ " + millis());
  println( ++n );
} //_CODE_:button1:590660:

public void createGUI(){
  G4P.messagesEnabled(false);
  G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
  G4P.setMouseOverEnabled(false);
  surface.setTitle("Sketch Window");
  button1 = new GButton(this, 22, 22, 80, 30);
  button1.setText("Face text");
  button1.addEventHandler(this, "button1_click1");
}

GButton button1;

This behaviour was observed on two different machines, both of which are running Manjaro Linux 23.1.3 with Linux Kernel 6.1.77-2-MANJARO. Processing is build no 1293, G4P 4.3.9.

Cheers, Mat

The mouse needs to move at least one pixel between clicks for them to register - I don’t know if this is the cause but worth trying out :smile:

1 Like

Thank you again! And again sorry: Especially, when I move the mouse in the button, when the mouse-button is clicked, the event seems to go missing.

However, this seems to be repeatable! (Which for me, it wasn’t.) Whenever the mouse moves during the click, the click is apparently missed. (And it doesn’t make a difference, if the movement starts before or after the click.)

Just for clarity :
In G4P the mouse-clicked event handler is executed when the mouse button is pressed and released without the mouse moving between.

2 Likes

Thanks a lot, that resolves this issue for me!

(However, please cosider a situation, where you have to operate a program during a talk to an audience. Under these circumstances this behaviour is not too practicable. Maybe you might want to introduce a 2 or 3 pixel wide ›tolerance zone‹? Can I post this as feature request?

I will always welcome and seriously consider any feature requests so by all means submit it.

I will not say yeah or nay just yet as I can see arguments for and against it and I will not make rush decisions that I might regret later.

2 Likes

I have posted 2 requests in Issues · roloww/gui4processing · GitHub – was that the right place? To be honest, this place seemed quite abandoned…

That appears to be a fork of G4P that has been long abandoned - doesn’t belong to me :smile:

Post G4P Tickets here

You can get to the code repositories by following the links on my website.

2 Likes

Hi! I’ve posted 2 feaure requests in the repository about a week ago (#48 & 49). Have you seen them yet? (There’s no sign of it. Have I done s.t. wrong?) Cheers, Mat

Hi Mat,
Thank you for leaving your feature requests they are appreciated and you have done nothing wrong.

G4P was first released on 22nd March 2009 (15th birthday approaches :partying_face: ) and since then there have been 48 versions released.

When dealing with issues I have a priority list

  1. Bug fixes - that have a major and immediate affect on many users and has no work round
  2. Bug fixes - as above but only affects a very small number of users
  3. Feature requests - a major feature that significantly enhances the software for many users
  4. Feature requests - a minor feature that improves usability for a small number of users

With bug fixes I will generally break off what I am working on to solve them.

With feature requests there is no urgency on my part. When I have a natural break in my other projects I will weigh the benefits against the drawbacks for each request and decide on whether to accept / reject it. If I accept the request then I generally work on it immediately.

I have taken the time to explain my rationale because I don’t want you to think I am ignoring you.

I am in the middle of a large and exciting project (at least it excites me :smile:) but I will try and find time in the next few days to consider the requests. You will automatically be emailed by SourceForge when I update the tickets.

Again thanks for the requests they are always appreciated even if I don’t end up accepting them.

2 Likes

Thanks for the reply, also appreciated! No worries, no hurries – and good luck with your project!