Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
My code is running but not loading the file, nor displaying either.... researching into the matter and found something about GetPath() no getting the path correctly, in a Linux sys.
void wxWidget_2_utubeFrame::OnLoadClick(wxCommandEvent& event)
{
// //manually added
int dlg=FileDialog1->ShowModal(); //manually added
if(dlg==wxID_OK) //manually added
{
my_bitmap.LoadFile(FileDialog1->GetPath(),wxBITMAP_TYPE_ANY); //manually added
my_wxclientdc->DrawBitmap(my_bitmap,0,0,false); //manually added
//os.path.dirname(file_dialog.GetPath()) this was a solution recommended and did not work.
}
}
thanks getting the time and know how in this....
Last edited by omahdezavalos on Sun Jan 20, 2019 9:12 pm, edited 1 time in total.
1) I've moved your thread to the 'Platform Related Issues' sub-forum as you said it occurs "in a Linux sys". Do you have it working correctly on other platforms?
2) With this sort of issue, I strongly suggest that, instead of online references, you provide a patch to one of the wxWidgets samples that makes it demonstrate the issue. First, that will greatly increase the chance of someone testing your problem and potentially supplying a fix (or at least agreeing that you've found a bug and pointing to trac as the place to report it); and second, it's surprising how often the process of minimising your code to create the patch results in you yourself finding the cause of the issue.
In addition to what David said:
What does the string returned by GetPath() contain?
Can you reproduce the issue with bundled dialogs sample?
Have you tried the last release in the 3.0 branch, i.e . 3.04?
TBH, the code fragment posted looks a bit suspect to me. Modal dialogs such as wxFileDialog are usually created and destroyed locally on the stack instead of being kept alive on a larger scope. You should also always check the result of methods such as wxBitmap::LoadFile(). Additionally, drawing someting outside of the paint event handler can lead to unexpected results, such as the window content being drawn over in the paint event...
PB wrote:In addition to what David said:
No I have no the skill in order to do that, I just get, to a page in the google search, that said, this function and GetDirectory(), weren't working in Fedora and Gnome, with the culprit, in some kind of gtk version, a really deep explanation to advanced for me, to understand or follow.