I'm having the same problem. I tried with parent class xbmcgui.Window and xbmc.WindowDialog - it does the same thing on both. I also can't control the size of it - width, height are the same no matter what I specify.
This is in Frodo. I haven't tried it with Eden to see if something broke with Frodo.
Also, the whole control seems to be dependent on something in the textures.xbt file. It is pulling a background image from there when I instantiate with just coords, size, and label, like you did above. If I move the textures file, then the control won't be displayed at all. Bizarre. I tried first editing the 'edit' control in the defaults.xml file for the skin, then deleting the file altogether, but it made no difference either way. The textures.xbt file was the key to that problem, Although i haven't cracked it open to see if I can see which texture is specifically being pulled from there and drawn in the windowdialog.
[some time passes as I investigate]
Okay, I see in github that the default backgrounds are hardcoded into the control. From
https://github.com/xbmc/xbmc/blob/master...ontrol.cpp:
Code:
strTextureFocus = focusTexture ? focusTexture :
XBMCAddonUtils::getDefaultImage((char*)"edit", (char*)"texturefocus", (char*)"button-focus.png");
strTextureNoFocus = noFocusTexture ? noFocusTexture :
XBMCAddonUtils::getDefaultImage((char*)"edit", (char*)"texturenofocus", (char*)"button-focus.png");
So there needs to be a "button-focus.png" in your textures.xbt file (or your media folder, I'm guessing. I'm about to try it out. ). I'm actually building a new skin right now from scratch, and have no textures.xbt, and no button files with those names, so that's an interesting problem for me.
Still don't know where the 0,0 coords are coming from. I'm gonna experiment and see if moving and resizing the control after declaring it will work.
-Jerimiah
Oh sweet, it worked. I was able to move and resize the control outside the instantiation. I tried this:
Code:
mydisplay = MyClass()
mydisplay.inputbox_username.setText("Here's some text")
mydisplay.inputbox_username.setPosition(100, 250)
mydisplay.inputbox_username.setWidth(400)
mydisplay.setFocus(mydisplay.inputbox_username)
mydisplay.doModal()
and it worked fine. I hope that helps you.
Now I need to figure out if I can do something about the textures on my end.
-Jerimiah