Page 2 of 4

..

Posted: Mon Jun 28, 2004 4:44 pm
by NoahPhense
Sparkie wrote:I enable the XP eye candy because I want to see what others will see and it's my guess the average user (not programmer) has eye candy set high. :wink:
True true, I keep forgetting there are "others - out there"... lol

;)

- np

Posted: Mon Jun 28, 2004 6:20 pm
by GreenGiant
Surely instead of turning the refresh rate up it would make more sense to turn it down. Then the computer has more time to draw the window contents before it has to refresh. Or am I missing something?

Posted: Mon Jun 28, 2004 7:21 pm
by PolyVector
This isn't a refresh rate problem, I am sure of that...

If it was, all programs that don't impliment double-buffering would flicker...
I would think that anyone complaining of flicker problems would notice if their entire screen was going crazy :wink:

Posted: Mon Jun 28, 2004 8:16 pm
by Sparkie
This isn't a refresh rate problem, I am sure of that...
I'll agree with that. Four hours ago there was no flickering here on my work PC. I'm still on my work PC and I just tried the exact same code again, and now I get the same nasty flickering like my home PC.

I know for a fact there was no flickering this morning because I was amazed at the difference between my 2 pc's. 8O

Reboot and still flickering.

..

Posted: Mon Jun 28, 2004 9:37 pm
by NoahPhense
Sparkie wrote:
This isn't a refresh rate problem, I am sure of that...
I'll agree with that. Four hours ago there was no flickering here on my work PC. I'm still on my work PC and I just tried the exact same code again, and now I get the same nasty flickering like my home PC.

I know for a fact there was no flickering this morning because I was amazed at the difference between my 2 pc's. 8O

Reboot and still flickering.
Just tell people there's no extra charge for the flickering, oh, and add
a warning for epilepsy.

- np

Posted: Mon Jun 28, 2004 10:00 pm
by Paul
LOL @ NoahPhense

..

Posted: Mon Jun 28, 2004 10:05 pm
by NoahPhense
Paul wrote:LOL @ NoahPhense
Ok, now I'm being serious.. I'm running 3.91b2.. can someone share some
flickering code? I've tried to make mine flicker, but can't.

I'd really like share in this experience.

- np

Flicker 1.0 beta coming soon.

Posted: Mon Jun 28, 2004 10:29 pm
by Sparkie
I don't even need code to get the flickering at work now. All I have to do is resize my jaPBe or PB IDE window and I get the same results as the code from page 1 of this thread. :x

I've been fiddling with this @#?! computer for 2 hours trying to get it back to where it was. Problem is, I didn't make any changes to any settings. It just started flickering out of nowhere!!!

PB 3.91 B2
WinXP Home SP1

Re: ..

Posted: Mon Jun 28, 2004 10:37 pm
by tinman
NoahPhense wrote:Ok, now I'm being serious.. I'm running 3.91b2.. can someone share some flickering code? I've tried to make mine flicker, but can't.

I'd really like share in this experience.
Try the layout demo on my website. It's got mad ass slow resize calculations and resizes during window sizing and flickers like hell for me. Which is a pain because I don't want it to flicker :)

Posted: Mon Jun 28, 2004 11:23 pm
by PolyVector
It flickers here...

Also, it appears you're handling the WM_SIZING event instead of WM_SIZE....
Try turning off "show window contents while dragging" to see what I mean...

Posted: Mon Jun 28, 2004 11:40 pm
by thefool
it looks weird when sizing it, if you dont have the over bloated "show window content while dragging" function on.

Posted: Mon Jun 28, 2004 11:49 pm
by PolyVector
Exactly what I was saying... He's handling the WM_SIZING instead of WM_SIZE....

I have noticed one thing that's very consistant about the flickering (on XP Pro at least)... When I turn off visual styles and set it to classic mode, none of the programs mentioned in this thread flicker for me...
I'm going to look into this a little further... I did run accross some oddities in how (and which) messages are sent with XP Styles ON/OFF while working on my skin engine...

