Skip navigation.
Home
The QNX Community Portal

View topic - PtDestroyWidget() does not work

PtDestroyWidget() does not work

Isn't the name clear?

PtDestroyWidget() does not work

Postby summerluv » Tue Nov 06, 2012 1:25 am

Hi,
In Phab I have a window called "editWin". It is meant to be a pop-up window that shows up on top of a window called "baseWin".
I create an internal link for editWin, and launch it in my code by calling
Code: Select all
ApCreateModule(ABM_editWin, NULL, NULL );
It works fine.
Now there is an "Exit" button in baseWin. When that button is clicked, I want the pop up window to close as well. I think to close this window, I'm supposed to call
Code: Select all
PtDestroyWidget(ABW_editWin);
. So I added this function to my "Exit" button's callback. However, the popup window is not closed. PtDestroyWidget seems to do nothing, even though my printf statement tells me it's able to find the popup window with no problem.

To get around this problem, I set baseWin to be the parent window, so when baseWin exits, editWin also seems to exit automatically. I have two questions:
1) Is my observation correct? If a parent window exits, any child window also is closed automatically? I just want to make sure it's actually lurking somewhere, just not displayed.
2) Why does PtDestroywidget not work?

Thanks!
summerluv
New Member
 
Posts: 7
Joined: Mon Oct 29, 2012 6:03 pm

Re: PtDestroyWidget() does not work

Postby maschoen » Tue Nov 06, 2012 4:08 am

You have the right idea, but the wrong code.

ABM_editWin is a module pointer. You create a widget with APCreateModule as follows:

PtWidget_t *window;

window = ApCreateModule(...);

So to destroy the window you would call

PtDestroyWidget(window);
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 0 guests