Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use createButton ?

I'm currently going through the samples and looking at how to add GUI elements. Starting from connectedcomponents.cpp I've managed to get understand how a trackbar works. Now I'm trying to add a button. Here's a basic snippet:

void on_button(int, void*){
    cout << "click" << endl;
}
//in main
createButton("test",on_button);

Before I got some link issues related to QtCore/QtGui. I've updated the OpenCV port to 2.4.2 with qt4 and the link error is gone and I can see some nice Gui elements in the namedWindow, but I can't see the button I created. Any hints/tips on what I'm doing wrong ?

Thanks!