pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abbas Hussain <facade...@gmail.com>
Subject Re: Problem with Keystrokes not getting registered.
Date Fri, 15 Oct 2010 15:18:27 GMT
Yeh. I guess have to experiment with that feature. So any particular reason
why the actions don't get registered at the time the window is created? I
mean the Window does have the focus after all.
Also, how do I have the shortcuts for the keyboard accelerators? Like how
when we press the ALT+F key the File menu pops up on Firefox?
--abbas.

On Fri, Oct 15, 2010 at 8:14 PM, Greg Brown <gkbrown@mac.com> wrote:

> Not entirely sure what you mean. Could you just combine the "welcome" and
> "login" screens into a single screen?
>
> On Oct 15, 2010, at 11:06 AM, Abbas Hussain wrote:
>
> Hmmm... can it be done so that I can have a Tab? The idea being that I
> display a "welcome" screen. That way I still have a focusable component and
> get the login action to work?
> Thanks,
> Abbas.
>
> On Fri, Oct 15, 2010 at 8:01 PM, Greg Brown <gkbrown@mac.com> wrote:
>
>> That's because Labels aren't focusable.  :-)  You need to add a component
>> that can get the focus, like a TextInput or PushButton.
>>
>> On Oct 15, 2010, at 10:55 AM, Abbas Hussain wrote:
>>
>> I added a Label on the frame inside the window, but still no luck.  I then
>> got a reference to the label and did a requestFocus on that but even that
>> did not work.
>>
>> --abbas.
>>
>> On Fri, Oct 15, 2010 at 5:50 PM, Greg Brown <gkbrown@mac.com> wrote:
>>
>>> Make sure that the window's content contains a focusable component.
>>>
>>> On Oct 15, 2010, at 8:25 AM, Abbas Hussain wrote:
>>>
>>> Greg,
>>> I did that - however, to no effect. Here is the code from the startup
>>> method in my app: http://pastebin.org/203997
>>>  <http://pastebin.org/203997>The variable app is a singleton object for
>>> the Application class.
>>> This is the code for the Action: http://pastebin.org/204256 However, the
>>> sysout on line 4 never gets invoked by a keyboard shortcut. Only works with
>>> the Menu though.
>>>
>>> Thanks,
>>> A.Hussain.
>>>
>>> On Fri, Oct 15, 2010 at 4:58 PM, Greg Brown <gkbrown@mac.com> wrote:
>>>
>>>> In order for a keystroke to be processed, a component must have the
>>>> focus to receive the key event and propagate it up the component hierarchy
>>>> to the window. Easiest way to handle this is to call requestFocus() on the
>>>> window immediately after you open it.
>>>>
>>>> On Oct 15, 2010, at 6:56 AM, Abbas Hussain wrote:
>>>>
>>>> Hello All.
>>>> New to using Apache Pivot. Seems interesting and I am evaluating it for
>>>> a new project we are about to start. I have the following wtkx defined:
>>>> <Frame title="4SiJte" maximized="true"
>>>>         styles="{showWindowControls:false}"
>>>>         xmlns:wtkx="http://pivot.apache.org/wtkx"
>>>>         xmlns:content="org.apache.pivot.wtk.content"
>>>>         xmlns="org.apache.pivot.wtk">
>>>>     <actionMappings>
>>>>         <Window.ActionMapping action="loginAction" keyStroke="CTRL-L"
/>
>>>>     </actionMappings>
>>>>     <menuBar>
>>>>         <MenuBar>
>>>>             ...
>>>>                 <Menu.Item action="loginAction">
>>>>                      <buttonData>
>>>>                            <content:MenuItemData text="Login"
>>>> keyboardShortcut="CTRL-L" />
>>>>                      </buttonData>
>>>>            ...
>>>>     </menuBar>
>>>> I am reading it in to a Window, however, when I click on the action
>>>> through the menu item the action gets invoked, but pressing CTRL+L has no
>>>> effect. Any thoughts? I read through the tutorial but I am not sure what
I
>>>> am missing here. The MenuBar tutorial seems to work fine and I am not sure
>>>> what I am doing differently.
>>>> On a different but related note, how do I setup menu accelerator keys?
>>>> For instance how pressing ALT+F usually shows the File menu in most apps.
>>>> Thanks,
>>>> A.Hussain.
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Mime
View raw message