/[pspp]/psppire/src/callbacks.c
ViewVC logotype

Diff of /psppire/src/callbacks.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by jmd, Sun Nov 13 01:35:44 2005 UTC revision 1.13 by jmd, Thu Nov 24 12:43:13 2005 UTC
# Line 334  on_delete1_activate                    ( Line 334  on_delete1_activate                    (
334    
335    
336  void  void
337  on_about1_activate                     (GtkMenuItem     *menuitem,  on_about1_activate(GtkMenuItem     *menuitem,
338                       gpointer         user_data)
339    {
340    
341    }
342    
343    
344    
345    void
346    on_toolbars1_activate
347                         (GtkMenuItem     *menuitem,
348                                          gpointer         user_data)                                          gpointer         user_data)
349  {  {
350    
351    
352  }  }
353    
354    void
355    on_value_labels1_activate(GtkMenuItem     *menuitem,
356     gpointer         user_data)
357    {
358    
359    
360    }
361    
362    void
363    on_status_bar1_activate(GtkMenuItem     *menuitem,
364     gpointer         user_data)
365    {
366    
367    
368    }
369    
370    void
371    on_grid_lines1_activate(GtkCheckMenuItem     *menuitem,
372     gpointer         user_data)
373    {
374    
375      const bool grid_visible = gtk_check_menu_item_get_active(menuitem);
376    
377      gtk_sheet_show_grid(GTK_SHEET(glade_xml_get_widget(xml, "variable_sheet")),
378                          grid_visible);
379    
380      gtk_sheet_show_grid(GTK_SHEET(glade_xml_get_widget(xml, "data_sheet")),
381                          grid_visible);
382    }
383    
384    
385    /* Set the entire sheet to a particular font */
386    static void
387    sheet_set_font(GtkSheet *sheet, const gchar *font)
388    {
389      GtkSheetRange range;
390      range.col0 = range.row0 = 0;
391      range.coli = gtk_sheet_get_columns_count(sheet) - 1;
392      range.rowi = gtk_sheet_get_rows_count(sheet) - 1;
393    
394      PangoFontDescription* font_desc =
395        pango_font_description_from_string(font);
396          
397    
398      gtk_sheet_range_set_font(sheet, &range, font_desc);
399    }
400    
401    void
402    on_fonts1_activate(GtkMenuItem     *menuitem,
403     gpointer         user_data)
404    {
405      static GtkWidget *dialog = 0 ;
406      if ( !dialog )
407        dialog   = gtk_font_selection_dialog_new(_("Font Selection"));
408    
409      gtk_window_set_transient_for(GTK_WINDOW(dialog),
410                                   GTK_WINDOW(glade_xml_get_widget(xml, "window1")));
411    
412    
413      if ( GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(dialog)) )
414        {
415          const gchar *font =
416            gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(dialog));
417    
418          sheet_set_font(GTK_SHEET(glade_xml_get_widget(xml, "variable_sheet")),
419                         font);
420    
421          sheet_set_font(GTK_SHEET(glade_xml_get_widget(xml, "data_sheet")),
422                         font);
423    
424        }
425    
426      
427      gtk_widget_hide(dialog);
428    
429    }
430    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26