Need a vertical slider, not a scroll bar

Yes Gary, the Dev machine I’m using is running Windows10 in a VM under Linux. A sample project should work fine either way. We don’t do any MacOS development at all.

The project we’re building has to run Linux 90% of installs, and Windows about 10% of the time, just long enough for the Windows users in the field to get updated to Linux. Eventually all of our equipment will be on Linux after Windows is completely phased out.

Here is the link to the project CustomSlider
I added the mouse wheel event and tried to keep all the code inside of the single canvas. It could probably use some tweeking to get it just right. So have at it.
Capture2

3 Likes

Thanks Gary - Much appreciated. I think that will get me steered around the right way now.

That’s slick. If you want to add the narrow ticks to the left side you can include:

for i = 0 to 250 step 5
g.forecolor = color.Black
g.fillrectangle(5,i, 5,1) // Fills the narrow left tick marks
next

Hi there,
if someone is interested in a versatile fader unit like this:

Fader_Demo_2021-04-01


A short description and the downloads of the project files are available here.
I have programmed them for some remote controllers of our building automation system via ethernet.
It’s tested only on Windows, but should work on Linux also, I think…

-Martin Z.

7 Likes

I tried your Fader Demo here with Xojo Linux 2020r2,1 on a fresh install of Linux Mint 20.1 Cinnamon…

This is what I see in the IDE, and when I hit “run” Xojo emits some error message for a split second then disappears - and on one test Xojo wouldn’t restart until we rebooted the system. Not sure what’s going on.

Unfortunately in testing Linux Xojo, we tend to see a lot of problems with project built outside Linux, and then trying to run with Linux Xojo… Even the Xojo Linux IDE itself has a lot of chopped off text, partially missing menu items etc.

By the way: Thanks for putting up those cool faders! It looks cool on WindowsOS - no luck on Linux side.

That’s what it looks like in the MacOS IDE also, although under MacOS it runs fine. Hard to say what your “split second” error message might be. Maybe try breakpointing in the App.Open or Window.Open events to see if it’s throwing the error somewhere during app execution or in Xojo’s compilation process; I suspect the latter, but I’ve never run Xojo under Linux.

You made me curious :grinning:
So I plucked the SDcard out of my photocamera (found no other…), flashed a fresh downloaded raspbian on it, put it in a Raspi 3 B+ (borrowed from our video presentation system - found no other…) and downloaded the executable which I compiled for LinuxARM on Windows-Xojo before. Good luck on Linux side, it works. (except the shortcuts Alt-1 etc, but these are not a fader issue…)
Haven’t tested yet running Xojo itself on Linux…

1 Like

Ah - I found problem. Your source file was set for This Computer and Windows 32 bit (at least that’s how it showed up at my end). And that was causing Xojo Linux to commit suicide when I tried to run - apperently it doesn’t know what “this computer” means, and yes 32-bit libs installed.

Change build settings to This Computer + Linux 64 bit and it does run. It also runs as-is on Win10-64 system. I can’t drag the fader controls with mouse but the mouse wheel works. Thanks for putting up the demo!

Try to hold down Shift or Ctrl key (or both) while dragging the fader control, then it should work. That’s a feature, not a bug :grinning_face_with_smiling_eyes: and should avoid unintended jumps of the fader when clicking/selecting it.
But you may change this behavior in the MouseDown event handler, if you like…
See also “Operation” on the download page

1 Like

Thanks Julia ( NIce AmpHour interview!! Thanks!)

Turns out the “Split Second” error just before the IDE self-destruct was happening in 2020r2.1. In Xojo Linux 2021r1 the displayed error was complaining about 32-bit libs not being installed - which they are, according to Linux setup page docs.

Once I set the build for “This Computer” + “Linux 64 bit” the fader demo ran & rendered OK in 2021r1.

1 Like

Blockquote
Try to hold down Shift or Ctrl key (or both) while dragging the fader control, then it should work. That’s a feature, not a bug :grinning_face_with_smiling_eyes: and should avoid unintended jumps of the fader when clicking/selecting it.

Yeup, I realized that later when I was looking at the code (at least the top 75% of text in Linux code editor :grinning:). Got it. Thanks!