Hello Michael,
something like this may work reasonably well:
import wx
import wx.lib.buttons as buttons
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, size=wx.Size(300,300))
panel = wx.Panel(self)
label = "Ask"
button = buttons.GenButton(panel, -1, label, pos=(30,30))
button.SetUseFocusIndicator(False)
button.SetBezelWidth(2)
font = button.GetFont()
font.SetWeight(wx.BOLD)
button.SetFont(font)
dc = wx.ClientDC(self)
dc.SetFont(font)
w, h = dc.GetTextExtent(label)
button.SetSize((w+5, h+5))
app = wx.PySimpleApp()
frame = MyFrame(None)
frame.Show()
app.MainLoop()
You can adjust the (w+5, h+5) to fit better your needs, I just put them there because the button has a bezel width of 2 pixels.
HTH.
Andrea.
···
_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London
Direct Tel: +44 (0) 20 717 08936
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
-----Original Message-----
From: Michael Hipp [mailto:Michael@Hipp.com]
Sent: 13 April 2006 14:19
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] Tiny buttonsSimilarly to the attached screen snippet, is there a way in
wxPython to draw really small crowded buttons like that "Ask" button?It's from QuickBooks, BTW.
Michael