How do you get scrollbars to work in C?
Dear all,
As you probably know by now I am trying to build an app to output some info to a window. I have got to the stage where I can put the text into the window and allow the user to resize and move it, updating the window as necessary. I now want to add a horizontal and vertical scroll gadget so that the user can scroll the text if the window is smaller than the data in it. There is a thread here -> http://eab.abime.net/showthread.php?...=scroll+gadget on these forums showing how to do it in assembler but I cannot find any information as to how to do it in c. So far I think you need to set up a list of your gadgets and pass this to something and then watch for various signals. I'm already doing the latter for the resize so have a good handle on these - although I am not sure which signals to look for, or what tags I need to add to my open window. Could someone point me at an easy to follow example for setting up and reading the status etc of a horizontal and vertical scroll bar in C? Many thanks. |
1 Attachment(s)
Here is a full working example. Not sure if it helps, it lacks any comments.
|
Hi Thomas,
Many thanks for the code and sorry for not replying sooner. You are correct though without comments I'm doing a lot of head scratching. Is it OK if I come back asking about the bits I'm stumped on? |
1 Attachment(s)
I added comments to the source code already some time ago. But without any feedback from you I didn't bother to upload it.
Of course you are welcome to ask about anything you don't understand. Note: the tabulator size in my code is 4. The comments and indention might look a bit unaligned if you use a different tab size. |
Quote:
|
All times are GMT +2. The time now is 23:49. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.