Change font of a button



Hi,
I've modified the helloworld example in the gtkmm tutorial book (examples/book/helloworld/helloworld.cc) to change the font of the push button.
But I did not see any change in the application.
The modified file is attached to the mail.
Please find it.
Where am i doing wrong ?

Thanks in advance,
Surya

//$Id: helloworld.cc,v 1.2 2004/02/10 14:49:14 murrayc Exp $ -*- c++ -*-

/* gtkmm example Copyright (C) 2002 gtkmm development team
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include "helloworld.h"
#include <iostream>

HelloWorld::HelloWorld()
: m_button("Hello World")   // creates a new button with the label "Hello World".
{
  // Sets the border width of the window.
  set_border_width(10);
  Pango::FontDescription fd("Serif 8") ;
  fd.set_size (8 * Pango::SCALE) ;
  modify_font (fd) ;


  // When the button receives the "clicked" signal, it will call the
  // hello() method. The hello() method is defined below.
  m_button.signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked));

  // This packs the button into the Window (a container).
  add(m_button);

  // The final step is to display this newly created widget...
  m_button.show();
}

HelloWorld::~HelloWorld()
{
}

void HelloWorld::on_button_clicked()
{
  std::cout << "Hello World" << std::endl;
}


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