Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Retrieving screen_display_t for current screen in Cascades

I'd like to retrieve the screen_display_t object at some point in my Cascades application. Since I am letting the operating system do all of the UI creation, I do not have direct knowledge of the context object which means I don't know how to retrive the display object. 

 

What's the best way to retrive the display object?

 

Thanks,

Scott

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Retrieving screen_display_t for current screen in Cascades

Good question. 

You can retrieve a SCREEN_PROPERTY_DISPLAY from a window handle, but you first need a window handle.  Try just creating a new context and new window and reading this value.  If you are concerned about multi-display stuff, maybe you can attach the window to a ForeignWindowControl in your app first.

 

Curious what you're trying to do.

 

Please use plain text.
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Retrieving screen_display_t for current screen in Cascades

I'm developing automated test tools. One type of test is a "Monkey" test where I inject thousands of touch events on the screen. If or when (usually when) the app crashes, I can look at the touch history and debug logs to find the weak spots in my application.

In a more controlled test, I map out specific touch sequences that should yield expected output. Then I check to see if the program's output is as was expected.

Scott
Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Retrieving screen_display_t for current screen in Cascades

I've missed this on BlackBerry, even thought about writing my own a couple of months back.

If you need beta testers I put myself foward for consideration. :smileyhappy:


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Retrieving screen_display_t for current screen in Cascades

Every window in Cascades has 'handle' property. This is your screen_window_t handle to the window in Native world. Use it to get display as Sean mentioned above.

Please use plain text.