sliders ignore min value in linux? Topic is solved
sliders ignore min value in linux?
in windows when you set the minimum value when created the slider defaults to whatever that minimum value is.
in linux (ubuntu) it appears to be ignored and is always set to 0.
running 2.8 of wxwidgets.
in linux (ubuntu) it appears to be ignored and is always set to 0.
running 2.8 of wxwidgets.
Sorry for not getting back to you I've been busy...
anyway, I tried the demo and it looks like the slider doesn't auto update when the min-max values are changed like it does in windows.
And this crashes my app because the slider position is critical.
To test, start up the demo, go to the slider tab.
change the min-max value to be 1-10, move the slider to 5.
change the min-max to be 10-20
the sliders position changes (incorrectly I might add) but the value does not.
The demo also does not let you set the min-max values to be the same. I'm not sure if that's intentional or not under linux. But I do know you can do do it in your own apps within windows without errors.
is there a way to force an slider update through code?
anyway, I tried the demo and it looks like the slider doesn't auto update when the min-max values are changed like it does in windows.
And this crashes my app because the slider position is critical.
To test, start up the demo, go to the slider tab.
change the min-max value to be 1-10, move the slider to 5.
change the min-max to be 10-20
the sliders position changes (incorrectly I might add) but the value does not.
The demo also does not let you set the min-max values to be the same. I'm not sure if that's intentional or not under linux. But I do know you can do do it in your own apps within windows without errors.
is there a way to force an slider update through code?
Do you mean the 'widgets' sample?To test, start up the demo
Doing exactly that in the wxGTK-2.8.8 'widgets' sample works just as it should: the control's value changes to 10, and the slider position changes correctly. It doesn't crash.change the min-max value to be 1-10, move the slider to 5.
change the min-max to be 10-20
It won't let you set min==max, but then it wouldn't be much use as a slider in those circumstances...
Again, what are you using exactly? Which wx version, which toolkit, which sample/demo?
I'm using ubuntu hardy (everything updated according to the updater) with these libraries:
libwxbase2.8-0
libwxbase2.8-dev
libwxgtk2.8-0
libwxgtk2.8-dev
wx2.8-doc
wx2.8-headers
wx2.8-i18n
using codeblocks build 5382
with the wxsmith wxWidgets form builder.
the demo app I'm talking about is the one found here:
http://www.wxwidgets.org/downloads/demos.htm
the GTK+ version of the one called "Widgets Demo"
it doesn't crash when you change it, but the value stays at 5 for me.
and I need the min-max set the same because the slider represents the number of database entries. If there is only one entry and you are able to move it to another position the app crashes trying to load a second entry that is not there.
thanks for your replies btw.
libwxbase2.8-0
libwxbase2.8-dev
libwxgtk2.8-0
libwxgtk2.8-dev
wx2.8-doc
wx2.8-headers
wx2.8-i18n
using codeblocks build 5382
with the wxsmith wxWidgets form builder.
the demo app I'm talking about is the one found here:
http://www.wxwidgets.org/downloads/demos.htm
the GTK+ version of the one called "Widgets Demo"
it doesn't crash when you change it, but the value stays at 5 for me.
and I need the min-max set the same because the slider represents the number of database entries. If there is only one entry and you are able to move it to another position the app crashes trying to load a second entry that is not there.
thanks for your replies btw.
Ah, that's why you call it 'demo' .the demo app I'm talking about is the one found here:
I don't think they're in any hardy package, but if you download the wxGTK-2.8.8 tarball from http://biolpc22.york.ac.uk/pub/2.8.8/wxGTK-2.8.8.tar.gz you'll find the 'widgets' sample in the 'samples' dir. You'd probably have to run configure before you can build it; but you shouldn't need to build wxGTK too, as the samples should build against your current wx.
And you can compare its code with that of the 'demo' and see what the demo does wrong.
well that's the thing, My app and the demo both behave incorrectly.
and the demo does come with the code too. It does pretty much the same thing as mine.
to re-cap:
start up the demo, go to the slider tab.
change the min-max value to be 1-10, move the slider to 5.
change the min-max to be 10-20
the sliders position changes (incorrectly I might add) but the value does not and stays at 5.
If I click on the slider then it changes to 10.
and the demo does come with the code too. It does pretty much the same thing as mine.
to re-cap:
start up the demo, go to the slider tab.
change the min-max value to be 1-10, move the slider to 5.
change the min-max to be 10-20
the sliders position changes (incorrectly I might add) but the value does not and stays at 5.
If I click on the slider then it changes to 10.
Yes, I dicided I'm going to have to break down and build wxWidgets from SVN.
I was going to eventually But I kept putting it off...
I'll see if I can build this thing in linux, I've already done it windows, but linux is whole different story as you know...
I'll get back to you after I've done it and made it compile properly in codeblocks. (might take me a few days though)
I was going to eventually But I kept putting it off...
I'll see if I can build this thing in linux, I've already done it windows, but linux is whole different story as you know...
I'll get back to you after I've done it and made it compile properly in codeblocks. (might take me a few days though)
You don't have to build it too, but it's not a bad idea. But why svn? You can download a stable tarball (2.8.8 to match what you've already got, or 2.8.9 which is the latest one).ouch67 wrote:Yes, I dicided I'm going to have to break down and build wxWidgets from SVN.
Yes: it's easier!I'll see if I can build this thing in linux, I've already done it windows, but linux is whole different story as you know...
Especially as you've already got an installed version, I strongly suggest you make a 'local' build, by:
- 1)Make a new directory in the source directory. If you're going to make a unicode debug build, you might choose to name it 'udb': mkdir udb
2) cd udb
3) ../configure --with-gtk --enable-unicode --enable-debug --prefix=$(pwd)
(Note the 2 dots in front of /configure)
4) Now make You don't need to 'make install'
PATH=/path/to/udb:$PATH
or in an IDE, where you currently have wx-config, put /path/to/udb/wx-config
well the widget example is completely different from the widget demo...
anyway, yes it does work fine in that app. looking at the code it looks like they check values after altering the slider and if it's not correct then they force the values...
not the most efficient thing, but it works I guess.
The code for the demo app does not have these checks in place which is why it happens there.
anyway, yes it does work fine in that app. looking at the code it looks like they check values after altering the slider and if it's not correct then they force the values...
not the most efficient thing, but it works I guess.
The code for the demo app does not have these checks in place which is why it happens there.
heh, compiling my code against the svn version fixed the problem.
apparently it was a bug after all and has been fixed.
thanks for your help though!
edit: damn it! they fixed it, but now they don't allow the min and max to be the same value!
So I'm effectively screwed over even more than before...
edit2: I've now replaced all my sliders with spinners. Would still like to use sliders though if the min and max can be set to the same value again in the future.
apparently it was a bug after all and has been fixed.
thanks for your help though!
edit: damn it! they fixed it, but now they don't allow the min and max to be the same value!
So I'm effectively screwed over even more than before...
edit2: I've now replaced all my sliders with spinners. Would still like to use sliders though if the min and max can be set to the same value again in the future.