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
Highlighted
Contributor
Posts: 20
Registered: ‎07-15-2012
My Device: Developer
My Carrier: Sprint

screen_group_t

This might be a very simple question, but I can't find any examples to figure it out with. I want to use screen_set_group_property_iv, the first argument is of type screen_group_t.  But when you create a screen group, you do it with a const char*. screen_group_t doesn't appear to be defined as cont char*. So what is the proper way to reference the group ID that I created for use in this function? Can I just cast my ID string to screen_group_t?

BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: screen_group_t

[ Edited ]

there are around a dozen references to screen_group_t in screen.h.

This one may be of interest:

https://developer.blackberry.com/native/beta/reference/screen_libref/topic/screen_create_group.html

 

 

Contributor
Posts: 20
Registered: ‎07-15-2012
My Device: Developer
My Carrier: Sprint

Re: screen_group_t

I'm trying to hook into one that was already created by another library (Cocos2d-x). I need it for a port of an existing library, so I need a way to disable the screen lock from a static function.
Cocos2d-x has a function to return the group ID (a const char), but it creates its group using screen_create_window_group, which doesn't seem to use screen_group_t.
I can add a function to my version Cocos2d-x that returns its screen_window_t and use screen_set_window_property_iv instead, but I was hoping to do it without doing that. Actually, I was hoping to do that without my code using Cocos2d-x at all, which I was hoping was possible because I know how Cocos2d-x creates its screen group ID name.
Is there no way to reference a window group by the group name that was assigned to it in screen_window_create_group? I have looked at screen.h and not found any. Hopefully I missed something. Being able to create a group by giving it a name, but not reference it by that name later, seems odd to me.
BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: screen_group_t

You can't arbitrarily look up a screen_group_t by name, but screen_get_window_property_pv() can be used to retrieve a screen_group_t from a window with the SCREEN_PROPERTY_GROUP type.

It can also be queried from some other objects, like events... scan the docs for SCREEN_PROPERTY_GROUP:

https://developer.blackberry.com/native/beta/reference/screen_libref/topic/screen_8h_1screen_propert...

 

Cheers,

Sean

BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: screen_group_t

fyi, the reason you aren't typically permitted to look up groups or windows by name is that it's a security/usability concern.  If you start messing around with the internals of some of these objects without the knowledge of the intermediate framework, it can lead to state being out-of-sync, things misbehaving visually, or crashes.  (eg. imagine changing the source buffer dimensions of a video window or cascades UI while rendering code is running).

 

Cheers,

Sean