JNIEXPORT void JNICALL Java_org_gnome_gtk_GtkInfoBar_gtk_1info_1bar_1add_1action_1widget ( JNIEnv* env, jclass cls, jlong _self, jlong _child, jint _responseId ) { GtkInfoBar* self; GtkWidget* child; gint responseId; // convert parameter self self = (GtkInfoBar*) _self; // convert parameter child child = (GtkWidget*) _child; // convert parameter responseId responseId = (gint) _responseId; // call function gtk_info_bar_add_action_widget(self, child, responseId); // cleanup parameter self // cleanup parameter child // cleanup parameter responseId }
static GtkWidget * create_infobar (PlumaWindow *window, const gchar *version) { GtkWidget *infobar; gchar *message; #if !GTK_CHECK_VERSION (2, 17, 1) infobar = pluma_message_area_new (); pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar), _("_Download"), GTK_STOCK_SAVE, GTK_RESPONSE_YES); pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar), _("_Ignore Version"), GTK_STOCK_DISCARD, GTK_RESPONSE_NO); pluma_message_area_add_button (PLUMA_MESSAGE_AREA (infobar), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); #else GtkWidget *button; infobar = gtk_info_bar_new (); button = pluma_gtk_button_new_with_stock_icon (_("_Download"), GTK_STOCK_SAVE); gtk_widget_show (button); gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar), button, GTK_RESPONSE_YES); button = pluma_gtk_button_new_with_stock_icon (_("_Ignore Version"), GTK_STOCK_DISCARD); gtk_widget_show (button); gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar), button, GTK_RESPONSE_NO); gtk_info_bar_add_button (GTK_INFO_BAR (infobar), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO); #endif message = g_strdup_printf ("%s (%s)", _("There is a new version of pluma"), version); set_message_area_text_and_icon (infobar, "gtk-dialog-info", message, _("You can download the new version of pluma" " by clicking on the download button or" " ignore that version and wait for a new one")); g_free (message); g_signal_connect (infobar, "response", G_CALLBACK (on_response_cb), window); return infobar; }