// @topic W010504 FLTK FLUID -- simple window
// @brief class CDemoWindow extends CFluidWindow -- callback management

// CDemoWindow.h

#ifndef _CDEMOWINDOW_H_INCLUDED_
#define _CDEMOWINDOW_H_INCLUDED_

#include "fluid_project/CFluidWindow.h"

class CDemoWindow : public CFluidWindow {
public:
    void show()
    {
        // Specify which C++ function should Update button call:
        btn_update->callback( (Fl_Callback*)cb_btn_update, (void*)(this) );

        // Make the window visible:
        win_app->show();
    }

    static void cb_btn_update( Fl_Widget* btn, void* userdata )
    {
        CDemoWindow* window = static_cast< CDemoWindow* >( userdata );
        char const* text = window->inp_box->value();
        window->out_box->value( text );
    }
};//class CDemoWindow

#endif // _CDEMOWINDOW_H_INCLUDED_