diff android/dw.cpp @ 2578:a36448beb7f7

Android: Implement dw_window_set_style() for static text widgets. Clean up a number of warnings reported by Android Studio.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 22 May 2021 21:53:41 +0000
parents 6fdab466d7a2
children 473eb9ff3f04
line wrap: on
line diff
--- a/android/dw.cpp	Sat May 22 10:00:31 2021 +0000
+++ b/android/dw.cpp	Sat May 22 21:53:41 2021 +0000
@@ -5044,6 +5044,19 @@
  */
 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask)
 {
+    JNIEnv *env;
+
+    if(handle && (env = (JNIEnv *)pthread_getspecific(_dw_env_key)))
+    {
+        // First get the class that contains the method you need to call
+        jclass clazz = _dw_find_class(env, DW_CLASS_NAME);
+        // Get the method that you want to call
+        jmethodID windowSetStyle = env->GetMethodID(clazz, "windowSetStyle",
+                                                    "(Landroid/view/View;II)V");
+        // Call the method on the object
+        env->CallVoidMethod(_dw_obj, windowSetStyle, handle, (jint)style, (jint)mask);
+        _dw_jni_check_exception(env);
+    }
 }
 
 /*