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

Width and height paramters for the file selection dialog. #18

Closed
KenT2 opened this issue Oct 22, 2015 · 3 comments
Closed

Width and height paramters for the file selection dialog. #18

KenT2 opened this issue Oct 22, 2015 · 3 comments

Comments

@KenT2
Copy link
Contributor

KenT2 commented Oct 22, 2015

It would be good to have the width and height of the FileSelectionDialog as parameters. As a fix I changed the height of the FileSelectionDialog locally in gui.py but the number of entries displayed does not change with the height

@KenT2
Copy link
Contributor Author

KenT2 commented Oct 26, 2015

Width and height work fine if they are specified in the call. However if they are not and the defaults are used I get this error message:

Traceback (most recent call last):
File "/home/pi/manager-for-pipresents/gui/server.py", line 245, in on_message
callback(*_paramDict)
File "/home/pi/manager-for-pipresents/gui/gui.py", line 1062, in onclick
return self.eventManager.propagate(self.EVENT_ONCLICK, params)
File "/home/pi/manager-for-pipresents/gui/gui.py", line 49, in propagate
return getattr(listener['instance'], listener['funcname'])(_params)
File "pp_manager.py", line 460, in on_profile_copy_clicked
fileselectionDialog = gui.FileSelectionDialog('Copy Profile', 'Select a Profile to copy',multiple_selection = False, selection_folder = self.top_dir)
File "/home/pi/manager-for-pipresents/gui/gui.py", line 1001, in init
super(FileSelectionDialog, self).init(width, 160, title, message)
File "/home/pi/manager-for-pipresents/gui/gui.py", line 441, in init
t = Label(self.width - 20, 50, title)
TypeError: unsupported operand type(s) for -: 'str' and 'int'

@dddomodossola
Copy link
Collaborator

Hi Ken,

The problem is that you have to use the 'labels' of the parameters for the title and the message:
fileselectionDialog = gui.FileSelectionDialog(title='Copy Profile', message='Select a Profile to copy',multiple_selection = False, selection_folder = self.top_dir)
Please feedback.

@KenT2
Copy link
Contributor Author

KenT2 commented Oct 27, 2015

Yes, my mistake. All works fine thanks.

@KenT2 KenT2 closed this as completed Oct 27, 2015
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