I was in the process of making a custom button
ui.Viewwith event hooks for button press as well as button release. I wanted to make a button that would trigger repeated actions when held down. That's all well and good and the eventing works fine, but I also tried to emulate, to the best of my ability, all the features that
ui.Buttonhas, like allowing text and or an icon that makes use of
tint_coloretc. This required overriding the
drawmethod and inserting the
set_needs_display()calls in the appropriate places.
Apparently, however, setting
ui.Viewdoes not trigger the
set_needs_display()to redraw the view. I assumed that
tint_colorwas just a property on
ui.Viewthat, under the covers, did all the fancy things to make the view update itself by default, and that I would be able to override it in a reasonable manner to call
super().tint_color.fset()or something like that followed by a
set_needs_display()to redraw my view. After looking into it a little further,
ui.View.tint_coloris just a plain old attribute. So in order for me to properly handle the redrawing of the
ViewI had to make new property getters and setters named
I really dislike this solution because now the API for my custom button is nonstandard and it makes me feel... dirty... lol
Am I misunderstanding how tint_color works/should work?
Using tommasoturchi's mysqldb connector, I'm doing this:
import mysqldb db = mysqldb.connect(host="my.host.com", user="user", passwd="pass", db="MyDBName", port=3306) cursor = db.cursor()
and I'm getting an error:
ord() expected string of length 1, but int foundall the way down in the
self._packet_number = ord(packet)
wassup with that?!
My scripts are organized into folders. The shortcut making page just asks for the script name, which I supplied, but it says it couldn't find that script. I tried the path from
The root directory (like "Utils/myscript") but it said, "can't find script "Utils.py".
How do you create an icon for scripts organized in folders?
If I just type it into the web browser I can get it to work, though.