Opened 2 years ago

Closed 2 years ago

#3201 closed defect (fixed)

wxGUI nviz: resolution settings widget broken in wxPython 3

Reported by: neteler Owned by: grass-dev@…
Priority: critical Milestone: 7.2.0
Component: wxGUI Version: svn-releasebranch72
Keywords: nviz Cc:
CPU: Unspecified Platform: Linux

Description

At time it is not possible to adjust drawing options at all... This renders nviz rather unusable.

Attachments (4)

wxgui_nviz_wxpython3_0_2.png (61.7 KB) - added by neteler 2 years ago.
wxpython 3 generated resolution widget
spinctrl.diff (1.1 KB) - added by annakrat 2 years ago.
Increase SpinCtrl? size
wxgui_nviz_wxpython3_0_2_patched.png (71.7 KB) - added by neteler 2 years ago.
wxGUI-nviz after patch
gtk3.diff (55.4 KB) - added by annakrat 2 years ago.
fix SpinCtrl? for gtk3

Download all attachments as: .zip

Change History (17)

Changed 2 years ago by neteler

wxpython 3 generated resolution widget

comment:1 Changed 2 years ago by neteler

I restarted the session to switch from my own to the NC data set and the widget was no longer greyed out (screenshot). This time not broken but yet not correctly rendered.. and in the terminal I get tons of

...
(wxgui.py:22073): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton

(wxgui.py:22073): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton

(wxgui.py:22073): Gtk-WARNING **: Negative content width -17 (allocation 1, extents 9x9) while allocating gadget (node entry, owner GtkEntry)

(wxgui.py:22073): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton

(wxgui.py:22073): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkSpinButton
...

Perhaps the GtkSpinButton() definition changed somehow in wxPython3?

Maybe the same as here? https://bugzilla.redhat.com/show_bug.cgi?id=1371036

Last edited 2 years ago by neteler (previous) (diff)

comment:2 Changed 2 years ago by annakrat

It looks normal on Ubuntu. Let's see if they reply, it looks like the same problem. You can also try the wxpython demo, I don't understand if all wx.SpinCtrls? are messed up or if it depends somehow on the surrounding widgets. Does this happen in trunk, too?

comment:3 Changed 2 years ago by neteler

Here the patch of the other project for inspection:

http://pkgs.fedoraproject.org/cgit/rpms/printrun.git/tree/printrun-gtk3.patch

Changed 2 years ago by annakrat

Attachment: spinctrl.diff added

Increase SpinCtrl? size

comment:4 Changed 2 years ago by annakrat

Could you try the attached diff? It just increases the size of SpinCtrl?, since that what they had in that patch.

Changed 2 years ago by neteler

wxGUI-nviz after patch

comment:5 Changed 2 years ago by neteler

The patch helps for Fine mode/coarse mode, thanks. So it seems to be the way to go.

Out of size are still

  • Under Surface: Transparency + Shininess
  • Under "Constant surface", all three SpinCtrls?
  • Under "Vector" Line width + Icon size
  • Under isosurface attributes: Transparency + Shininess
  • Under Fringe: Elevation from bottom
  • Under Animation: Frame rate

comment:6 in reply to:  5 Changed 2 years ago by annakrat

Replying to neteler:

The patch helps for Fine mode/coarse mode, thanks. So it seems to be the way to go.

Out of size are still

  • Under Surface: Transparency + Shininess
  • Under "Constant surface", all three SpinCtrls?
  • Under "Vector" Line width + Icon size
  • Under isosurface attributes: Transparency + Shininess
  • Under Fringe: Elevation from bottom
  • Under Animation: Frame rate

and probably more. This issue applies to almost all SpinCtrls? in different parts of GUI (dialogs, attribute table manager, ...), right? So all these have to be changed. Could you find the minimum size which works for your platform? The problem is, it's way to big for all other platforms, so ideally this would be applied only to your platform, but I need to recognize it in the code somehow.

comment:7 Changed 2 years ago by neteler

Below the update from the Fedora packager of wxPython3:

On 11/07/2016 03:00 PM, bugzilla @ redhat.com wrote: Comment 9 from Scott Talbert

https://bugzilla.redhat.com/show_bug.cgi?id=1371036

markusN wrote:

It seems that the solution for GRASS GIS would be the same, to make the SpinButtons? bigger: https://trac.osgeo.org/grass/attachment/ticket/3201/spinctrl.diff

The issue is: if all projects using SpinCtrl? have to change their button sizes, wouldn't it be better to fix Fedora's wxPython3 package? Our developers on Ubuntu do not have such issues.

The SpinButton sizing thing cannot be fixed in wxPython - it has to be fixed in individual applications. This is really a problem because the underlying GTK SpinButton widget is much wider in GTK+3 than it is in GTK+2.

Compare these two and you will see the problem:

The reason you do not see it under Ubuntu is that Ubuntu's wxPython package still uses GTK+2.

Changed 2 years ago by annakrat

Attachment: gtk3.diff added

fix SpinCtrl? for gtk3

comment:8 Changed 2 years ago by annakrat

Please try the attachment if it does anything for you.

comment:9 in reply to:  8 Changed 2 years ago by neteler

Replying to annakrat:

Please try the attachment if it does anything for you.

Yes, Anna, this is just great, the SpinButtons are usable again with the patch.

I'd suggest to backport it right away after having updated trunk. Thanks!

comment:10 Changed 2 years ago by annakrat

In 69790:

wxGUI: change size of wx.SpinCtrl? for gtk3, see #3201

comment:11 Changed 2 years ago by annakrat

In 69791:

wxGUI: change size of wx.SpinCtrl? for gtk3, see #3201 (merge from trunk, r69790)

comment:12 Changed 2 years ago by annakrat

I suggest to test more before closing.

comment:13 Changed 2 years ago by annakrat

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.