ResizeGadget()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

ResizeGadget()

Post by srod »

Hi,

I always add code where appropriate to reduce flicker and such.

There have been a couple of instances now where much searching and tearing code (and hair!) apart has revealed a source of irritating flicker to be the ResizeGadget() command. Switching this for MoveWindow_() with the 'bRepaint' flag set to false has removed the flicker completely.

Could you perhaps therefore consider adding such a flag to the ResizeGadget() command (perhaps make it an optional parameter) ? I know opting not to repaint the gadget in question can lead to all kinds of repaint problems, but in my case I always have a lot of custom code for erasing and painting anyhow and consequently such an option is very useful.

Just thought it might help those working on Linux as well etc. :)

Thanks.
I may look like a mule, but I'm not a complete ass.
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

If this request is accepted (I strongly support it) then there should be a native
RepaintGadget() as well. It wouldn't make sense to use a native command and then
be forced to use the API to repaint the gadget...
Windows 7 & PureBasic 4.4
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

You could accompilsh that with the same ResizeGadget() command - just use #PB_IGNORE and set the bRepaint flag! :)
I may look like a mule, but I'm not a complete ass.
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

OK, that's acceptable :D
Windows 7 & PureBasic 4.4
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

srod wrote:You could accompilsh that with the same ResizeGadget() command - just use #PB_IGNORE and set the bRepaint flag! :)
Uh, sample please?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

blueznl wrote:
srod wrote:You could accompilsh that with the same ResizeGadget() command - just use #PB_IGNORE and set the bRepaint flag! :)
Uh, sample please?
A sample of what exactly? This is just a feature request.
I may look like a mule, but I'm not a complete ass.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Code?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

blueznl wrote:
srod wrote:You could accompilsh that with the same ResizeGadget() command - just use #PB_IGNORE and set the bRepaint flag! :)
Uh, sample please?

Code: Select all

ResizeGadget(Gadget.l, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore, #True)
Where #True is the requested repaint flag...
Windows 7 & PureBasic 4.4
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

You'll have to be more specific I'm afraid.

I have put in a simple request for the addition of a simple flag to the ResizeGadget() command. The addition of a snippet of code will add nothing to the arguments for or against such an addition as I think that my reasons for making the request are clear enough.

Either Fred/Timo will agree with the validity of my request of they will not, but I do not believe that either would require some code before making their decision.
I may look like a mule, but I'm not a complete ass.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

It's exactly like MoveWindow_() with the addtinal option to accept indexes along with handles.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fluid Byte wrote:It's exactly like MoveWindow_() with the addtinal option to accept indexes along with handles.
Yes, but simply made crossplatform.
I may look like a mule, but I'm not a complete ass.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

> always add code where appropriate to reduce flicker and such.
> Could you perhaps therefore consider adding such a flag to the ResizeGadget() command

I hope, I understand you correctly, but do you know the urpose of SmartWindowRefresh()? It's exactly for reducing flickering.
In my opinion, this command should be improved, instead of modifying other principles.
(I hope, my opinion matches this topic...)
PB 4.30

Code: Select all

onErrorGoto(?Fred)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

SmartWindowRefresh() is neither appropriate or effective in the situations in which I endeavour to combat flicker (and yes I did try it whilst hunting down the original problem). I am talking about working with individual gadgets -not the entire parent window etc.

Beside's, SmartWindowRefresh() is not something I would ever need because of all the custom painting and erasing which I usually undertake.

The purpose of my original post was not to point Fred/Timo towards some desperately needed feature (as using MoveWindow_() in my situation is pretty trivial) but to essentially request a crossplatform feature -nothing more! :)
I may look like a mule, but I'm not a complete ass.
Post Reply