rvtypes.Widget usage in Python

Hi, I am trying to experiment with rvtypes.Widget however it seems that no definition exists for Widget at the moment.

I am trying to do something like:

from rv import rvtypes, commands, extra_commands, rvui
class PyTest(rvtypes.Widget):
    def __init__(self):

The error I get is "AttributeError: 'module' object has no attribute 'Widget'" which infact is missing from "rvtypes.py".

I also tried to do the following using MuSymbol:

MuWidget = MuSymbol("rvtypes.Widget")
class PyTest(MuWidget):
    def __init__(self):

the error I get is:

class PyHello(MuWidget):
TypeError: Error when calling the metaclass bases
function takes exactly 1 argument (3 given)

What I am trying to achieve is to render a few lines on top of the standard timeline as a sort of decoration to mark some relavant frames, however it seems that my MinorMode gets always rendered before the standard timeline while I would like to be able to render after it, that is, on top of it. Is there a way to achieve this?

Also, is there a way to access from my MinorMode/Widget another MinorMode/Widget? For example I would like to read the fields of the standard timeline from my MinorMode/Widget to decide where to draw the lines.

Thank you,


댓글 1개

  • 0
    Jon Morley

    Hi Mic,

    You are correct. There is no Widget class in Python. There are only MinorModes. However there are very few differences between MinorModes and Widgets. The main difference is managing the bounds of your mode. You will want to explicitly call setEventTableBBox like so:

    setEventTableBBox(your_mode_name, "global", (minX, minY), (maxX, maxY))

    Otherwise you should continue to do your drawing in your modes render method and can control the order of the mode drawing by passing a sort order when you initialize your mode. Here are the arguments for init:

    init (void; 
          rvtypes.MinorMode this,
          string name,
          [(string,(void;Event),string)] globalBindings,
          [(string,(void;Event),string)] overrideBindings,
          MenuItem[] menu = nil,
          string sortKey = nil,
          int ordering = 0)

     Use the string sortKey. If you want your method to render last then set the sortKey to something like "zz". Please let us know if that works.



댓글을 남기려면 로그인하세요.