-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Event Callback for text change (L0hp5jTY7Y)
- Loading branch information
1 parent
24ba27d
commit 4bd3a30
Showing
6 changed files
with
103 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "ssGUI/HeaderGroups/StandardGroup.hpp" | ||
|
||
#include "ssLogger/ssLog.hpp" | ||
#include "ExamplesResources.h" | ||
|
||
int main() | ||
{ | ||
ssGUI::MainWindow mainWindow; | ||
|
||
//Creating ssGUIManager and run it | ||
ssGUI::ssGUIManager guiManager; | ||
auto* textfield = mainWindow.AddChild<ssGUI::TextField>(); | ||
|
||
textfield->SetSize(glm::vec2(500, 250)); | ||
textfield->SetPosition(glm::vec2(50, 50)); | ||
textfield->SetWrappingMode(ssGUI::Enums::TextWrapping::WORD_WRAPPING); | ||
|
||
textfield->AddEventCallback(ssGUI::Enums::EventType::TEXT_CONTENT_CHANGED)->AddEventListener | ||
( | ||
"Key", | ||
[](ssGUI::EventInfo& info) | ||
{ | ||
ssLOG_LINE("Changing..."); | ||
} | ||
); | ||
|
||
guiManager.AddRootGUIObject((ssGUI::GUIObject*)&mainWindow); | ||
|
||
guiManager.StartRunning(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.