Repaint is released again after ...

Just starting out? Need help? Post your questions and find answers here.
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Repaint is released again after ...

Post by Joris »

Hi,

Where does the repaint need to be placed to work like should ?

Thanks.

Code: Select all

Global.i Window_0
Procedure OpenWindow_0(x = 0, y = 0, width = 730, height = 660)
 
  Window_0 = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, width, height, "", #PB_Window_SystemMenu |#PB_Window_ScreenCentered)
 
  ContainerGadget(#PB_Any,  8, 320, 325, 60)
  Upd_H = SpinGadget(#PB_Any,   8, 10, 46, 22, 1,width/2,#PB_Spin_ReadOnly | #PB_Spin_Numeric)
  TextGadget(#PB_Any, 60, 10, 28, 18,  "Width")
  Upd_spc = SpinGadget(#PB_Any, 92,10, 46, 22, 0,100,#PB_Spin_ReadOnly | #PB_Spin_Numeric)
  TextGadget(#PB_Any, 144, 10, 66, 18,"Space / Parts") 
  Upd_prt= SpinGadget(#PB_Any,  216, 10, 46, 22, 0,height,#PB_Spin_ReadOnly | #PB_Spin_Numeric)
  txt_klr=TextGadget(#PB_Any, 274,10, 40, 22,"0",#PB_Text_Border|#PB_Text_Center) 
  btn_rdw = ButtonGadget(#PB_Any, 56,36, 135, 24, "Draw Fader"  )
  chk_test = CheckBoxGadget(#PB_Any, 216, 36, 75, 24, "and Test" )
  CloseGadgetList()
 
  Canvas_0 = CanvasGadget(#PB_Any, x, y, 330, 320)  ;, #PB_Canvas_Border   )
  Canvas_1 = CanvasGadget(#PB_Any,335, y, 385, 320)
  Canvas_2 = CanvasGadget(#PB_Any,335, 325, 385, height)
 
  Frame_1 = FrameGadget(#PB_Any, 120, 384, 196, 194,"Colors")
  ContainerGadget(#PB_Any, 126, 400, 175, 170)

  chk_VH = CheckBoxGadget(#PB_Any, 8,  140, 60, 18, "V H"  )
  chk_Label = CheckBoxGadget(#PB_Any, 8+90,  20, 60, 18, "Label")
  chk_Boxed = CheckBoxGadget(#PB_Any, 8+90,  140, 60, 18, "Boxed")

  CloseGadgetList()
 
  Frame_0 = FrameGadget(#PB_Any, 10, 384, 100, 194,"Fader Type")
  ContainerGadget(#PB_Any, 15, 400, 90, 170)
  Opt_E = OptionGadget(#PB_Any, 8, 000, 60, 20, "E...") 
  Opt_L = OptionGadget(#PB_Any, 8, 020, 80, 20, "L...")
  Opt_B = OptionGadget(#PB_Any, 8, 040, 80, 20, "B...")
  Opt_G = OptionGadget(#PB_Any, 8, 060, 80, 20, "G...")
  Opt_C = OptionGadget(#PB_Any, 8, 080, 80, 20, "C...")
  Opt_M = OptionGadget(#PB_Any, 8, 100, 80, 20, "M...")
  Opt_P = OptionGadget(#PB_Any, 8, 120, 80, 20, "P...")
  Opt_S = OptionGadget(#PB_Any, 8, 140, 80, 20, "S...")
  CloseGadgetList()
 
  Frame_4 = FrameGadget(#PB_Any, 10, 580, 304, 50, "After Drawing")
  ContainerGadget(#PB_Any, 16, 598, 290, 30)
  BSaveData = ButtonGadget(#PB_Any, 4, 0, 120, 24, "Save Bitmap and Data")
  BclpBitmap = ButtonGadget(#PB_Any, 136, 0, 70, 24, "Copy Bitmap")
  BclpTekst = ButtonGadget(#PB_Any, 218, 0, 70, 24, "Copy Data")
  CloseGadgetList()
 
EndProcedure
Procedure Window_0_Events(event)
  
  Select event
    Case #PB_Event_Repaint, #PB_Event_MoveWindow, #PB_Event_ActivateWindow : 
      StartDrawing(WindowOutput(Window_0))      
      Box(200,400, 18, 118, $fff)
      StopDrawing()  
      
    Case #PB_Event_CloseWindow
      ProcedureReturn #False
    Case #PB_Event_Gadget
  EndSelect
  
  ProcedureReturn #True
 
EndProcedure
Procedure EventLoop()
   OpenWindow_0()
                 
   While Window_0_Events(WaitWindowEvent())
   Wend
 
EndProcedure
;************************************************************************
EventLoop()
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Repaint is released again after ...

Post by infratec »

What does 'work like should' mean for you?
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Repaint is released again after ...

Post by Joris »

If there is a window above this all (running) and removed, it becomes repaint but disappears directly.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Repaint is released again after ...

Post by infratec »

In my case, PB 5.72 x86 on Win10 x64, it works.
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Repaint is released again after ...

Post by Joris »

Yeah, i'm using (testing) this on XP still.
Maybe that's the only reason ?
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Repaint is released again after ...

Post by Joris »

If I remove all gadgets, the repaint works like should (on XP)... :lol:
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Repaint is released again after ...

Post by mk-soft »

Drawing on WindowOutput is not longer work perfectly. Some OS have change anything's.
Is always better to create an CanvasGadget and you can use Gadgets inside the Canvas (#PB_Canvas_Container)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply