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

Topics - ingar

#1
Help requests / Changing font size for a widget
15 September 2020, 00:47:56
Hi.

I have a "tgui::Label::Ptr" for a widget created by guibuilder.

I want to change the font size for the widget.
What is the best way?

Ingar
#2
Help requests / Screen sizing
11 September 2020, 17:39:10
Hi all,
I want to make an extension to my Raspberry Pi app that allows my program to run on different screen sizes.
I could make a table containing some information for every widget on the screen in terms of position and size, in order
to control the position and size of the controls.

I have seen, though, that if I make a SIZEABLE TGUI screen, TGUI somehow stretches/shrinks my controls according to the
main window size. This is something I do not want, since I want to be in the driver's seat myself.

Q: Is there a way to disable this option?
     I tried to test for the sf::Event::EventType::Resized in the message loop, and do not call gui.handleEvent for than event.
     But that didn't seem to have ant effect.

Ingar
#3
Hi again,

I have this scenario:

I receive a .jpg file image on TCP/IP from an external server.
So I have a byte buffer (with a given length) containing the jpg file.

So how do I update an existing Picture widget from this buffer?

I know how to create a NEW Picture widget from a buffer, using an sf::Texture in the constructor,
but isn't it a bit overkill to create a new one every time? I saw that a function tgui::Picture::setTexture was available
in version 0.78, but this function has been removed in the latest version (0.85).

Ingar
#4
General Discussion / TGUI and Unicode
07 May 2019, 21:53:12
Hi all,

A general question:

Are there any ways of supporting Unicode in TGUI? I am hoping to be able to replace a Windows CE application with a TGUI app. But the Windows CE app is connecting to a server that returns UTF8 data.
And I cannot see how to TGUI can display those Japanese names...

Ingar

#5
Hi,

In my app I have a thread that checks if an RFID card is placed over an RFID reader. If a card is detected the app reads some data from the card. This data I would like to pass to an event handler in my main thread. Q: What's the best method for doing this in tgui?

I Windows programming, the thread typically issues a PostMessage to the main window thread, and the message handler in the main thread does the handling.

Regards,
Ingar
#6
General Discussion / Re-using RenderWindow
30 April 2019, 15:50:39
Hi,

I have a TGUI app where a screen (dialog) starts another screen (dialog) with a button.
The second screen creates an sf::RenderWindow and attaches this window to a tgui::Gui.
This works, but to construct a new sf::RenderWindow everytime takes time.

Q: Is there a way a new tgui:Gui can reuse a window used by another tgui:Gui?
     The problem, as I can see, is that the render windows also gets destroyed when the Gui is destroyed,
     so that the old Gui crashes when it continues trying to use the destroyed window.
     Perhaps sf::RenderWindow has a copy constructor that doesn't take that long time to execute,
     or there is a way of detaching a window from the Gui?

Ingar

#7
Help requests / MessageBox how to use
26 April 2019, 18:43:47
Hi all,

I am sure this question has been posted many times before, but anyway:

How do I display a message box in TGUI?

I have tried tgui::MessageBox::Create("Heading","Message",{"OK", "Cancel"});
Then I add it to the gui, and it displays in the upper left corner.

But how do I get the events from my buttons (OK or Cancel)?

Can someone give me a complete example. Then I can make a function that just displays the message and returns with a value.

Ingar
#8
Hi!

One thing I miss in tgui::Gui:

Setting the background color. Because from what I can see the background color is black. I can do this by creating a Picture widget that has a specific color. But why not have a function tgui::Gui::SetBackgroundColor(...)?

Perhaps I missed something?

Ingar
#9
Hi all,

I am very new in this. But one question:
Do I have to decode the form.txt file created by tgui-builder myself, or are there some functions I can call
for decoding the file and creating the window?

Ingar Steinsland
ingar@labelcraft.net
#10
Feature requests / Theme constructor
12 April 2019, 09:17:55
Hi,
I am very impressed of all the work you have done with TGUI. Out of interest: How many developers are working on the project?

Anyway, from the "widgets" test program, I was thinking of the following improvements:

1: Is it possible to add a Theme constructor that takes a theme from memory instead of from file?
    Like the "LoadFromMemory" functions in SFML? In this way, we could prevent users to tamper with
    the theme.
2: Perhaps also make a constructor for predefined themes?
    Something like:

    #define THEME_BLACK         1000
    #define THEME_GRAY           1001

    tgui::Theme theme(THEME_BLACK);

Small things, but anyway.

Ingar Steinsland
ingar@labelcraft.net

#11
Hi!
I managed to install TGUI as Dynamic Library on my Raspberry PI 386 Debian Linux.
But, DLL dependencies in Windows and .so dependencies in Linux I do not like. In the long run it creates a lot of support issues. Therefore, I try to install TGUI as STATIC library, i.e. making a .a file. But I am running into a problem when running "cmake ." on the TGUI 0.84 source. I get this message:

SFML found but some of its dependencies are missing ( xcb-image)
CMake Error at CMakeLists.txt:206 (message):
  CMake couldn't find SFML.

The problem, I think, is finding the libxcb_image.a library. The .so library files are there:

pi@raspberry:~/TGUI-0.8.4 $ locate libxcb-image
/usr/lib/i386-linux-gnu/libxcb-image.so.0
/usr/lib/i386-linux-gnu/libxcb-image.so.0.0.0

So my question is:
1: How can I get hold of a libxcb-image.a file?
2: Or perhaps I can do something else?

Regards,
Ingar Steinsland
ingar@labelcraft.net