I want to achieve a status bar with 2 fields. The first one left-aligned and the second one right-aligned. Illustration of what I want:
| | | | ================================================================================= | Some status text. v. 1.0.32 |
My current code:
self.CreateStatusBar(2)
self.SetStatusWidths([-1, -1])
But the right field is left aligned, so it looks like this:
| | | | ================================================================================= | Some status text. v. 1.0.32 |
Is there any way to get text in the right field to align to the right?
Ok, I’ve solved the problem (even though it feels like a hack.) I created a custom toolbar that defines two fields. The left field can be controlled like normal, and the right field contains a
StaticTextcontrol, containing the version number, that is manually positioned. The code for positioning the text is platform specific since it looked a tad different on windows. Here are some screenshots:Windows 7:
OSX 10.8.1 Mountain Lion:
Here is the code for the custom status bar:
This code is in my
Frame‘s constructor to create and place the status bar:And I added this function to my frame for easy status updates:
I hope this helps somebody else down the line.