rushabhshah10 / opennero

Automatically exported from code.google.com/p/opennero
Other
0 stars 0 forks source link

Allow external graphical user interface(s) (GUIs) such as wxPython #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Irrlicht GUI is limited and difficult to use, either from our C++ code or from 
Python. In particular, it covers up the 3D graphics window's real-estate, looks 
ugly and does not allow us to use nice native widgets such as file dialogs.

In order to address this, we would like to allow people to easily use other GUI 
tools such as wxPython or Tkinter. Adam is working on providing a working 
example of doing this in the NERO mod. This work is done under the 
source:/branches/menu

Original issue reported on code.google.com by ikarpov on 8 Jul 2010 at 7:29

GoogleCodeExporter commented 9 years ago
Implemented in /branches/menu, still needs to be tested thoroughly.

Original comment by AdamDz...@gmail.com on 21 Jul 2010 at 2:23

GoogleCodeExporter commented 9 years ago
Changed status, we still need a review of /branches/menu

Original comment by AdamDz...@gmail.com on 21 Jul 2010 at 7:00

GoogleCodeExporter commented 9 years ago
When testing on the Mac:

 * Start OpenNERO
 * Start NERO mod
 * Click "Deploy"{{{
  File "./NERO/NeroEnvironment.py", line 244, in step
    r.flush()
IOError: [Errno 9] Bad file descriptor}}}
 * If I try to run menu.py separately, I get: {{{
Traceback (most recent call last):
  File "mods/NERO/menu.py", line 261, in <module>
    panel = NeroPanel(frame)
  File "mods/NERO/menu.py", line 29, in __init__
    grid.Add(self.load,pos = (0,0))
  File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode/wx/_core.py", line 13968, in Add
wx._core.PyAssertionError: C++ assertion "!CheckForIntersection(item)" failed 
at ../src/common/gbsizer.cpp(225) in Add(): An item is already at that 
position}}}
, which is probably the cause of the problem.

Original comment by ikarpov on 16 Aug 2010 at 7:49

GoogleCodeExporter commented 9 years ago
So this looks like a problem with wxpython. I'll check it on another machine, 
but I'm guessing this is an incompatibility issue with the mac version of 
wxpython. I'll look into it on Windows, hopefully it's just a broken function.

Original comment by AdamDz...@gmail.com on 17 Aug 2010 at 5:09

GoogleCodeExporter commented 9 years ago
This was just incorrect usage of the GridBagSizer. For this sizer, pos=(r,c) 
specifies the row and column the widget should be placed. Only one widget can 
be specified per cell including room for spans. 

Additionally, size and position do not need to be specified in the widget 
constructors as they will be replaced by grid bag constraints, unless the 
widgets need to be larger than default (such as is the case for the scroll 
bars).

Finally, the sizer needs to be set for the container in order to have effect.

Revision #451 addresses this issue on the menu branch and the menu now works on 
the Mac. Please verify that this works as before and reassign to me for final 
merge.

Original comment by ikarpov on 19 Aug 2010 at 6:17

GoogleCodeExporter commented 9 years ago
Tested the code, fixed a minor issue (Lifetime slider not working) and it 
should be working right now.

Reassigning to ikarpov for final merge. 

Original comment by AdamDz...@gmail.com on 30 Aug 2010 at 2:19

GoogleCodeExporter commented 9 years ago
Actually, since this branch has been merged with /nero we can actually just 
delete this branch after the current state of nero is merged into trunk. This 
is better than merging in menu because I'm catching a whole lot of interesting 
errors from the merge process, so let's just not merge this into trunk.

Original comment by AdamDz...@gmail.com on 1 Sep 2010 at 7:50

GoogleCodeExporter commented 9 years ago
While I can merge the menu branch into the trunk (after fixing a small conflict 
in module.py) I see a runtime error when attempting to use the menu.

Steps to recreate:

 1. Start NERO mod
 2. Click Deloy within the OpenNERO window
 3. Adjust the flag fitness slider to up.
 4. BSOD with error about r being an invalid file handle.

Does this also happen on /branches/nero? If not, what is the range of revisions 
that should be merged into trunk from that branch?

Original comment by ikarpov on 1 Sep 2010 at 12:59

GoogleCodeExporter commented 9 years ago

Original comment by ikarpov on 9 Sep 2010 at 11:37