How to scroll down ListIconGadget?

Windows specific forum
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

How to scroll down ListIconGadget?

Post by sartic »

..or give me universal method.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
User avatar
Michael Vogel
Addict
Addict
Posts: 2821
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: How to scroll down ListIconGadget?

Post by Michael Vogel »

Not sure, what you want to do (what about a code example?), but if you only like to ensure, that the selected line is visible, this line will help you:

Code: Select all

SendMessage_(#ListIconGadget,#LVM_ENSUREVISIBLE,GetGadgetState(#ListIconGadget)
USCode
Addict
Addict
Posts: 924
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: How to scroll down ListIconGadget?

Post by USCode »

If I understand what you want, and you need a cross-platform solution, you can use creatively use SetGadgetState() to select an item to move the visible portion of the item list.
Selecting an item moves the ListIconGadget list of items so as the selected item is visible.
Then you can select another item farther up the list or deselect the item altogether with SetGadgetState(#MyListIcon, -1).
If you play around with it a bit you'll get the feel for the behavior.
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: How to scroll down ListIconGadget?

Post by sartic »

Michael Vogel wrote:Not sure, what you want to do (what about a code example?), but if you only like to ensure, that the selected line is visible, this line will help you:

Code: Select all

SendMessage_(#ListIconGadget,#LVM_ENSUREVISIBLE,GetGadgetState(#ListIconGadget)
I am learning pb as writing irc server/client as test of my skill.
I want to have list line of this gadget always visible.

This is interesting... I have no this command in help. But when i write it, editor wants 4th parameter?! Explain please
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: How to scroll down ListIconGadget?

Post by sartic »

USCode wrote:If I understand what you want, and you need a cross-platform solution, you can use creatively use SetGadgetState() to select an item to move the visible portion of the item list.
Selecting an item moves the ListIconGadget list of items so as the selected item is visible.
Then you can select another item farther up the list or deselect the item altogether with SetGadgetState(#MyListIcon, -1).
If you play around with it a bit you'll get the feel for the behavior.
My program works just fine unde Wine (Linux). I didn't yet compile it for Lnx.
I will try this also.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: How to scroll down ListIconGadget?

Post by sartic »

SetGadgetState(#ListIcon_Chat,CountGadgetItems(#ListIcon_Chat)-1)

It works ;) I will test it more...

Sendmessage solution is only for Windows?
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
User avatar
Michael Vogel
Addict
Addict
Posts: 2821
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: How to scroll down ListIconGadget?

Post by Michael Vogel »

sartic wrote:SetGadgetState(#ListIcon_Chat,CountGadgetItems(#ListIcon_Chat)-1)

It works ;) I will test it more...

Sendmessage solution is only for Windows?
I fear, it is (never was keen enough to try programming on linux/mac)
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: How to scroll down ListIconGadget?

Post by sartic »

I prefer Linux, but there is no market to sell your program. (Mac is also only few percent in my country)
It is nice to have Mac and Linux as compile option. I sell Lnx versions half price (but no go :)
If test go well i will buy pb; I need simple GUI for few project in near future.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
Post Reply