Skip to content

out of date: trackbar tutorial (createTrackbar) #26467

@crackwitz

Description

@crackwitz

Describe the doc issue

Docs do not say to pass a nullptr for the value pointer. That's a runtime warning the user gets.

The trackbar tutorial does not say how to use the callback's arguments in the C language. The presented callback function doesn't even name its arguments.

Docs also don't say how to pass an initial value, if not via the value pointer, that isn't supposed to be used.

Fix suggestion

Necessary:

  • Docs: talk about that value pointer, and how to pass an initial value since the pointer's deprecation
  • Docs: link to the tutorial and at least one decent example, for the sake of demonstrating the use of the callback
  • Tutorial: callback function: give the parameters names, use them (just hint at userdata) in the callback
  • Tutorial: don't rely on the value pointer getting updated, do whatever the current implementation requires to stop complaining about it

Optionally:

  • Library: introduce second signature to createTrackbar where value isn't a pointer but a value, for the initial value

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions