MDI code example - not fully working under Linux

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.
Post Reply
Paul99
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Jun 26, 2020 10:09 am

MDI code example - not fully working under Linux

Post by Paul99 » Fri Jun 26, 2020 10:40 am

Hi, I'm trying to start writing my first ever cross platform GUI and downloaded wxwidgets 3.1.3 - for use on Windows 10 and Linux (Centos 8).
I built the mdi.cpp example program provided and it works fine under windows - but under linux the drawing events inside the code here...

// This implements a tiny doodling program! Drag the mouse using the left
// button.
void MyCanvas::OnEvent(wxMouseEvent& event)

don't get rendered to the screen under the Linux build.

As this example has been around for a long time - it seems unlikely it doesn't work! Any suggestions would be appreciated!
Thanks.

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: MDI code example - not fully working under Linux

Post by DavidHart » Fri Jun 26, 2020 10:49 am

Hi,

I've not (yet) tested the sample here, but: why use MDI nowadays?

For a less-antique near equivalent, have a look at the 'aui' sample.

Regards,

David

Paul99
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Jun 26, 2020 10:09 am

Re: MDI code example - not fully working under Linux

Post by Paul99 » Fri Jun 26, 2020 3:07 pm

Thanks for the suggestion - I've looked at that aui example and it looks pretty impressive!

If you do get round to looking at the mdi problem I was having it would be good to know if you can replicate the issue.

Regards,

Paul

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: MDI code example - not fully working under Linux

Post by DavidHart » Fri Jun 26, 2020 4:27 pm

IIUC what you were testing the (draw-on-the-screen facility) it works for me, in both GTK+2 and +3 builds of wx3.0.5.
Which wx version did you use?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4257
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: MDI code example - not fully working under Linux

Post by ONEEYEMAN » Fri Jun 26, 2020 4:44 pm

Hi,
Couple more questions:

1. What is an exact GTK+ version?
2. What OS/WM do you use?
3. Are you using any theme?

Thank you.

Paul99
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Jun 26, 2020 10:09 am

Re: MDI code example - not fully working under Linux

Post by Paul99 » Sat Jun 27, 2020 9:28 am

Yes it is the draw on screen facility...

wxwidgets 3.1.3

Centos 8

I tried compiling wxwidgets with gtk2 and gtk3

I'm not sure about the theme... none that I am aware of! Sorry I'm used to Windows programming.

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: MDI code example - not fully working under Linux

Post by DavidHart » Sat Jun 27, 2020 11:38 am

Retesting with 3.1.3, it still works. (debian buster, LXQT).

.
mdi.png
mdi.png (28.09 KiB) Viewed 273 times

However I did notice that the writing doesn't persist: add another child window, or switch to a different program and back, and the lines have disappeared. That's because it's painting on a wxClientDC, not a wxPaintDC in a paintevent handler. Perhaps your DE is somehow causing instant refreshes...

Paul99
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Jun 26, 2020 10:09 am

Re: MDI code example - not fully working under Linux

Post by Paul99 » Sat Jun 27, 2020 12:57 pm

Ok. Thanks very much for trying that. I'll stop worrying about it! There is plenty more for me to get my head around!

I appreciate the effort you have gone to.

Cheers, Paul

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4257
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: MDI code example - not fully working under Linux

Post by ONEEYEMAN » Sun Jun 28, 2020 5:16 am

Hi,
You probably using Wayland and not the X Server for the backend...

Thank you.

Paul99
In need of some credit
In need of some credit
Posts: 5
Joined: Fri Jun 26, 2020 10:09 am

Re: MDI code example - not fully working under Linux

Post by Paul99 » Mon Jun 29, 2020 8:04 am

Yes! That did it - thanks. I've never heard of this Weyland thing before...

Post Reply