ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm trying to figure out, how to use wxWindows library. I want to create just simple application, that'll display selected image.
this is part of the code, that creates open file dialog and shoul display image into the frame....
void testFrame::OnOpen(wxCommandEvent& WXUNUSED( event) )
wxFileDialog *fileDialog = new wxFileDialog(this, "Vyber subor", "", "", "*.*", wxOPEN, wxDefaultPosition);
if( fileDialog->ShowModal() == wxID_OK)
//tak treba osetrit open
wxBitmap *bitmap = new wxBitmap();
if(bitmap == false)
wxMessageBox( wxT("Nepodarilo sa otvorit subor s obrazkom"), wxT("CHYBA"), wxOK|wxICON_ERROR, this);
wxMessageBox( wxT("Obrazok by mal byt nacitany"), wxT("Subor OK"), wxOK|wxICON_INFORMATION, this);
but when I try to compile, I get an error message:
*/home/psycho/myprogs/test/src/test.cpp:97: error: no matching function for call to `wxStaticBitmap::SetBitmap(wxBitmap*& )'
*/usr/include/wx/gtk/statbmp.h:44: error: candidates are: virtual void wxStaticBitmap::SetBitmap(const wxBitmap& )
right, ok so you are providing a pointer when it wants the direct object. I suck at pointers, but try either declaring as "const wxthiny bitmap" or dereference the pointer when you pass it- "SetBitmap(&bitmap)" don't blame me if that's wrong though! i'm a perl chap.