[gDesklets] relative-to for/to parents ?!



Hi there,

I just looked into these strange messages in the log:

----------
Traceback (most recent call last):
  File "/usr/local/lib64/gdesklets/display/DisplayTarget.py", line 418, in f
    _("The <tt>relative-to</tt> property "
UserError
----------

OK, the problem is/was. that you could set up a "relative-to" attribute
that points to the parent, like e.g. (taken from QotD):

----------
  <frame id="quoteframe" width="147pt">
    <group id="displaygroup" relative-to="quoteframe,y" width="100%">
----------

So far gDesklets only checked (in DisplayTarget.py) if the element we
want to be placed relative-to ("name") is a child of the parent object
(which means: if it is a sibling):

obj = self._get_parent().get_child_by_id(name)

If the element is the parent object (like in the example given above)
"obj" would be NULL (or None or empty) and the UserError is raised.

So, I fixed the annoying messages in the logfile (see rev. #133) by
checking for the parent's ID and only setting the layout's relative-to
if "obj" is not empty.

But I am not sure if this is just a dirty hack as I am not sure if it
would make any sense to position an element relative to the parent
object by using the relative-to attribute.

If it doesn't make any sense we should have an error message reporting
the error in the ADL. Furthermore we need to mention it in the develbook
etc..
And if it would make any sense, we need to make it work properly ;).

Any comments, ideas etc. ?!

Greetings, Bjoern


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]