Issue 235: 'LabelBase' object has no attribute 'usersize'
Status:  Done
Owner: ----
Closed:  Apr 2010
Reported by awa...@gmail.com, Apr 7, 2010
What steps will reproduce the problem?

from pymt import *

self.label2 = LabelBase(label='lapin lapin')

w = MTWindow(fullscreen = False)
w.add_widget(self.label2)

runTouchApp()

What is the expected output? What do you see instead?
a simple label is expected but error message instead

user@ubuntu:~/pymt-examples-0.4/widgets$ python aw_test_LabelBase.py
[INFO   ] PyMT v0.4
[INFO   ] [Camera  ] using <gstreamer> as camera provider
[INFO   ] [Logger  ] Record log in /home/user/.pymt/logs/pymt_10-04-08_12.txt
[INFO   ] [Text    ] using <pygame> as text provider
[INFO   ] [Video   ] using <gstreamer> as video provider
[INFO   ] [OSC     ] using <multiprocessing> for socket
[INFO   ] [Loader  ] using <pygame> as thread loader
/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/ui/widgets/flippable.py:106:
SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert(to in 'back', 'front')
/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/ui/widgets/composed/modalpopup.py:56:
SyntaxWarning: import * only allowed at module level
  def on_popup_draw(self):
[INFO   ] [Window  ] use Pygame as window provider.
[INFO   ] [Window  ] OpenGL version <2.1.2 NVIDIA 173.14.20>
Traceback (most recent call last):
  File "aw_test_LabelBase.py", line 3, in <module>
    self.label2 = LabelBase(label='lapin lapin')
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/text/__init__.py",
line 89, in __init__
    self.usersize   = kwargs.get('size')
AttributeError: 'LabelBase' object has no attribute 'usersize'

What version of the product are you using? On what operating system?
ubuntu 9.10
pymt 0.4

Please provide any additional information below.

Apr 8, 2010
Project Member #1 txprog
It's an error, but anyway, you're using something not compatible.
LabelBase must not be used by user (i must remove it in __all__)

Use Label() for a normal label with custom usage
All core element (Image, Video, Label) without MT prefix cannot be used in the Tree
without a container.

If you want to create a widget label, use MTLabel()

Otherwise, use MTContainer(coreobject) to add a core object in the tree.
MTContainer(Label(label='bleh'))

Status: Done
Labels: Milestone-0.4.1 Component-Core
Jul 2, 2010
Project Member #2 txprog
(No comment was entered for this change.)
Labels: Milestone-0.5