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

npyscreen GridColTitle #97

Open
darylza opened this issue Apr 19, 2020 · 2 comments
Open

npyscreen GridColTitle #97

darylza opened this issue Apr 19, 2020 · 2 comments

Comments

@darylza
Copy link

darylza commented Apr 19, 2020

Hi All,

I want to be able to press ENTER in GridColTitle list and get the values/row from the selected row. How can I do that? May be there is some one who has the same issue ...

thank you ..

-daryl

@jerome-diver
Copy link

@darylza i can recover the value of a widget by include an observer.
The design pattern of an observer is to add an argument (parameter) when you create an instance of an other one object (so you pass this observer instance as a parameter to the new object instance through init(self, observer) ). You will use this observer next to push values inside.
So in your situation, you can handle an event handler from the npyscreen event key handler's object with this observer.
I usually do that to separate views and action to get a full MVC design and fully separate action from views (Forms are views and there actions methods are redirected to own dedicated controllers then).

@jerome-diver
Copy link

Actually, my own problem now with this object GridColTitle is to resize the columns depend of the content... (or anyway, just resize). If you have an idea, feel free to share.

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