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 - Strikerklm96

#1
Help requests / Resizing Window Skews Buttons
07 April 2016, 05:46:54
When resizing the window, the buttons become squished, as you can image. However, resetting the windows view before drawing them does not fix it, and resetting the gui window doesn't either.
Code (cpp) Select

//doesnt fix it
theResizedWindow.setView(recalculatedDefaultView);
gui.draw()

//doesnt fix it
gui.setWindow(theResizedWindow);

I also tried both at once.
Should these work, or is there something else I need to be doing?
#2
Help requests / Bind this function for all callbacks
16 September 2015, 21:44:25
Code (cpp) Select
m_pWidget->bindCallbackEx(&WidgetBase::f_callback, this, tgui::ClickableWidget::AllClickableWidgetCallbacks);
I want to bind this so that it will call f_callback for ALL possible callback triggers. How can I do this?
Can I bind it to multiple triggers?
#3
I really like TGUI, so great job on it  ;D

I just switched to using this as my compiler: https://sourceforge.net/projects/mingw-w64
After rebuilding SFML and TGUI, SFML works fine, but if I try and do anything with TGUI, I get a crash in the SFML Graphics library:


There was a bunch of steps that lead up to this post, which can be seen in this SFML thread:
https://en.sfml-dev.org/forums/index.php?topic=16579.0

I'm pretty sure (can I get a confirmation?) that this compiler uses DW2. I thought that rebuilding TGUI would allow it to work. What is the problem?
Thanks
#4
Help requests / Draggable Panel
08 April 2014, 00:33:39
I know that a Child Window can be dragged around with the top part, but I was hoping to get a panel like object, could be a window, that can be dragged around by clicking and dragging any part of the panel that isn't another object. Is something like that available or do I need to implement that myself?
#5
Help requests / MenuBar Item bindCallback
29 March 2014, 07:30:32
Can I bind a function for MenuBar? So rather than have to go the "pollCallback" route, bind a function to each specific menu option:
In the example I would do:
    tgui::MenuBar::Ptr menu(gui);
    menu->load(THEME_CONFIG_FILE);
    menu->setSize(window.getSize().x, 20);
    menu->addMenu("File");
    menu->addMenuItem("File", "Load");
    menu->addMenuItem("File", "Save");
    menu->addMenuItem("File", "Exit");
    menu->bindCallback(&sf::Window::close, ptr, tgui::MenuBar::MenuItemClicked);

That would close the window when ANY menu item is clicked, but could I make it close it only when "Exit" was clicked? I know how to do it via callback, but I find binding functions is nicer when possible.
#6
Help requests / Internal Button Events
12 March 2014, 04:09:04
I wanted to make a messaging system that is working with a bunch of other stuff, and I figured I could just have everything inherit from a class called IOBase, which would have virtual send(Message) and recieve(Message) functions. Then, each class could override the function to decide how to interpret the message. So I wanted to know whether this was a good solution or not.

class myButton :  public IOBase, public tgui::Button //<---should that be tgui::Button::Ptr????
{
public:
    void send()
    {
        otherThing->getTarget(target).recieve(message);
    };

private:
    Message message;
    string target;
    IOBase* target;
};

Then later in code
myButtonInstancePtr->bindCallback(&myButton::send, &gui, tgui::Button::LeftMouseClicked);

Is this the BEST way for my button to accomplish that? I know I can do it using callBackId() but I think that's worse.

I would also like to say that this https://github.com/texus/TGUI/blob/master/examples/FullExample/FullExample.cpp, or something like it should be linked in the tutorials. Examples are the most useful thing in the world, and the tutorial only goes over a few things.