Hello!
I'm having trouble getting the toggle feature working on menu items corresponding to an rv packages. I've explained a simple repro case below and I would appreciate if someone could help identify what I'm missing.
1. Contents of PACKAGE file -
modes:
- file: browser.py
menu: 'MyMenu/Browser'
shortcut: control f1
load: lazy
2. Contents of browser.py
import rv.rvtypes
class Browser(rv.rvtypes.MinorMode):
def __init__(self):
super(Browser, self).__init__()
self.init("my_test_browser", None, None, None)
def activate(self):
print "activating"
return
def deactivate(self):
print "deactivating"
return
def createMode():
return Browser()
When I open RV, I can see the Browser menu under MyMenu on the menubar and when I press Control+F1, the activate() gets called and it prints "activate" as expected. All good so far! Now when I press Control+F1 again, instead of calling deactivate() and toggling the menu OFF, it again calls "activate". No matter how many times I use the hot key, it always calls activate(). Another thing I notice is that there is no check-mark on the menu that I would see when its active and not see when its inactive. Basically the toggle isn't working.
Then I removed activate() and deactivate() methods from browser.py and tried the hotkey again, and the toggle works! I can see the check-mark go ON and OFF suggesting its actually toggling.
So I think for some reason the activate() and deactivate() methods disable the toggle feature.
Can someone explain what's happening here? Am I missing something?
Thanks in advance!
Venu.