DirectEntry.setFocus bug

Calling setFocus (or setBackgroundFocus) on a DirectEntry does nothing - is this a known bug? No focus is changed. No tab-focusing for me it appears.

You should not call entry.setFocus(). Instead, use entry[‘focus’] = 1. In general, the DirectGui objects use this dictionary-like interface for all operations on them; the interface is made to resemble that of the Python Mega-Widgets library.


Oh, okay. It was the documentation that threw me:

I thought of it to be like the initialText parameter - only good for setting on instantiation.
As for the dictionary-esque approach. Do you not find it a little unintuitive? One does not usually map changing a key in a “dictionary” to a change in the programming environment, if that makes any sense. I would have thought using properties would have made more sense.

Thank you again,

I do find it counterintuitive. It also confuses every newcomer to the system. If we were redesigning the DirectGui subsystem with the benefit of hindsight, I’d recommend throwing out this crazy interface.

However, we’re not redesigning the system right now, so we have to stick with the system we’ve got. :slight_smile: Still, once you get used to it, it’s not too bad, and it’s actually quite powerful.