@cvp and @Phuket2 thank you for your responses
The behaviour was exactly that the form_dialog returned to calling code before it's end when called from the tableview. And the decorator @ui.in_background fixes it.
Thanks!
G
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
@cvp and @Phuket2 thank you for your responses
The behaviour was exactly that the form_dialog returned to calling code before it's end when called from the tableview. And the decorator @ui.in_background fixes it.
Thanks!
G
I'm a bit stubborn...and I tried to build a shield view for the take_photo()
function to call photos.capture_image()
And @JonB you are right, capture_image() still cancels the wait_modal() call.
I am willing to accept this, but question for @omz, is there a reason why photos.capture_image()
cancels the wait_modal() call. And is there a way around it?
Thanks
AI
thanks for the example, I'll look into it!
Hello,
I am looking for help in creating a shield view, where a photos.capture_image()
call can be made without cancelling the wait modal call of a form dialog container view (for those familiar with the dialogs module).
This is the solution used for the date picker in the dialogs module.
Here is a gist to my modified dialogs module:
https://gist.github.com/368433/312e372196880980eaa5e0867b720672
I think it would have to go in the take_photo() function but I do not know how to go about it.
Any help would be much appreciated.
G
wow. @cvp. I don't know what to say...I've been trying to sort this out for literally three days...
Thanks so much for looking at it,
Merry Christmas,
G
Notice:
It all works well, but it seems that the capture_image() call changes the self.container_view item
You are right. I thought it would be long here but a gist is perfect:
https://gist.github.com/368433/043e7e00955b7f880d422d3961a79215
Also you can use this code for the demo:
import PhotoDialogs
fields = [{'type':'text', 'title':'First Name', 'key':'fname', 'value':''}, {'type':'photo', 'title':'ID card', 'key':'ID_photo', 'value':''}]
PhotoDialogs.form_dialog(fields = fields)
Notice what happens when you press Done after a picture is taken.
Hello,
I've been trying for days to do the following, and run into the same NoneType problem. Here is what I am after: in addition to entering text, numbers, checkmarks, and dates in a form dialog, I would like to also take a picture, and store it locally.
The "picture" row in the form dialog would have two buttons, one to take a picture, and one to show a preview of it. The form dialog return dictionary would return the path to the picture as the value for that given photo row.
Example:
fields = [{'type':'text', 'title':'First Name', 'key':'fname', 'value':''}, {'type':'photo', 'title':'ID card', 'key':'ID_photo', 'value':''}]
dialogs.form_dialog(fields = fields)
And say the user enters "Bob" as first name, and uses the buttons to take a picture that gets stored locally at path pictures/some_unique_id.jpeg
Then the form dialog would return:
{'fname':'Bob', 'ID_photo':'pictures/some_unique_id.jpeg'}
In my attempts, I have used the photos module, the capture_image()
function to get the image, and the image.save(path)
function to save it.
Any help would be greatly appreciated,
Merry Christmas to you all,
G
Thanks for the suggestions. I will try them !
Yep I've tried but it pushes the window prompt behind the form_dialog window and makes it unusable.
Would you be willing to have a look at it, I could send you my files/github repo to run on your side.
Thanks,
G