先看一个简单的Gtkmm的例子,问题在下面说:
===============HelloWorld.h===============
#ifndef HELLOWORLD_H_
#define HELLOWORLD_H_
#include <gtkmm.h>
class HelloWorld : public Gtk::Window
{
public:
HelloWorld();
virtual ~HelloWorld();
protected:
virtual void on_button_clicked(); //Signal handlers:
Gtk::Button m_button; //Member widgets:
};
#endif /*HELLOWORLD_H_*/
===============HelloWorld.cpp===============
#include "HelloWorld.h"
#include <iostream>
HelloWorld::HelloWorld()
: m_button("Hello World") // creates a new button with the label "Hello World".
{
===============HelloWorld.h===============
#ifndef HELLOWORLD_H_
#define HELLOWORLD_H_
#include <gtkmm.h>
class HelloWorld : public Gtk::Window
{
public:
HelloWorld();
virtual ~HelloWorld();
protected:
virtual void on_button_clicked(); //Signal handlers:
Gtk::Button m_button; //Member widgets:
};
#endif /*HELLOWORLD_H_*/
===============HelloWorld.cpp===============
#include "HelloWorld.h"
#include <iostream>
HelloWorld::HelloWorld()
: m_button("Hello World") // creates a new button with the label "Hello World".
{