Re: What is the correct way to response to the wxEVT_DPI_CHANGED event?

AsmWarrior <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Sunday, April 2, 2023 at 8:06:24 PM UTC+8 Maarten Bent wrote:

Hi,

Using 0 as the window parameter will indeed cause it to use the DPI of the 
main display.
I think I couldn't reproduce because I moved FromDIP(wxSize(250,50)); 
(without the 0) to a separate line so I could debug the return values.

You are allowed to call FromDIP/ToDIP with a nullptr window, wxWidgets 
internally does it too.
So I'm not sure if something like wxLogDebug("Determining DPI without a 
valid wxWindow"); can be added.

Maarten


Hi,  Maarten, thanks for the reply.
Indeed, a C++ statement has too many braces may cause errors, so it is more 
safe to changed some sub-function calls to a separate line.
Also, I think the wxLogDebug message is OK, and it could avoid some kinds 
of error like I did.

Asmwarrior

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/e29f567f-37f7-4f28-a7d5-4663e496adean%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.