[GRASS-dev] [GRASS GIS] #1378: Error when clicking 'Set Font' dialog in wxGUI settings

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
---------------------------------------------+------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: wxgui, font, set font, settings | Platform: Linux
      Cpu: x86-32 |
---------------------------------------------+------------------------------
Using Grass 6.5.svn, r46473:

Start Grass in the nc_basic_spm, then open the GUI settings dialog, next,
go to the Appearance tab and click 'Set Font', which should give the
following error:

{{{
Traceback (most recent call last):
   File "/usr/local/grass-6.5.svn/etc/wxpython/gui_modules/pr
eferences.py", line 2011, in OnSetOutputFont

type = 'outputfont')
   File "/usr/local/grass-6.5.svn/etc/wxpython/gui_modules/pr
eferences.py", line 2151, in __init__

self.spin.SetValue(self.fontsize)
   File "/usr/lib/python2.7/dist-
packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 2302, in
SetValue

return _controls_.SpinCtrl_SetValue(*args, **kwargs)
TypeError
:
in method 'SpinCtrl_SetValue', expected argument 2 of type
'int'

}}}

~ Eric.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378&gt;
GRASS GIS <http://grass.osgeo.org>

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
--------------------------------------+-------------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: wxGUI | Version: svn-develbranch6
Keywords: font, set font, settings | Platform: Linux
      Cpu: x86-32 |
--------------------------------------+-------------------------------------
Changes (by martinl):

* cc: martinl (added)
  * keywords: wxgui, font, set font, settings => font, set font, settings
  * milestone: 6.5.0 => 6.4.2

Comment:

I am unable to reproduce this error. Anyway this functionality is broken.
Before going on, I wonder

  * why to use custom dialog `preferences.DefaultFontDialog` instead of
`wx.FontDialog` (custom dialog make sense for map display, but not for
command output)
  * do we need customization of command output font?

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
--------------------------------------+-------------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: wxGUI | Version: svn-develbranch6
Keywords: font, set font, settings | Platform: Linux
      Cpu: x86-32 |
--------------------------------------+-------------------------------------

Comment(by epatton):

Thanks for looking into this; it's strange you can't reproduce, though.
Does this the labelling of features using the text select dialog work in
the other Grass versions (6.4, 7.0)?

~ Eric.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
--------------------------------------+-------------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: wxGUI | Version: svn-develbranch6
Keywords: font, set font, settings | Platform: Linux
      Cpu: x86-32 |
--------------------------------------+-------------------------------------

Comment(by cmbarton):

I can confirm this. To answer your questions Martin:

1) The custom dialog is needed because wx.FontDialog is broken on the Mac
--or at least it was up through wxPython 2.8.11.

2) It is indeed needed because the default is very tiny on the Mac--almost
unreadable.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
--------------------------------------+-------------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: wxGUI | Version: svn-develbranch6
Keywords: font, set font, settings | Platform: Linux
      Cpu: x86-32 |
--------------------------------------+-------------------------------------

Comment(by cmbarton):

I looked at this in 6.5 svn. As soon as I added a debug statement, the
font dialog popped up and saved OK. From then on it has been fine. I think
that perhaps this is caused by 1) a changed in the wxgrass settings file
(from "display" to "appearance" in the settings dictionary and 2) a lack
of error trap for the first time font setting is called with the new
format for .wxgrass. This can easily be fixed.

BUT...

I also found that the standard wxPython font dialog now works for the Mac
with wxPython stable 2.8.12. I left wxPython font dialog code in
preferences.py, commented out, when the standard font dialog broke. This
now works. So here is a question for you all. Do we: 1) simply add an
error trap to fix the custom font dialog that is being used right now (but
is partly broken), 2) replace the custom font dialog with the wxPython
standard one (i.e., uncomment out the code; this brings up a platform
specific font dialog), or 3) fix the custom dialog for the 6.x series
(thinking that not everyone with a Mac who compiles will have the newest
wxPython) and go back to the standard font dialog for GRASS 7.x?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1378: Error when clicking 'Set Font' dialog in wxGUI settings
--------------------------------------+-------------------------------------
Reporter: epatton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: wxGUI | Version: svn-develbranch6
Keywords: font, set font, settings | Platform: Linux
      Cpu: x86-32 |
--------------------------------------+-------------------------------------

Comment(by annakrat):

What's the current state? I found out that I was not able to change the
font in command output, so I fixed it in all branches (r53578, 53579,
r53580).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1378#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>