static void quit(
void *wid, gpointer data) {
gtk_main_quit();
}
static void nothingFunction(void *wid, gpointer data) {
cout<<"nothing"<<endl;
}
class DNDFrame :
public Frame {
virtual void dragDataGet(GtkWidget *w, GtkSelectionData *selectionData, guint info) {
char output[]="test this one";
gtk_selection_data_set(selectionData, gtk_selection_data_get_target(selectionData), sizeof(char), (unsigned char*) output, strlen(output));
}
virtual bool dragDataReceived(GtkWidget *w, GtkWidget *sourceWidget,
int info,
const unsigned char *selectionStoredData,
int length) {
cout<<"Read the following from the drop data :\n"<<selectionStoredData<<endl;
return true;
}
public:
DNDFrame(
const char *label) :
Frame(label){}
virtual ~DNDFrame(){}
};
int main(
int argc,
char *argv[]) {
gtk_init( &argc, &argv );
DNDFrame toFrame("to frame");
GtkWidget *db=draggingButton.
current();
DNDFrame fromFrame("from frame");
fromFrame<<draggingButton;
dnd<<(GtkTargetEntry){(char*)"INTEGER", 0, 0};
dnd<<fromFrame;
vBox<<
BoxIS(
true,
true,
true)<<fromFrame.show();
vBox<<
BoxIS(
true,
true,
false)<<toFrame.show();
gtk_main();
return 0;
}