Hi VisualWorks users.
How does one do keyboard bindings? Is there some nice documentation somewhere, or do I need to dive into the source code? Is there some concept of an "action" or "command" class akin to javax.swing.Action from the Java world, or do I need to do event handling from the keyboard manually as with MVC and Morphic? I tried using the nice menu editor and added a keyboard shortcut to a menu (and the menu to a text box), but my suspicion now is that the "shortcut key" setting there is only decorative. It appears to not have any effect on the GUI other than giving the menu entry a bit of extra text. Also, I wanted to add a "Keep this text?" warning for when a text box is programatically updated but has user-modified text. Is there a "right way" to do this? Currently I'm using a ValueHolder on a String as the text box's model and comparing the ValueHolder's value to the last known value that I programatically set it to. That way I can detect whether the user has edited the text. However, this feels like a crummy way of doing it. Is there some flag or test I can do to determine whether a text box has unsaved edits by a user? Finally, when Squeak locks up you have a chance of recovery by pressing alt-. (the rest of the time your image is toast :-) ). Does VisualWorks have a similar recovery mechanism? I've had to recover from the changes file a couple of times when VW froze up. Thanks, a new VisualWorks user, Michael. -- http://gulik.pbwiki.com/ _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Dear Michael,
1) CTL + Y and CTL + SHIFT + Y are the lockup shortcuts in VW. CTL + Y will bring up a debugger if it can guess which process is causing the problem (invoking in the window where the action that caused the problem got done can sometimes help in this). Otherwise it will bring up a process monitor (same as the launcher menu item) and you can try and guess the right process to select, then invoking debug (or terminate or whatever) in hopes to address the problem and resume your work. CTL + SHIFT + Y brings up a workspace with suggestions on what you can type (you then cause it to be executed by hitting ESC). This is for very extreme lockup situations where CTL + Y isn't working. The most common action is to kill the image (via ObjectMemory quit). 2) Depending what you kind of shortcut you mean, you may wish to load the MagicKeys parcel and follow its comment. Which version of VW are you using? In older VW, some RB-specific menu items could need purging before changes would take effect, e.g. RBCommand flushActions. BrowserApplicationModel flushMenus. However I believe menu items created wholly via pragmas or specs, not using RBCommand, do not need this - after you've installed the changes, the next time you open the window it should work. However I'll let the UI people in the team comment on that. HTH Niall Ross >Hi VisualWorks users. > >How does one do keyboard bindings? Is there some nice documentation >somewhere, or do I need to dive into the source code? Is there some >concept of an "action" or "command" class akin to javax.swing.Action >from the Java world, or do I need to do event handling from the >keyboard manually as with MVC and Morphic? > >I tried using the nice menu editor and added a keyboard shortcut to a >menu (and the menu to a text box), but my suspicion now is that the >"shortcut key" setting there is only decorative. It appears to not >have any effect on the GUI other than giving the menu entry a bit of >extra text. > >Also, I wanted to add a "Keep this text?" warning for when a text box >is programatically updated but has user-modified text. Is there a >"right way" to do this? Currently I'm using a ValueHolder on a String >as the text box's model and comparing the ValueHolder's value to the >last known value that I programatically set it to. That way I can >detect whether the user has edited the text. However, this feels like >a crummy way of doing it. Is there some flag or test I can do to >determine whether a text box has unsaved edits by a user? > >Finally, when Squeak locks up you have a chance of recovery by >pressing alt-. (the rest of the time your image is toast :-) ). Does >VisualWorks have a similar recovery mechanism? I've had to recover >from the changes file a couple of times when VW froze up. > >Thanks, a new VisualWorks user, >Michael. > > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Michael van der Gulik-2
Michael van der Gulik wrote:
> I tried using the nice menu editor and added a keyboard shortcut to a > menu (and the menu to a text box), but my suspicion now is that the > "shortcut key" setting there is only decorative. It appears to not > have any effect on the GUI other than giving the menu entry a bit of > extra text. IIRC, shortcuts on pop-up menus have no effect (or at least on Windows the convention is not to have them). Shortcuts on menu bar menus should work fine. You can make a button, radio button or checkbox have a shortcut key by adding & before a character in its label - e.g. a button labeled &Action will be invoked by pressing Alt+A. Text boxes have standard shortcuts defined in UIFeelPolicy>>keyboardDispatchTable. MagicKeys provides a more palatable way to edit them. You can also add particular key bindings to a single text box or other widget - search for keyboardHook: in docs\GuiDevGuide.pdf. Hope this helps, Steve _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |