Mercurial > dwindows
comparison win/dw.c @ 1331:4c12170f003f
Make dw_notebook_page_destroy() on OS/2 and Windows destroy the contents of the page.
I found that on GTK the contents will have the reference count lowered when the page is removed.
Causing the contents to be destroyed... however this does not happen on OS/2 or Windows.
The option was to either reference the contents before destroying the page on GTK or have
OS/2 and Windows destroy the contents. Because of the name I decided to destroy the contents.
It isn't clear to me what the behavior of removeTabViewItem is on the Mac so no changes there.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 10 Nov 2011 18:06:32 +0000 |
parents | 3f1ac800bf65 |
children | c0f29ce1a879 |
comparison
equal
deleted
inserted
replaced
1330:c63069148357 | 1331:4c12170f003f |
---|---|
6670 */ | 6670 */ |
6671 void API dw_notebook_page_destroy(HWND handle, unsigned int pageidx) | 6671 void API dw_notebook_page_destroy(HWND handle, unsigned int pageidx) |
6672 { | 6672 { |
6673 NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array"); | 6673 NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array"); |
6674 int newid = -1, z, pageid; | 6674 int newid = -1, z, pageid; |
6675 HWND pagehwnd = 0; | |
6675 | 6676 |
6676 if(!array) | 6677 if(!array) |
6677 return; | 6678 return; |
6678 | 6679 |
6679 pageid = _findnotebookid(array, pageidx); | 6680 pageid = _findnotebookid(array, pageidx); |
6682 return; | 6683 return; |
6683 | 6684 |
6684 if(array[pageid]) | 6685 if(array[pageid]) |
6685 { | 6686 { |
6686 SetParent(array[pageid]->hwnd, DW_HWND_OBJECT); | 6687 SetParent(array[pageid]->hwnd, DW_HWND_OBJECT); |
6688 pagehwnd = array[pageid]->hwnd; | |
6687 free(array[pageid]); | 6689 free(array[pageid]); |
6688 array[pageid] = NULL; | 6690 array[pageid] = NULL; |
6689 } | 6691 } |
6690 | 6692 |
6691 TabCtrl_DeleteItem(handle, pageid); | 6693 TabCtrl_DeleteItem(handle, pageid); |
6707 { | 6709 { |
6708 SetParent(array[newid]->hwnd, handle); | 6710 SetParent(array[newid]->hwnd, handle); |
6709 _resize_notebook_page(handle, newid); | 6711 _resize_notebook_page(handle, newid); |
6710 dw_notebook_page_set(handle, array[newid]->realid); | 6712 dw_notebook_page_set(handle, array[newid]->realid); |
6711 } | 6713 } |
6714 if(pagehwnd) | |
6715 dw_window_destroy(pagehwnd); | |
6712 } | 6716 } |
6713 | 6717 |
6714 /* | 6718 /* |
6715 * Queries the currently visible page ID. | 6719 * Queries the currently visible page ID. |
6716 * Parameters: | 6720 * Parameters: |