SetTextSize issue

Started by china92, 24 May 2013, 16:51:05

china92

Does setTextSize work for buttons? I'm trying to use this function, but it looks like it isn't working.

Right now size of the text in the button is set to maximum value that the text fits in the button.

Is there any site where I can report bugs?

texus

What version of tgui are u using?

Can u show me the code that u use to create the button (so I can try to reproduce the problem)?

For now, you can just make the bug reports on this forum.

china92

#2
I don't know the exact version (it should be about 3 weeks old).

Ok, I'm putting entire solution inhere (small version of it; you just have to change library directories to work with it). Sorry for the mess in the code, etc., but I'm trying to learn a bit, and experiment, with tgui library.

Here is the link (VS2012): https://speedy.sh/VUd6w/tgui.zip

texus

Based on your code you were using v0.6, which was all I needed to know in order to compile the code.

But what is the problem exactly?
You aren't calling setTextSize, so the text is scaled to fit inside the button.
When I add the setTextSize calls then the text gets the size that I passed to the function. I don't see any problems.

And you don't have to upload the whole VS2012 solution, the source code (or even a small example code) would have been enough. Unless it is for tracking a specific windows-only bug, I don't boot in my windows anyway.

china92

#4
Oh my god... Do I always have to have a problem, which is not actually a problem?
Damn it... I wrote a method that set the size of the text, and I haven't called it... What a oversight... I'm sorry for bothering you.

Ok, I didn't know you were asking about numeric version and I know I do not have to (upload whole solution), but I thought it would be better to do it.


Since I already started the topic... Could you tell me if this kind of inheritance (from public tgui::Panel::Ptr, in RightPanel) is somehow dangerous?
I'm talking about memory leaks (or maybe there are other problems), and I'm wondering that if I have only to call (*this)->removeAllObjects();, thus it carry out deleting all the objects inside RighPanel.

texus

Well that explains why I couldn't reproduce it :).

I don't see any problems with this inheritance, it should be fine.
You don't even have to call removeAllObjects, it gets called automatically when your object is destroyed.

china92