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

Cannot understand the behavior #22

Closed
darxtrix opened this issue Jun 28, 2015 · 4 comments
Closed

Cannot understand the behavior #22

darxtrix opened this issue Jun 28, 2015 · 4 comments

Comments

@darxtrix
Copy link

I am using npyscreen to draw GUI like this :
https://raw.githubusercontent.com/MrRio/vtop/master/docs/example.gif

I need to set the size of the canvas and then blit pixels on it accordingly.
But, when I do this :

>>> c = Canvas()
# how to set canvas size ?
>>> c.set(100,20)
>>> print(c.frame())
⠁

It prints a dot at start, I want it to print at the desired location i.e x=100 and y=20.
How can I achieve the behavior I am looking for.

Thanks.

@darxtrix
Copy link
Author

Well, figured out this by digging into the code.

>>> print(c.frame(0,0,110,50))

did the job for me.

Thanks !

@asciimoo
Copy link
Owner

Python drawille displays the pixels in relative positioning by default. You can specify the frame's min/max coords by passing min_x, min_y, max_x, max_y numbers to it, so print(c.frame(min_x=0, min_y=0)) can do the desired behavior.

@darxtrix
Copy link
Author

Oh ! I guess you replied at the sametime 😃 . Nevermind thanks !

@asciimoo
Copy link
Owner

=)

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