Problem with clipping inside Panel

Started by kroyee, 11 March 2017, 23:51:46

kroyee

Hey, I have a few Panels that are holding other widgets.
Inside the panels are some labels/listbox/chatbox. I have a function that on resizing the window is recalculated the viewport to keep aspect ratio, and everything works fine except for the clippings inside the panel.
The panels either cut off the top part or the left part depending on how I size my window.

I am setting the new viewport both for my sf::window and for the gui.

The panel is the highly transparent white rectangle on the right part of the screen.
I'm using tgui 0.7

texus

Are you using TGUI 0.7.3? Because this sounds like a bug that I fixed in that version.

texus

This seems to be a separate issue. I have been able to reproduce it, I'll try to fix it soon.

texus

The issue has been fixed. You will have to download the updated version and build the tgui libraries yourself.

kroyee

#4
Wow, that was fast. :)
Thanks!

kroyee

Hmm, I just uninstalled tgui from the packetmanager.
Followed the cmake building instructions, all builds well.

I can compile and things works, but when I try to run the program I get this:
./sfml: error while loading shared libraries: libtgui.so.0.7.3: cannot open shared object file: No such file or directory

Is it something I've missed to purge before making the new install or do I need to link differently?

kroyee

Alright, googel helped me... I reinstalled the -dev packet in packet manager. Now it's working perfectly.
Cheers!

texus

Although it is good that you have it solved, your solution to the problem is a bit wrong. What you have to do when you get the error is described here: https://tgui.eu/tutorials/v0.7/linux/#possible_error

If you installed libtgui-dev from the package manager again then you now likely have two versions on your pc, one in /usr/lib and one in /usr/local/lib. If I understood your situation correctly then you should actually be able to uninstall libtgui-dev from the package manager again and everything should still work fine.

Reinstalling the package probably caused the system to run ldconfig for you which is why it solved the error.

kroyee

You are correct, sir.

So a follow up question then. When someone want to use my app, do they also need to compile this version of TGUI to be able to run it?
I feel like I'm missing something abitrary here.

texus

#9
They need to have the same TGUI version as you are using. They don't have to build it, you should include the .so files with your application (similar to handling .dll files on windows except that .so files aren't looked for in the current directory and you have to mess around with the rpath of the executable to make it work).

Of course the change that I made will be included in the next tgui release. So once 0.7.4 comes out you could download and use that version. Then you no longer have this special version.

But even after the 0.7.4 release you shouldn't rely on people installing that version manually, you should always try to ship the right dependencies with your application. So in the end it shouldn't matter whether you have a modified or an official version of tgui.

Distributing an application on linux is quite complex and requires a lot of experimentation. If you intend to do so then I suggest you read the following post that I once wrote: https://en.sfml-dev.org/forums/index.php?topic=20727.msg148895#msg148895
Or maybe you can use a different method, e.g. using snaps. Or bundle all the source code including sfml and tgui with a makefile and have it all build on their pc.

But these are things to worry about when the application is finished.