Re: wxGlade tutorial

Peter Bradley <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
El 14/11/17 a las 23:03, Dietmar Schwertberger escribió:
> Hi Peter!
>
> On 11/13/2017 11:56 PM, Peter Bradley wrote:
>>
>> I have been trying to follow the wxGlade tutorial.  With some 
>> difficulty I got some generated code that looked as though it would 
>> be OK, but when I tried to run it, I got the following error from 
>> Python3:
>>
>
>> NameError: name '_' is not defined
>>
> Please deactivate Application -> Properties -> "Enable gettext support".
> Then, there should be no translation calls _("...") for all the 
> strings any more.
> I will make this the default with the next update. If anyone doesn't 
> know about gettext, then he/she probably doesn't need or want it anyway.
>

Hi Dietmar:

I think this (the above) must only be the case on more recent versions 
than the one I have.  I am using version 0.7.2 from the Ubuntu 17.10 
repository.  There is certainly no option like this on my version.

>
> The application code that was generated by wxGlade should have 
> included gettext support, though, which would have replaced the 
> underscore with the appropriate function call:
>
> *import gettext*
> ....
>
> if __name__ == "__main__":
> *gettext.install("app")* # replace with the appropriate catalog name
>
>     app = MyApp(0)
>     app.MainLoop()
>
>

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.7.2 on Mon Nov 13 22:10:36 2017
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class TutorialFrame(wx.Frame):
     ...


> I'm still working on the documentation. Please continue to report the 
> issues that you observe. I'm very interested in having a smooth user 
> experience for people who are new to wxGlade and / or wxPython.
>

Will do.  I always feel I'm being bit picky, so your encouragement is 
valuable.

> The crashes that you observed: please report the traceback and / or 
> describe how to reproduce it.
> If there's a Python traceback, then there's a problem in the program 
> logic. That should be easy to fix.
> If it's a hard crash, then it's probably a bit more difficult to track 
> down and fix.
>

When it crashes, it closes all windows.  But I'll try starting it from a 
terminal in future and we'll see what we get.  Absolutely no crashes at 
all if experience is any guide! :)

Best regards


Peter
-- 

*Peter Bradley*

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general
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.