Coding in Boa

Roy
2011-11-13
2013-05-01
  • Roy
    Roy
    2011-11-13

    Hello,

    In the past I regularly programmed in Visual Basic v6.  On moving to Linux and
    web based development (PHP JavaScript) programming in the desktop sense faded
    away.  I am now remedying this by learning Python 3 and have come across Boa
    0.6.1 which looks a terrific RAD tool.

    Where I need help is in understanding how to use the methods.  For example I my
    first app I have a listbox which will hold the numbers 1 -31.  In VB it was of
    course listbox.additem etc and in it went.  Unfortunately not in Boa.  I have
    looked extensively in the help and browsed this forum but I am still not clear
    on how to achieve the intialisation of controls and how to add code triggered
    by an event to a control's code.  What is the way of doing this?

    Is it necessary to copy the constructor(s) in the wxwidgets list from the help
    into my code and insert the necessary parameters or code there?

    If anyone can suggest a suitable tutorial I would be grateful

    Thank you

    Roy

     
  • Hi Roy,

    First of all, you can not use Boa and wxPython which is the UI library used by Boa with Python 3.x, at least not yet.  You should probably use Python 2.6.x and wxPython 2.8.x for best results.

    There is a nice series of video's:
    http://showmedo.com/videotutorials/video?fromSeriesID=401&name=4010000

    There is also a very small tutorial in the help included with Boa.

    Basically when you click on a control in the Boa designer you see on the left in the Inspector window four tabs.  The "Evts" one is the one you are looking for, i.e. if you click on a button in the designer then under the "evts.ButtonEvent" tab you can double click on "wx.EVT_BUTTON" and it will create a "place holder" event handler when you save/post the session, you can then add your own code to the event handler using the code editor.

    You should also subscribe to the wxPython-user list as questions on how one uses a particular widget are probably better/quicker answered on there.

    Werner

     
  • Roy
    Roy
    2011-11-14

    Thank you Werner, your suggestions were most helpful.
    The videos were very good, especially the code completion etc tips for the editor.  I have also had a look at the tutorial in the wxWidgets project and I now get the overall picture.  A lot of work and reading to do but at the end of it there should be a RAD environment and a very usable language in Python that will substitute nicely for VB6.  Actually when I started reading the wxWidgets site it took me back to when I picked up Petzold's Programming Windows, here we go again maybe….

    Thanks for your help

    Roy

     
  • Roy,

    I am sure you will enjoy working with Python and wxPython.  The documentation on the later is a bit confusing to start with as a lot of it has its root in the wxWidgets C++ documentation, hopefully the Phoenix wxPython project (a re-write of it) will as more or less a side effect improve a lot on this.

    hope you have fun
    Werner

     
  • tarun
    tarun
    2012-07-01

    hey i want to know that i have created menu bar gui with boa constructor and now when i should click open option in menu bar how it will open open window explorer.