Page 1 of 1
SmartWindowRefresh() vs. ImageGadget() / SetGadgetState()
Posted: Wed Oct 18, 2006 5:49 am
by nco2k
Code: Select all
If OpenWindow(0, 0, 0, 245, 105, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
SmartWindowRefresh(0, #True)
icon1 = ExtractIcon_(0, "shell32.dll", 8)
icon2 = ExtractIcon_(0, "shell32.dll", 6)
ImageGadget(0, 10, 10, 32, 32, icon1)
ButtonGadget(1, 10, 47, 100, 25, "Click")
icon = 1
Repeat
WinEvent = WaitWindowEvent()
If WinEvent = #PB_Event_Gadget And EventGadget() = 1
Select icon
Case 1
SetGadgetState(0, icon2)
icon = 2
Case 2
SetGadgetState(0, icon1)
icon = 1
EndSelect
EndIf
Until WinEvent = #PB_Event_CloseWindow
EndIf : End
c ya,
nco2k
Posted: Wed Oct 18, 2006 1:35 pm
by AND51
Na du? das Problem habe ich schon im german Forum angesprochen... Es wäre außerdem für nicht-eingeweihte hilfreich, würdest du ein kurzes Statement dazu abliefern.
@ all: nco2k is aiming at the window-refresh failing. I already discovered this bug in the german forum. There should be a workaround: Assign zero (0) to the
ImageGadget(), and the previosly showed Image should disappear (says the PB helpfile). But this does not work!!!!!

Posted: Wed Oct 18, 2006 4:39 pm
by Fluid Byte
Errrm...
The mighty manual wrote:Enable a smart way to refresh the window to reduce the flickering when resizing the window. If the window isn't resizable, the command isn't needed.
Simply disable smart refresh when you're not resizing the window.
Posted: Wed Oct 18, 2006 5:12 pm
by nco2k
Fluid Byte wrote:Errrm...
The mighty manual wrote:Enable a smart way to refresh the window to reduce the flickering when resizing the window. If the window isn't resizable, the command isn't needed.
Simply disable smart refresh when you're not resizing the window.
funny, but i need the window to be resizable so i cant/wont disable it. :roll:
c ya,
nco2k
Posted: Wed Oct 18, 2006 6:33 pm
by Fluid Byte
funny, but i need the window to be resizable so i cant/wont disable it.
Now where again you mentioned that in your post.... :roll:
And yes, you can enable/disable it in a simple response to #WM_SIZE respectivley #WM_SIZING or similar.
Posted: Wed Oct 18, 2006 8:50 pm
by nco2k
@Fluid Byte
> Now where again you mentioned that in your post....
i am reporting a bug of a command, which is responsible for smarter refreshing when resizing a window?! i think that is self explaining for every half way intelligent human being. i havent put #PB_Window_SizeGadget inside my example code, to show that it doesnt work correctly even if not resizing the window.
> And yes, you can enable/disable it in a simple response to #WM_SIZE respectivley #WM_SIZING or similar.
i think #WM_ENTERSIZEMOVE & #WM_EXITSIZEMOVE is the better way to go. but even so, it wont work as expected without manually refreshing the window again and where is the point in using SmartWindowRefresh() if i have to refresh the window anyway by myself?! whats "smart" about that??
c ya,
nco2k
Posted: Thu Oct 19, 2006 4:30 pm
by Fluid Byte
Just my 2 cents:
1.) You need to show us that smart refresh doesn't work with fixed-size windows, it's not meant for that. Regardless wether it's working or not. Just disable it.
2.) It really doesn't make a difference if you use #WM_ENTERSIZEMOVE, #WM_SIZING or something else. Just wanted to let you know that you can control the on/off status of smart refresh by catching a specific callback message.
PS: I am using smart refresh too in some project and it's working fine but I'm not using it with tranparent icon's.