XBoard GTK question

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Look
Posts: 253
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

XBoard GTK question

Post by Look » Wed Jan 08, 2020 12:42 pm

Hi,

I have this question asked here.

Also about produce_recent_items() function:

backend.c

Code: Select all

void produce_recent_items(void) 
{
#include <stdbool.h>
    GtkRecentManager *recent_files;
    GtkRecentInfo *ri;
    GList *rf_list;
    const gchar *rf_str;
    //GtkWidget *rf_widget;
    GtkRecentInfo *rf_widget;

    recent_files=gtk_recent_manager_get_default(); 
    gtk_recent_manager_set_limit(recent_files,RECENTS_COUNT);
    rf_list=gtk_recent_manager_get_items(recent_files);

    int i;
    for(i=0; i<RECENTS_COUNT; )
    {
        recents_ptr[i]=NULL;
        if(rf_list==NULL)
            break;

        ri=rf_list->data;
        bool this_app ;
        gchar * name = gtk_recent_info_last_application(ri);
        if(strstr(name,"xboard"))
            this_app=true;
        else
            this_app=false;
        if(this_app)
        {
            rf_str=gtk_recent_info_get_uri(ri); 
            rf_widget=gtk_menu_item_new_with_label(rf_str); // TODO warning here
            recents_ptr[i]=rf_widget;
            i++;
        }
        rf_list=rf_list->next;
    }
   return;
}
Any suggestion ?

Post Reply