How to convert a number to hex number?

2005-11-08 Thread Hako
I try this command:
>>> import string
>>> string.atoi('78',16)
120
this is 120 not 4E.

Someone can tell me how to convert a decimal number to hex number? Can
print A, B, C,DEF.
Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


How do I bind multiple Pmw.Balloon tooltip with Buttons to the same widget?

2005-11-11 Thread Hako
hi,

I find a code in FAQTs about how to bind a tooltip with a button.
FAQTs link
http://www.faqts.com/knowledge_base/view.phtml/aid/20565/fid/264

but not enough informatin for how to make multiple tooltip.

Someone can help me and show  a little example how it's done.


thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


How to set a wx.textctrl can editable or readonly?

2006-01-18 Thread Hako
Hello All,


I have  a function to set readonly or editable of a textctrl. I'd like
to make the textctrl initial set readonly and use other event funciton
to set editable of the textctrl but it always can editable. How to set
a textctrl can editable or readonly?

Any Ideas? (see short snippet below)
Thanks.
---
self.tcFirstName = wx.TextCtrl(id=wxID_FRAME1TCFIRSTNAME,
  name=u'tcFirstName', parent=self.panel2, pos=wx.Point(16,
32),
  size=wx.Size(168, 24), style=0, value=u'')
self.setForm()

def setForm(self):
  self.Readonly("ro")

def Readonly(self, flag):
if flag=="ro":
self.tcFirstName.style=wx.TE_READONLY
self.tcFirstName.Refresh()

self.tcFirstName.SetBackgroundColour(self.panel1.GetBackgroundColour())

else:
self.tcFirstName.style=0
self.tcFirstName.Refresh()
self.tcFirstName.SetBackgroundColour((255,255,255))

# Other event function set textctrl can editable
def OnBAddButton(self, event):
self.Readonly("o")
---
end

-- 
http://mail.python.org/mailman/listinfo/python-list