Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - texus

#1426
I've looked into it, but there doesn't seem to be an easy way to add this.
Loading widgets from a file is still something that is far from being perfect, but I can't immediately do much about it.

I'm afraid you will have to solve it in your c++ code. (GridName, ButtonName1 and ButtonName2 are the names of the widgets in the file)

tgui::Grid::Ptr grid = gui.get("GridName");
grid->addWidget(grid.get("ButtonName1"), 1, 2);
grid->addWidget(grid.get("ButtonName2"), 2, 0);


But of course doing that for all widgets might be a bit long and requires a bit too much hardcoding. So maybe you can do it in another way, using the knowledge that the widgets in the grid are in the same order as they are defined in the file. When you e.g. have a 3x4 grid you can do this:

tgui::Grid::Ptr grid = gui.get("GridName");
auto& widgets = grid.getWidgets();
for (unsigned int row = 0; row < 3; ++row) {
    for (unsigned int col = 0; col < 4; ++col) {
        grid->addWidget(widgets[row*4 + col], row, col);
    }
}


(Codes were written without testing)
#1427
It seems to work fine here.
If you can't solve the problem then you can send me the .cbp file and maybe I can find a mistake in it.
#1428
Thats really strange.

Are you sure that you are using the sfml libraries included in the tgui download?
Are you linking statically or dynamically, in debug or release mode?
You are using MinGW 4.7.1, right?

I'll try it on my windows as well and see if I can reproduce the problem.
#1429
QuoteI actually don't see any of the "extlibs" "mingw" "x68" or "freetype.a" keywords that you used as an example.
It is included with the SFML download, but maybe it isn't installed.

QuoteI thought the precompiled tgui libraries wouldn't include a static version like I needed.
Not only does it include the static versions, it also includes a copy of the sfml extlibs folder (since v0.6.2).
#1430
When linking statically, sfml now forces you to link to its dependencies yourself.

You can solve your problem by changing the FREETYPE_LIBRARY property to "H:/Program Files/SFML/extlibs/mingw/x68/freetype.a" (or something like that). Same for GLEW_LIBRARY and FREETYPE_LIBRARY.

But what tgui version are u using? I tried to make tgui automatically find these extlibs in v0.6.1. Maybe my fix is no longer working?

Also make sure not to change any properties after pressing 'configure'. Otherwise it might find the dynamic sfml libraries first and no longer look for the static ones when changing TGUI_SHARED_LIB. Always have the options correct before you press configure. And then when it gives you errors and more properties to fill in, only adjust the new ones and don't touch the old ones.
Try deleting the cache if you mess up somewhere.

Any reason why you are not using the precompiled tgui libraries? (if you are using mingw 4.8 then you would have a valid reason).
#1431
Help requests / Re: Loading Options
24 March 2014, 08:50:17
To place files and images inside your exe you can use 'resources', but this is not supported yet in tgui. This is also a windows-only thing, which is not cross-platform at all.
#1432
QuoteOn a side note, can I ask you if you plan on implementing a cross-plattform clipboard support that let's you paste text into tgui from the OS' clipboard ? (Copying text from another program and pasting it into tgui)
I originally wanted to implement the clipboard like that, but it was too hard on linux. It works with events, which are handled by sfml and would thus be hard to intercept.
It would be doable on windows, and I am considering adding this feature and make it windows only (even though I kindof hate windows). I haven't looked at mac yet, so maybe I can support it on mac too, but most likely it will involve objective-c code.

Basically I'm not really thrilled to start working on it, there are other features that currently have priority.
#1433
If you don't need to copy & paste then you can use the ChatBox widget (which allows different text colors). In the future it is even the goal to allow you to select text inside it and allow copy & pasting. So once this is done, what you are requesting would no longer be needed.

But I will have a look later today if the TextBox can be made read-only easily. If it isn't too hard to do then I'll make the change, as having a selectable ChatBox is something you won't see in the near future.
#1434
Help requests / Re: String/letters label
17 March 2014, 18:54:50
I can reproduce the problem with SFML 2.1, but not with the github version.

Something must have changed in sf::Text since sfml 2.1 I guess, because sfml 2.1 seems to mess up the clipping calculations in TGUI.

Edit: according to this commit, the problem was introduced in sfml 2.1, and fixed afterwards.
#1435
Help requests / Re: String/letters label
17 March 2014, 16:58:59
I don't even think anything changed in Label between v0.6.1 and v0.6.2.

I can't reproduce it (on linux). Could you show some small program for which it doesn't work for you?
#1436
Help requests / Re: window flickering in macOs
16 March 2014, 12:44:40
Quotei checked shared_libs and build frameworks in cmake and compiled it
I don't even think that I compiled sfml myself. I just downloaded sfml 2.1 and used the install.sh script. (after running the install script you should install the correct template for xcode 5, because it installs the old template).

Edit: Ignore this post, I hadn't seen your edit yet
#1437
Help requests / Re: window flickering in macOs
16 March 2014, 12:34:12
Its been a while since I installed sfml on my mac.

Did you download the "Templates for Xcode 5" from the sfml download page?

Quoteclang: error: unknown argument: '-frameworksfml-system' [-Wunused-command-line-argument-hard-error-in-future]
I think the mistake is just that there should be a space, so it should be  '-framework sfml-system'.
#1438
Help requests / Re: window flickering in macOs
15 March 2014, 14:42:24
Ok, I get the flickering too now.

So for some reason you will have to use the sfml framework with tgui, not the dylibs. This might be because the tgui libraries are compiled against the sfml framework.

But I don't have time to look into this in detail right now, so I'll just add a notice in the tutorial about this.
#1439
Help requests / Re: window flickering in macOs
15 March 2014, 14:35:52
I just let it use frameworks and then only add -ltgui myself.

I'll have a look at what happens when I use dylibs.
#1440
Help requests / Re: window flickering in macOs
15 March 2014, 14:21:36
What exactly do you mean with "window flickering"?

I just tested and I didn't have any problems. I didn't even get that terminal output.

I only changed a few things, as your code didn't work out-of-the-box.
picture->load("Data/Backgrounds/loginBackground.tex");
First of all, I used the cute_image.jpg as image instead (as you didn't provide that tex file).
But I had to write the following, becuase otherwise it wouldn't search for it in the correct directory:
picture->load(resourcePath() + "cute_image.jpg");
Same thing for the other load functions.

Did you use the sfml template for your xcode project?


Edit:
I didn't really look close enough at the console output when writing the post.
It looks like you are linking to both the dylibs and the framework of sfml.