Win32lib Tooltips problem

new topic     » topic index » view thread      » older message » newer message

Hi all,

Here is a problem with win32lib that I thought I would throw out to
everyone.  In the sample program included below, hints (tooltips) are set
for different buttons.  After about 150 hints have been displayed (say, by
going around and clicking different buttons with the mouse) you will get
this fatal error:

       EZCreateFont:SaveDC

Sometimes the error is slightly different (createCompatibleDC or something
like that).

I discovered this with win32lib .45b but also tried it on .45i which has
the same behavior.

A sample program that will cause the problem is included below.

I looked around a bit in win32lib to see what might cause the problem, but
since I'm not too sure even what DCs are, I didn't get too far.

Does anybody have an idea what might cause this or how to solve it?

--Brent



--sample program----------------------------------------------------------

include win32lib.ew -- David Cuny library

global constant
   EarTestX=623,
   EarTestY=421,
   EarTest =create(Window, "EarTest", 0,Default,Default,EarTestX,EarTestY,0)


constant NoteNames = {"C", "C#", "D", "Eb", "E", "F", "F#", "G", "Ab", "A",
"Bb", "B"}
integer xKey, yKey, yTxtKey
atom XSKey, YSKey
xKey = 10 --Keyboard, upperleftx
yKey = 10
yTxtKey = 354
XSKey = 290/200 --Keyboard, "stretch"
YSKey = 150/200

integer btC, btD, btE, btF, btG, btA, btB, btCs, btDs, btFs, btGs, btAs, btC2
sequence bts




   btC = create(PushButton, NoteNames [1], EarTest, xKey + XSKey *
(0),         yKey, XSKey*22, YSKey * 150, 0)
   btD = create(PushButton, NoteNames [3], EarTest, xKey + XSKey *
(38),        yKey, XSKey*22, YSKey * 150, 0)
   btE = create(PushButton, NoteNames [5], EarTest, xKey + XSKey *
(75),        yKey, XSKey*22, YSKey * 150, 0)
   btF = create(PushButton, NoteNames [6], EarTest, xKey + XSKey *
(97),        yKey, XSKey*22, YSKey * 150, 0)
   btG = create(PushButton, NoteNames [8], EarTest, xKey + XSKey *
(38+97),     yKey, XSKey*22, YSKey * 150, 0)
   btA = create(PushButton, NoteNames [10], EarTest, xKey + XSKey *
(75+97),     yKey, XSKey*22, YSKey * 150, 0)
   btB = create(PushButton, NoteNames [12], EarTest, xKey + XSKey *
(75+97+38),  yKey, XSKey*22, YSKey * 150, 0)
   btC2 = create(PushButton, NoteNames [1],EarTest, xKey + XSKey *
(75+97+60),  yKey, XSKey*22, YSKey * 150, 0)

   btCs = create(PushButton, NoteNames [2], EarTest, xKey + XSKey *
(20),       yKey, XSKey*20, YSKey * 120, 0)
   btDs = create(PushButton, NoteNames [4], EarTest, xKey + XSKey *
(58),       yKey, XSKey*20, YSKey * 120, 0)
   btFs = create(PushButton, NoteNames [7], EarTest, xKey + XSKey *
(20+97),    yKey, XSKey*20, YSKey * 120, 0)
   btGs = create(PushButton, NoteNames [9], EarTest, xKey + XSKey *
(58+97),    yKey, XSKey*20, YSKey * 120, 0)
   btAs = create(PushButton, NoteNames [11], EarTest, xKey + XSKey *
(58+97+38), yKey, XSKey*20, YSKey * 120, 0)

   bts= {btC, btD, btE, btF, btG, btA, btB, btCs, btDs, btFs, btGs, btAs,
btC2 }
   --set 0s
   for y = 1 to 13 do
      setHint( bts[y], "To answer, click here (or use Keyboard Shortcuts)")
   end for


WinMain(EarTest, Normal)


--end of sample






+++++++++++++++++++ Brent Hugh / bhugh at griffon.mwsc.edu ++++++++++++++++++
+   Missouri Western State College Dept of Music, St. Joseph, Missouri   +
+               Piano Home Page: http://www.mwsc.edu/~bhugh              +
+ Internet Piano Concert:  http://cctr.umkc.edu/userx/bhugh/recital.html +
++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu