Conversation
| G_CALLBACK(_event_button_press_primary), table); | ||
| g_signal_connect(G_OBJECT(table->gesture_button_primary), "released", | ||
| G_CALLBACK(_event_button_release_primary), table); | ||
|
|
There was a problem hiding this comment.
It seems likely that this sequence of four calls will be repeated over and over for each button-press handler. That suggests packaging them into a function called something like dtgtk_button_handler_new which would take as arguments the GtkWidget, the specification of which button, the press and release callbacks, and the user-data pointer. With that abstraction in place, the above code would read
table->gesture_button_primary = dtgtk_button_handler_new(table->widget, GDK_BUTTON_PRIMARY, _event_button_press_primary, _event_button_release_primary, table);
There was a problem hiding this comment.
Such a message might be of general use. Do you (or anyone else) has a short hint where to place such a method? I don't have a general overview of the whole code structure for now.
There was a problem hiding this comment.
src/dtgtk/button.h seems the obvious place.
|
@Christian-Kr : Please do not merge master into topic branches. I'd prefer a rebase when needed. TIA. |
|
Well, there was some additional conflict with rebase. I think I ruined it. Cause it was just a small change, I will close this pr and start with a fresh branch again. Sry for that. |
Hello to everyone,
this pr will migrate the first button-pressed and button-release to the new GtkGesture API. Please test if everything is working as before. I do not find any problem but I also might have missed something.
I will wait with all further migration to this event context, until this pr has been reviewed. This is because I want to be sure, that the way I implemented it is your preferred way and I don't need to do things twice. :-)
Just to let all of you know: I am coming from the cpp perspective. This might break some things in code structure in the way I prefer to implement it.
Looking forward to your reply.
Thanks in advance
Greetings