Home » U++ Library support » U++ Callbacks and Timers » THISBACK and inheritance
Re: THISBACK and inheritance [message #48483 is a reply to message #48482] |
Thu, 06 July 2017 23:17 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
Hello Daniel,
Quote:
But why is it working for the OnClickButton callbacks in the FnWindow?
It is because those button events aren't called immediately. They are called when there is some user action (They are called WHEN there is action (click/push, etc.).
Had they been called immediately you would have the same undefined behaviour.
On the other hand, MenuBar::Set() method calls the provided callback, and sets the menubar immediately, which leads to crash.
Quote:
What macros do you mean and how can I avoid them?
Ah, that's my fault. Nevermind. (For some reason, the below macros reminded me of U++ internal macros used in the TheIDE layout editor.)
#define _FN_LABEL(button, label) button.SetLabel(label).Enable(true)
#define FN_LABEL(number, label) _FN_LABEL(b_fn##number, label)
#define _FN_UNLABEL(button) button.SetLabel("").Enable(false)
#define FN_UNLABEL(number) _FN_UNLABEL(b_fn##number)
Best regards,
Oblivion.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 07 July 2017 06:26] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 28 14:53:35 CEST 2024
Total time taken to generate the page: 0.06372 seconds
|