1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include "npfile.h"
#include "npstringarray.h"
#include "npgroup.h"
#include "npnode.h"
#include "nptree.h"
#include "npcollections.h"
void font_menu_callback( GtkWidget *widget, gpointer data )
{
NP_Collections *collections = ( NP_Collections *)data;
int size = ( int)gtk_object_get_data( GTK_OBJECT( widget ), "font" );
switch( size )
{
case 0:
collections->unread_style->font =
gdk_font_load( "-*-helvetica-bold-r-*-*-*-110-*-*-*-*-*-*" );
collections->read_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-110-*-*-*-*-*-*" );
collections->empty_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-110-*-*-*-*-*-*" );
break;
case 1:
collections->unread_style->font =
gdk_font_load( "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*" );
collections->read_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*" );
collections->empty_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*" );
break;
case 2:
collections->unread_style->font =
gdk_font_load( "-*-helvetica-bold-r-*-*-*-130-*-*-*-*-*-*" );
collections->read_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-130-*-*-*-*-*-*" );
collections->empty_style->font =
gdk_font_load( "-*-helvetica-medium-r-*-*-*-130-*-*-*-*-*-*" );
break;
}
if ( collections->unread_style->font == NULL )
collections->unread_style->font = gdk_font_load( "fixed" );
if ( collections->read_style->font == NULL )
collections->read_style->font = gdk_font_load( "fixed" );
if ( collections->empty_style->font == NULL )
collections->empty_style->font = gdk_font_load( "fixed" );
collections->item = widget;
collections->update_tree();
return;
}
|