Hey Che!
Thanks for your reply. The transient popupwindow is perfect!
I don’t know if my testcase is that small but here goes:
import wx
class AccountSummary(wx.Frame):
def __init__(self, parent_gui):
account_msg_data = {2: {'status': (0, 1),
'unread_msgs': [('<9093C25DA17C4BAA94E25B292384F31C@doublep>', 'atencion@atumesa.com', 'Encuesta de Calidad en el Servicio #571752'),
('<16416556e463ee5e0d983d75d5382e52@localhost.localdomain>', 'Facebook', u'Anakaren Berenice Chac\xf3n Espinosa invited you to the event "- My 20 winters -"...'),
('<6e9381670811111143r3e624200o70e7d4078fd57624@mail.gmail.com>', 'Elena Jimenez', u'conversaci\xf3n coloquial'),
('<48D3DD280068138B@mailserver2.itesm.mx> (added by\r\n postmaster@itesm.mx)', 'Lic. Marcelo Bravo', 'IMPORTANTE: Jueves - Thursday GENERATION PHOTO')],
'account_name': u'xxxxx@gmail.com',
'check_time': (2008, 11, 12, 3, 46, 50, 2, 317, 0)}}
wx.Frame.__init__(self, None, -1, "Account summary", style = wx.FRAME_NO_TASKBAR | wx.CAPTION | wx.STAY_ON_TOP | wx.CLOSE_BOX )
panel_back = wx.Panel(self)
vbox_back = wx.BoxSizer(wx.VERTICAL)
self.account_name_font = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT )
self.account_name_font.SetPointSize(self.account_name_font.GetPointSize() + 2)
self.account_name_font.SetWeight(wx.BOLD)
self.account_bg_color = wx.Color(240, 240, 170)
self.msg_bg_color = wx.Color(240, 240, 120)
self.sender_name_font = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT )
self.sender_name_font.SetWeight(wx.BOLD)
self.account_controls = {}
for account in account_msg_data.values():
vbox = wx.BoxSizer(wx.VERTICAL)
account_name_panel = wx.Panel(panel_back)
account_name_panel.SetBackgroundColour(self.account_bg_color)
account_name = len(account["account_name"]) > 45 and account["account_name"][:42] + "...:" or account["account_name"] + ":"
account_name_label = wx.StaticText(account_name_panel, -1, account_name)
account_name_label.SetFont(self.account_name_font)
vbox.Add(account_name_panel, 0, wx.EXPAND)
for msg in account["unread_msgs"]:
hbox = wx.BoxSizer(wx.HORIZONTAL)
msg_panel = wx.Panel(panel_back)
msg_panel.SetBackgroundColour(self.msg_bg_color)
sender_name = len(msg[0]) > 24 and msg[1][:21] + "..." or msg[1]
sender_name_label = wx.StaticText(msg_panel, -1, sender_name)
sender_name_label.SetFont(self.sender_name_font)
label = wx.StaticText(msg_panel, -1, ":")
label.SetFont(self.sender_name_font)
subject_label = wx.StaticText(msg_panel, -1, msg[2])
hbox.Add(sender_name_label, 1, wx.TOP | wx.LEFT, 3)
hbox.Add(label, 0, wx.TOP | wx.RIGHT, 3)
hbox.Add(subject_label, 1, wx.LEFT | wx.TOP, 3)
msg_panel.SetSizer(hbox)
vbox.Add(msg_panel, 0, wx.EXPAND)
vbox_back.Add(vbox, 1, wx.EXPAND)
panel_back.SetSizer(vbox_back)
self.SetMaxSize((350, -1))
self.SetMinSize((350, -1))
panel_back.SetMaxSize((350, -1))
vbox_back.Layout()
size = vbox_back.GetMinSize()
self.SetClientSize(size)
if name == “main”:
app = wx.PySimpleApp()
frame = AccountSummary(None)
frame.Show()
app.MainLoop()
thanks!
//T