Skip to content

Make SuruBarController available externally #7

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

Open
AllyMarthaJ opened this issue Nov 10, 2022 · 1 comment
Open

Make SuruBarController available externally #7

AllyMarthaJ opened this issue Nov 10, 2022 · 1 comment

Comments

@AllyMarthaJ
Copy link

AllyMarthaJ commented Nov 10, 2022

Hi there!

I'm attempting to make use of the multithreaded features of this library, and I encountered an issue where I couldn't actually reference the type SuruBarController. That is, I'm passing in the following type to a thread I'm creating:

type ThreadData = ref object
    y*, xInc*, yInc*: float
    offsetY*: int
    opts*: GraphOpts
    imageAddr*: ptr Image
    bar*: ptr SuruBarController

Creating a thread like so:

    var bar = initSuruBarThreaded()
    bar[0].total = size

    if opts.showProgress:
        bar.setup()

...


        let data = ThreadData(
            offsetY: offsetY,
            y: y,
            xInc: xInc,
            yInc: yInc,
            opts: opts,
            imageAddr: imageAddr,
            bar: bar
        )
        threads[i].createThread(processRow, data)

But with the current iteration, this doesn't work because SuruBarController is inaccessible externally.

Was wondering if it were possible to change the definition from:
SuruBarController = object to SuruBarController* = object

Cheers!

@AllyMarthaJ AllyMarthaJ changed the title Export SuruBarController Make SuruBarController available externally Nov 10, 2022
@de-odex
Copy link
Owner

de-odex commented Apr 17, 2023

Sorry for just getting back to this now. I will have to take a moment to reacquaint myself with the library and look into this.

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

No branches or pull requests

2 participants