nanogui: Write FLTK'program by c++ format. Can't compile.
Subject:
Write FLTK'program by c++ format. Can't compile.
From:
"llin" ####@####.####
Date:
6 Sep 2002 10:30:33 -0000
Message-Id: <003901c25590$61c30ea0$0400a8c0@YOUCHUANG.local>
I wite code by useing c++ .
When compile .err happen.
F01010.cxx(14) : error C2440: '=' : 'void (__thiscall F0101::*)(class
Fl_Widget *,void *)' から 'void (__cdecl *)(class Fl_Widget *,void *)' に変
換することはできません。(新しい動作 ; ヘルプを参照)
この変換が可能なコンテキストはありません。
-->
F01010.cxx(14) : error C2440: '=' :
Can not change 'void (__thiscall F0101::*)(class Fl_Widget *,void *)'
to 'void (__cdecl *)(class Fl_Widget *,void *)' .
Thank in advance.
LLin
Attach with source file ( main.cxx F01010.h F01010.cxx )
Following is source code
--//main.cxx
#include "F01010.H"
int main(int argc,char **argv){
F01010 oF01010;
oF01010.F0101_run(argc,argv);
}
--//F01010.h
#ifndef _F01010_H
#define _F01010_H
#include "stdio.h"
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Button.H>
class F0101{
public:
int F0101_run(int argc,char **argv);
private:
Fl_Window *window;
Fl_Box *box;
Fl_Input *input;
Fl_Button *button;
void click_cb(Fl_Widget *, void *);
};
#endif
--//F01010.cxx
#include "F01010.h"
void F0101::click_cb(Fl_Widget *, void *){
const char *sc;
sc= box->label();
input->value(sc);
window->show();
}
int F0101::F0101_run(int argc,char **argv){
window=new Fl_Window(500,250);
box=new Fl_Box(20,30,100,20,"Welcome second");
input=new Fl_Input(190,30,100,20);
button=new Fl_Button(20,70,40,40,"OK");
button->callback(click_cb);
button->when(FL_WHEN_RELEASE);
window->end();
window->show(argc,argv);
return Fl::run();
}
[Content type application/octet-stream not shown. Download]
[Content type application/octet-stream not shown. Download]
[Content type application/octet-stream not shown. Download]