-
vcr80
Hy!
Pythonista just deleted what I coded in over an hour.
Here's what I did:
- Coded and tested my script multiple times but never left the script file
- suddenly the console became unresponsive (couldn't touch X to stop the script)
- Force Quit Pythonista
- Reopen Pythonista
- all work gone
That sure is an unexpected behaviour - is it a bug?
Thanks
-
-
vcr80
Unfortunately, this gives me an Error. "Inconsistent number of rows after deletion.", @JonB
-
vcr80
The SQL-Table row id.
Thanks! I'll have a look at it!
I solved it (way!!) less elegant but simpler: I just wrote the SQL row ID into the row text. That'll do for now. I was hoping for a simpler solution.
-
vcr80
Hy!
I'm reading data from a sqlite3 database and when I delete the TableViewCell I want to delete the corresponding row in the sqlite3 database. Therefor I must know the id of the row in question. I already asked how to recreate the original visual behavior of deleting a TableViewCell over here: https://forum.omz-software.com/topic/2733/delete-rows-in-tableview - And in the same function I would like to get the row id of that entry in the cell and delete the row in the sqlite database.
Thanks!
-
vcr80
What would
tableview_delete()
look like if I want to show the default visual behaviour and perform some additional action? -
vcr80
Is there a tutorial on how to create custom TableViewCells (with multiple subviews like labels, images, etc.) and then populate them with data?
Ah - https://forum.omz-software.com/topic/1922/adding-a-label-to-tableviewcell-it-s-offset-by-one - seems to be a good starting point!
-
vcr80
Thanks, @ccc - That works fine! Could you explain the part with
NavView(object)
? Why did you change it and what does it change in the background? The rest of your changes are clear to me.Sorry, @Phuket2 I didn't mean it in any offensive way. I am really searching for an introduction to UI Designer of Pythonista because I really want to know how things work. I too think that understanding how views work will help a lot! So again: did I miss something or are you simple supposed to find out on your own or should one already know how those things work because one should know how Python works?
-
vcr80
Great, @ccc - that cleared things up!
I was able to set the text of a label inside another subview of the navigation view now.However, I still don't see how I could access the navigation view itself when a button inside the the subview is pressed.
NavView.push_view(root)
andNavView.v.push_view(root)
didn't work. Knowing how to access the navigation view from within a subview could come in handy if I'd like to close the current subview as soon as a button is pressed or if i want to load yet another subview when the button is pressed.Updated Gist: https://gist.github.com/nitricware/468b31a1b5363c4474e1
Lines 10 and 42 show my new issues...@Phuket2 I'd like to! Did I miss some kind of introduction to Pythonista UI creation? Or are you supposed to know how those kind of things work (Installed Pythonista less than a week ago.)?
-
vcr80
sure, @ccc here it is: https://gist.github.com/nitricware/f82416c411586404e5d2
unfortunately the iteration you posted, @Phuket2 just lists the subviews of the view where the pressed button is located... but not the subviews of the parent navigation view nor the subviews of the root view, that itself is loaded into the navigation view...