Any chance of adding wxCLOSE_BOX as a property for wx.frame? It seems to be missing (had to add it in manually).
Boa by default creates frames with "wx.DEFAULT_FRAME_STYLE" style which shows the close box. At least for me.
I am on:
# Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
# wxPython 220.127.116.11, Boa Constructor 0.4.4
What is your configuration?
As James said, wx.CLOSE_BOX is invisible in Inspector window. I also could not find a way to add it from IDE, only manually adding the string " | wx.CLOSE_BOX" to the generated code.
wx.DEFAULT_FRAME_STYLE is equal to "wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER |
wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX" by the way, which is the default frame created.
Caglar and James,
Either I don't understand what your problem is or I don't see in my setup.
What is your setup (OP system, versions of Python, wxPython and Boa)?
Can you post a small sample program showing the problem on the gmane list (as attachement please!).
My current configuration:
Boa Constructor 0.4.4
The context code:
def _init_ctrls(self, prnt):
# generated method, don't edit
name=u'frmSefilDownload', parent=prnt, pos=wx.Point(56, 80),
style=wx.SYSTEM_MENU | wx.SIMPLE_BORDER | wx.MINIMIZE_BOX | wx.MINIMIZE | wx.CAPTION | wx.STATIC_BORDER | wx.CLOSE_BOX,
The code above is generated by Boa Constructor, except wx.CLOSE_BOX, which I had to add manually.
Because it does not show up in Boa's Inspector Window, so I can not click on it.
To simulate the problem;
create a wx.Frame, its style will be wx.DEFAULT_FRAME_STYLE by default.
It will have a CLOSE_BOX too.
Then, set wx.DEFAULT_FRAME_STYLE as False and wx.STATIC_BORDER as True.
After this point, I could not see wx.CLOSE_BOX in Inspector Window to turn it on.
Other styles in the line
style=wx.SYSTEM_MENU | wx.SIMPLE_BORDER | wx.MINIMIZE_BOX | wx.MINIMIZE | wx.CAPTION | wx.STATIC_BORDER | wx.CLOSE_BOX
except wx.CLOSE_BOX are clickable, but you can not set wx.CLOSE_BOX to True since it does not show up in GUI Builder.
So, as a solution, I edited the generated line
style=wx.SYSTEM_MENU | wx.SIMPLE_BORDER | wx.MINIMIZE_BOX | wx.MINIMIZE | wx.CAPTION | wx.STATIC_BORDER,
and added "| wx.CLOSE_BOX" manually.
The problem is with Boa Constructor GUI Builder, not the code.
Thank you very much.
I just didn't understand, sorry.
If you just want to remove a style you might want to use:
style=wx.DEFAULT_FRAME_STYLE ^ wx.MINIMIZE_BOX
Note the "^".
Now to the real problem, will just have to tell Riaan off! He missed a style :).
If you want to patch Boa change on line 105 of FrameCompanions.py in Boa/Companions to:
self.windowStyles = ['wx.DEFAULT_FRAME_STYLE', 'wx.ICONIZE',
'wx.MINIMIZE', 'wx.MAXIMIZE', 'wx.STAY_ON_TOP', 'wx.SYSTEM_MENU',
'wx.FRAME_TOOL_WINDOW', 'wx.CLOSE_BOX '] + self.windowStyles
I.e. add wx.CLOSE_BOX, then restart Boa.
The above works, but I am not 100% sure if it is the best place to patch, but I am sure Riaan see this and correct me if I am wrong and/or apply it to the next version.
Thanks for the info about ^ in "style=wx.DEFAULT_FRAME_STYLE ^ wx.MINIMIZE_BOX", it is very useful. So I don't have to select 5-6 styles.
Also, I have changed the line 105 in FrameCompanions.py as you said, and it worked perfectly well. :)
Thanks four all your help and effort. :)
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.