Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFGUI (0.4.0 released)  (Read 397283 times)

0 Members and 1 Guest are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.3.2 released)
« Reply #645 on: October 19, 2017, 04:58:46 pm »
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Dehaku

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFGUI (0.3.2 released)
« Reply #646 on: October 20, 2017, 08:24:05 pm »
Beautiful, Thanks for all the help!
Much appreciated.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFGUI (0.4.0 released)
« Reply #647 on: October 29, 2018, 10:13:52 am »
0.4.0 is out :-) Binaries for Windows people will follow shortly.

This is mainly a maintenance release, however it also includes a larger change regarding the CMake config. Please report any issues you get at GitHub, thank you.

Enhancements

  • Modernized CMake configuration.

Fixes

  • sfg::Desktop not properly handling mouse focus between windows.
  • Added missing <string> include.
  • Got rid of SendFakeMouseMoveEvent warnings.
  • Got rid of sf::RenderWindow::Create() deprecation warning.
  • Deactivated Test app features that are broken due to SFML changes.
  • Renamed OpenGL example to avoid a naming collision.
  • FindSFML.cmake updated, libjpeg not required anymore.
  • No WIN32_LEAN_AND_MEAN redefinition.

Downloads

conleec

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFGUI (0.4.0 released)
« Reply #648 on: August 30, 2019, 03:12:04 am »
Hello everybody,

Full disclosure: I'm a complete nube, and am trying to learn SFML and SFGUI. Unfortunately, I cannot get SFGUI to build under Max OS X 10.12.6. I get an error that the CoreFoundation.framework cannot be found. Is there an updated build tutorial that addresses this apparent change in OS X structure?

I actually found CoreFoundation.framework in the XCODE devs folder, trying to direct CMAKE to look there, didn't work for me either.

Any help would be GREATLY appreciated, as I'd love to use this GUI library as I continue to learn C++ and SFML.

Chris Conlee


binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.4.0 released)
« Reply #649 on: August 30, 2019, 10:41:40 pm »
I'm not a macOS expert, so no idea what that error even means.

You could try building and linking SFGUI statically. That way the system libraries that you need to link into your final application will be covered either by SFML or your own project.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

conleec

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFGUI (0.4.0 released)
« Reply #650 on: August 31, 2019, 07:21:07 am »
Is there any way you can give more details on building this library statically? I did what I thought was necessary, but got the same error. Is CoreFoundation.framework required for this library? It doesn't seem to be a part of OS X anymore.

Can anybody else build it with a Mac running 10.12 or greater and let me know if it works for them?

Chris

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: SFGUI (0.4.0 released)
« Reply #651 on: August 31, 2019, 11:11:18 am »
I can confirm the same CMake error when configuring on 10.14.6. I can't say *why*, because macOS isn'y my main platform, but removing the relevant parts in the CMakeLists.txt (commenting out lines 108-121) let me make/install SFGUI and build/run the examples. (Note I used make files however, not xcode project files, if that makes a difference)

conleec

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFGUI (0.4.0 released)
« Reply #652 on: August 31, 2019, 09:49:05 pm »
I can confirm the same CMake error when configuring on 10.14.6. I can't say *why*, because macOS isn'y my main platform, but removing the relevant parts in the CMakeLists.txt (commenting out lines 108-121) let me make/install SFGUI and build/run the examples. (Note I used make files however, not xcode project files, if that makes a difference)

Thank you fallahn! That was going to be my next attempt. It seems like CoreFoundation is no longer a part of Mac OS X, so I was wondering if it would work to simply remove it from the equation.

I'm actually quite new with C++ and especially SFML (learning concurrently), so it's ALL hit and miss for me. I'm not a TOTAL neophyte; I studied computer systems engineering in 1985, but C++ wasn't really part of the curriculum. Spent some time with C. But most of my lab time was Fortran and Cobol, believe it or not. Then life got in the way, and I went in a completely different direction. Glad to be getting back into it. But the brave world of OOP is taking some time to get my head around. :)

Oh, and yes, I'm ALSO using unix makefiles...

Chris

conleec

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFGUI (0.4.0 released)
« Reply #653 on: September 01, 2019, 09:48:04 am »
Awesome news...sort of.

I got the library to build finally and it runs the samples. BUT, it throws a ton of errors about deprecated OpenGl calls in OS X Mojave. I found this, which seems to confirm the issue..

https://stackoverflow.com/questions/52509427/mac-mojave-opengl

In any event, it works for now and I am learning tons.

One question though. I'm running a MacBook Pro with Retina display and the samples are TINY!!!! Is there a compiler setting or a setting in the code that will scale for high density displays?

Thanks in advance.

Chris Conlee

theo

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SFGUI (0.4.0 released)
« Reply #654 on: September 26, 2020, 04:26:57 pm »
I have a problem with Window widgets in SFGUI. What I try to achieve is that if the user right_clicks on an inventory item, a popup appears with a description of the item. I implement this by holding an sfg::Window::Ptr and adding the text to the label in the window. If the window is "opened" (actually happens only the first time), the window is revealed with Show(true). The onCloseButton is bound to a lambda that just hides the window.

The problem is that the window becomes unresponsive in the following scenarios:
- open popup
- drag it around
- "close" the popup (it is actually just hidden). At this point this works.
- "open" it again. Now the correct text appears, but the window will not respond to events anymore. It will not drag or close.

or
- open popup. The correct text appears
- right click on another inventory item. Now the label changes into the expected text, but the window becomes unresponsive.

The label is found with no problem, the text changes as expected. Only the window can not be dragged or hidden anymore. Here the code, it's small enough.

button->GetSignal (sfg::Widget::OnRightClick).Connect ([this, table, index = i * 10 + j] (){show_description (table, index); }); // the inventory is a sfg::Table of sfg::Togglebutton, the index indicates which button is right-clicked

// ...

void Character_sheet::show_description (sfg::Table::Ptr table, size_t index)
{
        // code to determine the description text left out, goes into desc
        auto desc = item_data->description;
        if (index < inv->bag.contents.size ())  // skip if there is no actual item associated with this inventory slot
        {
                if (m_description_popup)
                {
                        m_description_popup->Show (true);
                }
                else
                {
                        m_description_popup = sfg::Window::Create (sfg::Window::Style::TOPLEVEL | sfg::Window::Style::CLOSE);
                        m_description_popup->GetSignal (sfg::Window::OnCloseButton).Connect ([this] (){m_description_popup->Show (false); });
                        auto text = sfg::Label::Create ();
                        text->SetRequisition({ 200.0f,0.0f });
                        text->SetLineWrap (true);
                        text->SetId ("item_description");
                        m_description_popup->Add (text);
                        m_desktop->Add (m_description_popup);
                }
                auto text = find_widget ("item_description");
                text->SetText (desc);
        }
}

template <typename T = sfg::Label>
std::shared_ptr<T> find_widget (const std::string& id)
{
        return std::dynamic_pointer_cast<T>(sfg::Widget::GetWidgetById (id));
}