Search found 5 matches
- Tue Mar 02, 2021 5:27 pm
- Forum: Programs, Libraries and Tools
- Topic: adding new objects to existing class instance
- Replies: 6
- Views: 3971
Re: adding new objects to existing class instance
Agreed. Storing objects as members of a list makes more sense than adding them as attributes because you will need to be able to iterate over the list members. For example, if all or part of a window is obscured by another window, you need to consider what happens when the top window is closed. The...
- Tue Mar 02, 2021 5:19 pm
- Forum: Programs, Libraries and Tools
- Topic: adding new objects to existing class instance
- Replies: 6
- Views: 3971
Re: adding new objects to existing class instance
Not entirely sure what you mean, but you want win.show() to also call text1.show() and button1.show() why not declare an addObject function? class Window: def __init__(self, *args): self.children = [] def addObject(self, o): self.children.append(o) def show(self): foreach child in self.children: ch...
- Tue Mar 02, 2021 12:49 pm
- Forum: Programs, Libraries and Tools
- Topic: adding new objects to existing class instance
- Replies: 6
- Views: 3971
adding new objects to existing class instance
Hi, Curently i am building a windows type gui with a tft screen, and made many classes for it. i can create a window app like #to create win = Window(50,50,100,100,color.white,"TestWindow",tft,touch) text1 = textView(win,win.centerX,win.top+10,fonts.sans9,color.red,"Hello World") button = Button(win...
- Tue Jan 19, 2021 9:47 pm
- Forum: ESP32 boards
- Topic: sdcard doesn't work with SoftSPI
- Replies: 2
- Views: 2630
Re: sdcard doesn't work with SoftSPI
It may also be of SD cards. Micropyton is a little bit picky about SD card. They have to be formatted with a single FAT32 partition. Brand new SD cards are sometimes formatted differently. I had good experience with Samsung, Transcend and Sandisk cards in sizes of 8, 16, and 32 GB. And try to a) in...
- Mon Jan 18, 2021 7:14 pm
- Forum: ESP32 boards
- Topic: sdcard doesn't work with SoftSPI
- Replies: 2
- Views: 2630
sdcard doesn't work with SoftSPI
Hello today i have built the latest firmware with my custom modules and upload my esp32, however the regular sd card module started not to work. When i tried to use it as it was tomorrow i got an error : Warning: SPI(-1, ...) is deprecated, use SoftSPI(...) instead and i used import machine import s...