Posted: Mon Jun 28, 2004 11:52 pm
by tinman
PolyVector wrote:It flickers here...
That's the point, NoahPhense wants to see some flickering ;)
PolyVector wrote:Also, it appears you're handling the WM_SIZING event instead of WM_SIZE....
Try turning off "show window contents while dragging" to see what I mean...
Yes, that is what I am doing. I'd like the the UI to resize as the user drags the window (WM_SIZING), not when they stop (WM_SIZE). It must be possible, I've seen other applications do it (I guess my algorithms/code is just too slow). Working with WM_SIZE is a lot cleaner, but not the effect I am looking for.

Edit: yes, I see the difference now. Damn, why did I never notice that before? I've tested with both settings in the past and it's been OK. Grrr.

Posted: Tue Jun 29, 2004 12:03 am
by PolyVector
I do hope somebody can shed a little light on this flickering issue... It is very difficult to test my skin engine (with PB apps) when the windows flicker like this...

Posted: Tue Jun 29, 2004 12:32 am
by PolyVector
sorry for the double post :oops:
I think I know the problem.....
When the window is resized, it is automatically updated... Now The problem is that the gadgets are updated at the exact same time that your program decides to resize them (on the pb resize event)

To prevent this problem... simply add this line after every gadget resize
RedrawWindow_(GadgetID(GadgetNumber),0,0,#RDW_INTERNALPAINT|#RDW_UPDATENOW)

This is a less-than-elegant way of doing it, but I get very nice results...

Code: Select all

; 
; ------------------------------------------------------------ 
; 
;   PureBasic - Gadget example file 
; 
;    (c) 2003 - Fantaisie Software 
; 
; ------------------------------------------------------------ 
; 

#WindowWidth  = 640 
#WindowHeight = 480 


If OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget, "PureBasic - Gadget Demonstration") 
  
  If CreateGadgetList(WindowID()) 
    TextGadget(7, 10, 5, 700, 15, "PureBasic splitter demonstation with Editor, ScrollArea, ExplorerTree and Web gadgets. Feel the power...") 
    
    WebGadget(0, 10, 10, 300, 20, "http://www.purebasic.com") 
    
    EditorGadget(1, 115, 10, 100, 190) 
    For k=1 To 10 
      AddGadgetItem(1, k-1, "Line "+Str(k)) 
    Next 
    
    ExplorerTreeGadget(3, 115, 10, 100, 190, "", #PB_Explorer_AlwaysShowSelection|#PB_Explorer_FullRowSelect|#PB_Explorer_MultiSelect) 
    
    ScrollAreaGadget(6, 0, 0, 400, 400, 1000, 1000, 1) 
    ButtonGadget(20, 20, 20, 200, 200, "Scroll Area !") 
    CloseGadgetList() 
    
    SplitterGadget(2, 0, 0, #WindowWidth/2, #WindowHeight/2, 1, 0) 
    SplitterGadget(4, 0, 0, #WindowWidth, #WindowHeight, 3, 2, #PB_Splitter_Vertical) 
    SplitterGadget(5, 0, 25, #WindowWidth, #WindowHeight-25, 4, 6, #PB_Splitter_Vertical) 
    
    SetGadgetState(5, 500) 
  EndIf 
  
  
  Repeat 
    EventID = WaitWindowEvent() 
    
    If EventID = #PB_Event_Gadget 
      
      Select EventGadgetID() 
        
        Case 8 
          SetGadgetState(5, 333) 
          SetGadgetState(2, 333) 
          SetGadgetState(11, 5) 
          
        Case 20 
          Debug "ok" 
          
      EndSelect 
      
    ElseIf EventID = #PB_Event_SizeWindow 
      ResizeGadget(5, -1, -1, WindowWidth(), WindowHeight()-25) ; Our 'master' splitter gadget 
      
      ;-##########This is the only added line :)##########
      RedrawWindow_(GadgetID(5),0,0,#RDW_INTERNALPAINT|#RDW_UPDATENOW)    
      
      EndIf 
    
    
  Until EventID = #PB_EventCloseWindow 
  
EndIf 

End  
Maybe someone can improve on this idea? :D
There still seems to be the problem of gadgets not getting updated when they are not resized...look at the text-at-the-top while resizeing... It doesn't refresh...

Added: This technique doesn't seem to work in every situation... PB needs a built-in solution for this... It is a high-level language after all...