A window without window...

I have to port a linux/X11 application to QNX/photon. The core part is
done, now, I have to work on the graphics. In X11. I have a window without
decorations that can be move (XMoveWindow()) and (un)hide
(XMapWindow/XUnmapWindow). In Photon (I’m a real newbie) all I found to
have the window without decoration is to use a “PhRegion_t” and blast my
picture in it. Is there an other way? I don’t want to create/destroy my
region every time my “display” is showing or hided.

Thanks,

Nicolas

Hi Nicolas,

It has been a while since I wrote any photon apps. So if I am wrong or
there is a better way, I hope someone will correct me.

I would recommend that you look in the helpviewer in the following
section:

Photon MicroGUI
→ Widget Reference
→ Widgets
→ PtWindow
→ new resources

There is a new resource called Pt_ARG_WINDOW_RENDER_FLAGS. If you remove
the Ph_WM_RENDER_BORDER flag from this resource, I think that you will
get the behaviour that you want (no window dressing).

Nicolas wrote:

I have to port a linux/X11 application to QNX/photon. The core part is
done, now, I have to work on the graphics. In X11. I have a window without
decorations that can be move (XMoveWindow()) and (un)hide
(XMapWindow/XUnmapWindow). In Photon (I’m a real newbie) all I found to
have the window without decoration is to use a “PhRegion_t” and blast my
picture in it. Is there an other way? I don’t want to create/destroy my
region every time my “display” is showing or hided.

Thanks,

Nicolas

James MacMillan wrote:

Hi Nicolas,

It has been a while since I wrote any photon apps. So if I am wrong or
there is a better way, I hope someone will correct me.

I would recommend that you look in the helpviewer in the following
section:

Photon MicroGUI
→ Widget Reference
→ Widgets
→ PtWindow
→ new resources

There is a new resource called Pt_ARG_WINDOW_RENDER_FLAGS. If you remove
the Ph_WM_RENDER_BORDER flag from this resource, I think that you will
get the behaviour that you want (no window dressing).

This is a somewhat related nit wrt appbuilder. If you have a Window
with no menu decoration in appbuilder, then you cannot minimize it
within appbuilder. Perhaps leaving the menu on the appbuilder
representation of the window would be prudent ? Alternatively a
appbuilder menu item under the “Windows” menu button that would allow
the selected window to be minimized.

If this is a problem, you can remove the border and titlebar
programmatically, before the window is realized. I wrote a quick
test program to confirm this: under appbuilder it has the title
bar, but when executing it does not.

  1. In the “Application” menu, click “Start Info/Modules”.
  2. Add a setup function. I named my function remove_borders
    and placed it in test.c So, I wrote “remove_borders@test.c
    in the text box.
  3. Click “Apply”
  4. Click on the little icon of a pencil beside the “Setup Function”
    label. This will open the editor to that file (test.c)
  5. Add the following code to the function remove_borders.

//code start
unsigned long *flags;

PtGetResource ( link_instance, Pt_ARG_WINDOW_RENDER_FLAGS, &flags, 0);
*flags &= ~(Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE);
PtSetResource ( link_instance, Pt_ARG_WINDOW_RENDER_FLAGS, *flags, 0);<
//code end

Works like a charm. (^_^)

Rennie Allen wrote:

This is a somewhat related nit wrt appbuilder. If you have a Window
with no menu decoration in appbuilder, then you cannot minimize it
within appbuilder. Perhaps leaving the menu on the appbuilder
representation of the window would be prudent ? Alternatively a
appbuilder menu item under the “Windows” menu button that would allow
the selected window to be minimized.

James MacMillan wrote:

If this is a problem, you can remove the border and titlebar
programmatically, before the window is realized. I wrote a quick
test program to confirm this: under appbuilder it has the title
bar, but when executing it does not.

  1. In the “Application” menu, click “Start Info/Modules”.
  2. Add a setup function. I named my function remove_borders
    and placed it in test.c So, I wrote "> remove_borders@test.c> "
    in the text box.
  3. Click “Apply”
  4. Click on the little icon of a pencil beside the “Setup Function”
    label. This will open the editor to that file (test.c)
  5. Add the following code to the function remove_borders.

Yes. I am aware that the docorations can be removed programmatically
(which is why I referred to it as a “nit” - perhaps I should have said
“minor nit” :slight_smile:. I still think that as a usability issue it would be
more convenient to allow a window without decorations to be specified,
but remain manipulatable in appbuilder.

Thanks for the tip about decorations. It works great.
Now, I have an other problem. In X11, when I disabled the decorations
(with CWOverrideRedirect), I also (as a side effect?) put the window in a
“always on top” state. Is there a way to do the same thing in photon? I
need that to use a native window in a java application.

Nic Cola

Rennie Allen wrote:

James MacMillan wrote:

Hi Nicolas,

It has been a while since I wrote any photon apps. So if I am wrong or
there is a better way, I hope someone will correct me.

I would recommend that you look in the helpviewer in the following
section:

Photon MicroGUI
→ Widget Reference
→ Widgets
→ PtWindow
→ new resources

There is a new resource called Pt_ARG_WINDOW_RENDER_FLAGS. If you remove
the Ph_WM_RENDER_BORDER flag from this resource, I think that you will
get the behaviour that you want (no window dressing).


This is a somewhat related nit wrt appbuilder. If you have a Window
with no menu decoration in appbuilder, then you cannot minimize it
within appbuilder. Perhaps leaving the menu on the appbuilder
representation of the window would be prudent ? Alternatively a
appbuilder menu item under the “Windows” menu button that would allow
the selected window to be minimized.

this isn’t entirerly true, try rightclicking on the window without
frame, and then → link →
there are all the options you can do with the frame active :slight_smile:

Enjoy :slight_smile:

phearbear wrote:

Rennie Allen wrote:
appbuilder menu item under the “Windows” menu button that would allow
the selected window to be minimized.



this isn’t entirerly true, try rightclicking on the window without
frame, and then → link -
there are all the options you can do with the frame active > :slight_smile:

Hey, your right ! I wouldn’t have thought to look under link.


Thanks, and there isn’t even a minor nit to register :slight_smile:

Rennie