lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] GTK diagnostics


From: Vadim Zeitlin
Subject: Re: [lmi] GTK diagnostics
Date: Mon, 9 May 2022 15:27:59 +0200

On Sat, 7 May 2022 16:28:35 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> On 5/7/22 14:28, Vadim Zeitlin wrote:
[...]
GC> > or about GtkSpinButton?
GC> 
GC> I saw seventy-one repeats of the GtkSpinButton diagnostic.

 I've looked at them now and this is actually not due to any problems in wx
but, again, due to hardcoding too small sizes for the controls. As we've
already discussed in the past, this is wrong, and not because it results in
these diagnostics, but because it makes the controls too small to be usable
as can be seen by looking at the ones in the illustration parameters dialog:
most of them, e.g. the year/age ones on the "Solve" page or the issue and
retirement age ones on the "Client" page don't show the "+" button, but the
issue age on the "Riders" page doesn't show neither "-" nor "+" one.

 The fix is the same as before, and should probably have been part of
caee09caa (Remove invalid spinctrl sizes, 2020-07-24), i.e. just remove all
the hard-coded sizes. This time I've removed all of them for wxSpinCtrl
and, also, for wxDatePickerCtrl, as using them could result in similar
problems in the future and it seems safer to avoid them preemptively, even
if I don't see any problems due to hard-coding their sizes yet. The results
are at https://github.com/let-me-illustrate/lmi/pull/205 or, if you prefer,
in the (single) commit on xanadu/xrc-remove-hardcoded-spin-date-ctrl-sizes
branch. If you merge/cherry-pick this commit, you shouldn't be seeing these
71 messages any longer -- and, more importantly, you should be able to use
the spin controls increment and decrement buttons.

 Please let me know if you see any problems with this change, e.g. if you'd
prefer to avoid touching wxDatePickerCtrl sizes. Personally I'd rather also
remove the other hard-coded sizes, but AFAICS most of the remaining ones
are for wxTextCtrls and wxComboBoxes, where they're acceptable (even if not
ideal, as it would be better to express their minimal sizes in terms of
average character widths rather than fix their size in pixels), so it's not
very urgent. I did see a couple of hard-coded wxCheckBox sizes too, but I
didn't dare removing them as this seemed to have been done intentionally.

GC> GTKSuppressDiagnostics() seems too brutal: AIUI, it would inhibit any
GC> new and interesting diagnostics that we'd really want to be aware of.

 Yes, this is correct, and also the reason why I'd prefer not to use it.

GC> > GC> (lmi_wx_shared:3263143): Gtk-WARNING **: 08:40:36.299: Drawing a 
gadget with negative dimensions. Did you forget to allocate a size? (node tab 
owner GtkNotebook)
GC> > GC> 
GC> > GC> (lmi_wx_shared:3263143): Gtk-CRITICAL **: 08:40:36.317: 
gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
GC> > GC> 
GC> > GC> (lmi_wx_shared:3263143): Gtk-CRITICAL **: 08:40:36.318: 
gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
GC> > GC> 
GC> > GC> (lmi_wx_shared:3263143): Gtk-CRITICAL **: 08:40:36.445: 
gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
GC> > 
GC> >  Those ones are suspicious, we shouldn't be using non-realized widgets and
GC> > I'd like to debug this to see what's really going on here.
GC> 
GC> Good, thanks.

 I didn't manage to reproduce these ones yet but OTOH I do see a bunch of

(lmi_wx:1471031): Gtk-CRITICAL **: 02:55:42.450: gtk_notebook_get_tab_label: 
assertion 'list != NULL' failed

when dismissing the illustration parameters dialog. I'm still looking at
those, but wanted to ask, in the meanwhile, if there is something specific
that I need to do to trigger the messages above?


GC> >  To summarize, I'd like to ask you several questions:
GC> > 
GC> > 1. Could we replace lmi "Window" menu with the standard wx one?
GC> 
GC> If we touch it in any way, we may introduce a defect. I see no
GC> upside, only downside.

 A potential upside could be better system integration, but MDI is not used
even under MSW any more and GTK doesn't have a system "Window" menu in the
first place, so in practice this point is moot.

GC> > 2. If not, should I make a patch using platform="win" avoiding the
GC> >    warnings under GTK? And, if yes, would you like it now or can it
GC> >    wait until the wx upgrade, as I'd like to add support for "!msw"
GC> >    too then.
GC> 
GC> Thanks, but I've done it already.

 What did you do for "!msw" case? Just platform="unix"?

GC> > 3. Are you find with using GTKSuppressDiagnostics()
GC> 
GC> No, I'd much rather not turn off all GTK diagnostics.

 Thanks for confirming this (and I should really stop misspelling "fine" as
"find", sorry).

 Best regards,
VZ

Attachment: pgpHDNnkbDkUQ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]