Skip to content

raylib: base widget class #35484

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

Merged
merged 4 commits into from
Jun 7, 2025
Merged

raylib: base widget class #35484

merged 4 commits into from
Jun 7, 2025

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jun 6, 2025

continuation of #35483, goal is to make rl ui more static, less one-off pattern decisions I see around the UI

@github-actions github-actions bot added the ui label Jun 6, 2025
@sshane sshane force-pushed the raylib-strucuture branch from 29a4715 to f5ecc8d Compare June 7, 2025 02:29
@sshane
Copy link
Contributor Author

sshane commented Jun 7, 2025

@deanlee do you like render or draw better?

@sshane sshane closed this Jun 7, 2025
@sshane sshane reopened this Jun 7, 2025
@sshane sshane merged commit 3ce87d0 into master Jun 7, 2025
32 of 33 checks passed
@sshane sshane deleted the raylib-strucuture branch June 7, 2025 02:32
@deanlee
Copy link
Contributor

deanlee commented Jun 7, 2025

@sshane I'm not entirely sure — it's honestly a bit inconsistent right now. Generally, I use render when the function involves not just drawing but also handling input like mouse events or other logic. For purely visual output, I tend to use draw. there might be a better naming convention we can adopt.

@sshane
Copy link
Contributor Author

sshane commented Jun 7, 2025

There can be update and draw/render. For now, keeping both combined might be the simplest

@sshane
Copy link
Contributor Author

sshane commented Jun 7, 2025

BTW something like handle_mouse_release we can put in the base class.

Sidebar does this:

def render():
  self._handle_mouse_release()

and settings does this, not consistent:

def render():
  if rl.is_mouse_button_released(rl.MouseButton.MOUSE_BUTTON_LEFT):
    self.handle_mouse_release(rl.get_mouse_position())

@deanlee
Copy link
Contributor

deanlee commented Jun 7, 2025

Nice design. Actually, the only window we still need to implement is the Pair Device popup—everything else is pretty much done. So maybe there's no need to rush into switching to a virtual function–based approach just yet.

@deanlee
Copy link
Contributor

deanlee commented Jun 7, 2025

@sshane: Would it be possible to merge #35446 and #35437 soon? Development is moving quickly, and constantly resolving conflicts is becoming a bit of a headache.

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

Successfully merging this pull request may close these issues.

2 participants