1. RE: CText not displaying

Hi Evan,

I'm not seeing a problem with setVisible.  What version of Win32Lib are 
you using?  Does this program work for you?

-- ctext.exw --
without warning
include Win32Lib.ew

constant
   Win = create(Window, "Click Window to toggle CText", 
                         0, Default, Default, 300, 100, 0 ),
   Msg = create(CText, "A CText Message", Win, 0, 20, 300, 20, 0),
   Stat = create(StatusBar,sprintf("Win32Lib Version %d.%d.%d",
                                   {Win32LibVersion[1],
                                    Win32LibVersion[2],
                                    Win32LibVersion[3]}), 
                           Win, 0, 0, 0, 0, 0 )
  
procedure onClick_Win()
   setVisible( Msg, not isVisible(Msg) )
end procedure
onClick[Win] = routine_id( "onClick_Win" )

WinMain(Win, Normal)
-- end program --

Are you sure your variable 'var' is not zero?
-- Brian

Evan Marshall wrote:
> Some CText is not displaying with setVisible.  I moved it so that part 
> of it
> covered another CText area that is working fine and it erased that area, 
> so
> I know it's "there".  Any ideas on why the text isn't showing up?  The
> attributes are all the same as every other CText I've got.
> 
> constant
> Win = create(Window, "Win", 0, 0, 0, 600, 600, Normal)
> Msg = create(CText, "Message", Win, 250, 300, 100, 20, 0)
> 
> 
> procedure Program()
>     setVisible(Msg, False)
>       .. do some stuff
>      if var then
>         setVisible(Msg, True)
>     end if
> end procedure
> onActivate[Win] = routine_id( "Program" )
> 
> WinMain(Win, Normal)

new topic     » topic index » view message » categorize

2. RE: CText not displaying

Evan Marshall wrote:
> Some CText is not displaying with setVisible.  I moved it so that part 
> of it
> covered another CText area that is working fine and it erased that area, 
> so
> I know it's "there".  Any ideas on why the text isn't showing up?  The
> attributes are all the same as every other CText I've got.
> 
> constant
> Win = create(Window, "Win", 0, 0, 0, 600, 600, Normal)
> Msg = create(CText, "Message", Win, 250, 300, 100, 20, 0)
> 
> 
> procedure Program()
>     setVisible(Msg, False)
>       .. do some stuff
>      if var then
>         setVisible(Msg, True)
>     end if
> end procedure
> onActivate[Win] = routine_id( "Program" )
> 
> WinMain(Win, Normal)
> 

Evan:
    Single line edit controls can ONLY be Left Aligned
    Center and right aligned will be ignored.
    ONLY multiline edit controls can use these.
Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: RE: CText not displaying

Brian,

Your program worked fine.  Like I said, just that one instance of CText is
not working.  I see the area where it  is supposed to be displayed (the
background), but the text itself is
not visible.  Nor is the background color.  Just the area is cleared of any
pre-existing label.

On setting up the program, I set it not visible so that it doesn't display
initially, then I set it visible  inside a function so that it displays upon
a certain condition.
If I do not set it to not visible initially, it displays just fine, only
constantly.

Using trace I can see that the instruction is executed.

win32lib.ew ver 0.55.0

Here is the actual procedure:


procedure HitOrMiss()
     integer k, count, p
     object hitSound, missSound
     --trace(1)
     if player = 1 then
          p = 2
     else
          p = 1
     end if
     if ShipOnSquare[player][Square] = 1 then
          copyBlt(PlayerUp[1], c, e, pmHit)
          copyBlt(PlayerUp[2], c, e, pmHit)
          hitSound = playSound("C:\\Euphoria\\boom.wav")
               for i = 1 to 5 do
                    for j = 1 to length(scores[p][i]) do
                         k = find(Square,scores[p][i][j])
                         if k then
                              count = 0
                              scores[p][i][j][k] = 0
                              for l = 1 to length(scores[p][i][j]) do
                                   if scores[p][i][j][l] = 0 then
                                        count += 1
                                        if count = length(scores[p][i][j])
then
                                             setVisible(sSankMsg ,
rue)  -------<<<<NOT SHOWING UP>>>>
                                             SunkShip[player] += 1
                                             exit
                                        end if
                                    exit
                                   end if
                              end for
                         end if
                    end for
               end for
     else
          copyBlt(PlayerUp[1], c, e, pmNo_Hit)
          copyBlt(PlayerUp[2], c, e, pmNo_Hit)
          missSound = playSound("C:\\Euphoria\\splash.wav")
     end if
    --trace(0)
end procedure

new topic     » goto parent     » topic index » view message » categorize

4. RE: CText not displaying

This works:
------------------------------
include win32lib.ew

constant 
Win  = create(Window, "Window", 0, 0, 0, 600, 600, Normal),
myCText = create(CText, "This is CText", Win,  250, 200, 100, 15, 0)

setVisible(myCText, False)

procedure Display()
      setVisible(myCText, True)
end procedure
onActivate[Win] = routine_id( "Display" )

procedure ClearText()
     setVisible(myCText, False)
end procedure
onClick[Win] = routine_id( "ClearText" )

WinMain(Win, Normal)

include win32lib.ew

constant 
Win  = create(Window, "Window", 0, 0, 0, 600, 600, Normal),
myCText = create(CText, "This is CText", Win,  250, 200, 100, 15, 0)

setVisible(myCText, False)

procedure Display()
      setVisible(myCText, True)
end procedure

procedure ClearText()
     Display()
     for t = 1 to 100000000 do end for
     setVisible(myCText, False)
end procedure
onActivate[Win] = routine_id( "ClearText" )

WinMain(Win, Normal)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu