[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Font selection



Hello again everyone:

I'm having some trouble with changing the font on my top level window.  If I
understand correctly, widgets placed into a window will inherit the window's
style by default.  Under this assumption I changed the font of my top level
window expecting to see the font change globally.  Unfortunately I haven't
seen any font change at all.

Please look at this snippet of code and let me know if you see an error;
also let me know if my assumptions above are incorrect.

Thanks in advance!

  	:
	:
	:

      gnome_init( PROGRAM, VERSION, argc, argv );
      
      _topLevelWindow = gnome_app_new( PROGRAM, "QuickCheck" );
      gtk_window_set_default_size( GTK_WINDOW(_topLevelWindow), 600, 400 );
      
      programFont = gdk_font_load( "-*-courier-bold-r-*-*-16-*-*-*-*-*-*-*"
);
      if( programFont == NULL )
      {
         cout << "programFont == NULL" << endl;
      }
      else
      {
         gdk_font_ref( programFont );
         windowStyle = gtk_widget_get_style( _topLevelWindow );
         windowStyle->font = programFont;
         gtk_widget_set_style( _topLevelWindow, windowStyle );
      }
      gtk_widget_show( _topLevelWindow );
      
      gtk_signal_connect( GTK_OBJECT(_topLevelWindow), "delete_event",
                          GTK_SIGNAL_FUNC( delete_event_system_callback ),
NULL );
      gtk_signal_connect( GTK_OBJECT(_topLevelWindow), "destroy",
                          GTK_SIGNAL_FUNC( destroy_event_system_callback ),
NULL ); 
	:
	:
	:




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]