Creating a slider

Started by Dagaroth, 25 January 2015, 23:59:00


Hello! Brand new TGUI user here, and I finished going through the tutorials about creating objects (Editboxes, pictures and such), and for my projet, I need to use sliders.
But when I try to create one, and I try to load the widget (I imagine the Track first then the Thumb), but whenever I do load(path-to-track), I get two TGUI errors saying that they can't find the Slider folder in the config and then that it can't load the widget.

I don't understand since the widgets file is the same location as for my editBox/picture.

I can show the Thumb.png image when I create an image, but for a slider, I can't load it.

I already setted it's size, location, horizontal, minimum and maximum. but I can't load!

Help, please! :o


Hi, welcome.

I'm going to need a little bit more information.
- So loading other widgets (e.g. edit box or button) works? (picture doesn't count, it doesn't use a config file)
- Could you paste the exact error message here?
- Could you show the code that reproduces this (simple main function that loads the slider and gives the error)?


Sure thing, here's the code + window and error message:

I placed the "sliders" folder outside of the widgets to try and reference it directly, but it doesn't work more than referencing the folder inside the widgets folder.
("Sliders" is both in widgets folder and as a standalone. the standalone is non-capital, but the widget/Slider is a capital.)

Both edit boxes work, I took them from the tutorial.


Widgets (except for Picture) are loaded from config files. These config files describe which images the widget should use.

You are passing images to the load function instead of the config file. What you really want is the following:
Code (cpp) Select


So that's what they mean by config files. Awesome! Thank you much! :D