Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scrollbar widget + Full wrapping of GtkAdjustment #126

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

PhilippMDoerner
Copy link
Contributor

@PhilippMDoerner PhilippMDoerner commented Oct 22, 2023

This PR's value lies 90% in the fact it wraps GtkAdjustment more fully (or rather: provides a first attempt to), which is useful to more fully encompass functionality of other widgets that make use of it, such as (as per GtkAdjustment docs):

GtkSpinButton, GtkViewport, GtkScrollbar and GtkScale.

Scrollbar is just a nice side-addendum (though it all started with wanting to wrap that for feature completeness).

HOWEVER: This is mostly the foundation for the actual PR in the end. 1 key thing does not work yet - Event listeners on GtkAdjustment.
That is particularly difficult because unlike with Toast in ToastOverlay in #122 , GtkAdjustment is not a GTKWidget.
So the entire existing ecosystem for setting up event listeners is not set out for this.

That manifests here in the example compiling, but the event listeners (despite GTK not complaining!) not firing at all.
I have honestly no clue what could be the cause for that and have to rely on feedback to give me further clues, I'm kinda stuck.

I'll move this out of the draft stage with updated docs etc. once we can make those event listeners work.

@can-lehmann can-lehmann added this to the Owlkettle 4.0.0 milestone Mar 5, 2024
@can-lehmann
Copy link
Owner

I am not sure if we already discussed this at some point, but I do not see the advantage of wrapping GtkAdjustment. Mainly because it does not work well with the declarative API. Is there any advantage to wrapping it / where would it be used?

@PhilippMDoerner
Copy link
Contributor Author

PhilippMDoerner commented Jun 15, 2024

The lion's share of the value I see in enabling access to scroll events and being able to know what your current scroll position is.
That knowledge in particular in webdev I needed roughly half a dozen times so far, basically every time you want to add something to the screen but only when the user scrolled fully to the bottom/to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants