XBoard GTK question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

XBoard GTK question

Post by Look »

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 ?
Farewell.