Mercurial > dwindows
diff android/DWindows.kt @ 2796:0c534743b7a9
Android: Allow passing a menu window handle to dw_window_destroy().
Internally if it is a menu, instead of following the Window/View code path,
instead pass the handle to menuDestroy().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 15 Jul 2022 23:58:19 +0000 |
parents | 5c61aba17b69 |
children | 62837ceeec46 |
line wrap: on
line diff
--- a/android/DWindows.kt Fri Jul 15 11:50:09 2022 +0000 +++ b/android/DWindows.kt Fri Jul 15 23:58:19 2022 +0000 @@ -3198,10 +3198,13 @@ } } - fun windowDestroy(window: View): Int { + fun windowDestroy(window: Any): Int { var retval: Int = 1 // DW_ERROR_GENERAL - if(windowLayout != null) { + if(window is DWMenu) { + menuDestroy(window as DWMenu) + retval = 0 // DW_ERROR_NONE + } else if(windowLayout != null && window is View) { waitOnUiThread { val adapter: DWTabViewPagerAdapter = windowLayout!!.adapter as DWTabViewPagerAdapter val index = adapter.viewList.indexOf(window)