How to vertically align bitmaps with text baseline?

Within a horizontal BoxSizer How do I vertically align the
bottom of a StaticBitmap with the baseline of a StaticText?

IOW, what I want is:

···

_______
         > >
         > bitmap>
         > >
         >_______| Text
         
Calling hsizer.Add(...,flag=wx.ALIGN_BOTTOM) isn't the answer,
since that gives me somthing like this:

          _______
         > >
         > bitmap>
         > > Text
         >_______|

I presume it's aligning the bottom of the bitmap with the
bottom of a bounding box that includes room for descenders. I
don't want to vertically align things with the bottom of the
font's lowest bounding box, I want to align things with the
font's baseline.

Is this possible?

Is there a way to get a font's baseline to lower-bounding-box
offset and then offset the text position "manually"?

--
Grant Edwards grante Yow! ... this must be what
                                  at it's like to be a COLLEGE
                               visi.com GRADUATE!!

Within a horizontal BoxSizer How do I vertically align the
bottom of a StaticBitmap with the baseline of a StaticText?

[...]

Calling hsizer.Add(...,flag=wx.ALIGN_BOTTOM) isn't the answer,
since that gives me somthing like this:

          _______
         > >
         > bitmap>
         > > Text
         >_______|

I still haven't figured out a solution to this problem. Here's
a demo that demonstrates the problem:

#!/usr/bin/python
import wx
        
class ColWin(wx.Window):
    def __init__(self, parent, id, BackColour, pos=(-1,-1), size=(-1,-1)):
        wx.Window.__init__(self, parent, id, pos, size, wx.SIMPLE_BORDER)
        self.SetBackgroundColour(BackColour)

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title)
        panel = wx.Panel(self)
        vsizer = wx.BoxSizer(wx.VERTICAL)
        hsizer = wx.BoxSizer(wx.HORIZONTAL)
        hsizer.Add(ColWin(panel,-1,wx.GREEN,size=(30,30)),flag=wx.ALIGN_BOTTOM)
        hsizer.Add((20,-1),1)
        t = wx.StaticText(panel,-1,'FooBar')
        hsizer.Add(t,flag=wx.ALIGN_BOTTOM)
        t.SetFont(wx.Font(24,wx.DEFAULT,wx.NORMAL,wx.BOLD))
        hsizer.Add((20,-1),1)
        hsizer.Add(ColWin(panel,-1,wx.BLUE,size=(40,40)),flag=wx.ALIGN_BOTTOM)
        vsizer.Add(hsizer,1,flag=wx.ALL+wx.EXPAND,border=10)
        panel.SetSizerAndFit(vsizer)
        panel.Layout()
        vsizer.Fit(self)
        
class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, "Still Baffled by Sizers")
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
        
app = MyApp(False)
app.MainLoop()

···

On 2005-09-06, Grant Edwards <grante@visi.com> wrote:

--
Grant Edwards grante Yow! I think I'll do BOTH
                                  at if I can get RESIDUALS!!
                               visi.com