You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
ImageButton: implement setDrawable()
This commit is contained in:
@@ -62,3 +62,11 @@ JNIEXPORT void JNICALL Java_android_widget_ImageButton_native_1setOnClickListene
|
||||
|
||||
g_signal_connect(button, "clicked", G_CALLBACK(clicked_cb), callback_data);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_widget_ImageButton_native_1setDrawable(JNIEnv *env, jobject this, jlong widget_ptr, jlong paintable_ptr)
|
||||
{
|
||||
GtkButton *button = _PTR(_GET_LONG_FIELD(this, "widget"));
|
||||
GtkPicture *picture = GTK_PICTURE(gtk_button_get_child(GTK_BUTTON(button)));
|
||||
GdkPaintable *paintable = _PTR(paintable_ptr);
|
||||
gtk_picture_set_paintable(picture, paintable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user