Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Add Button crashes program on start
Add Button crashes program on start [message #54839] |
Sun, 20 September 2020 22:48  |
jimlef
Messages: 90 Registered: September 2020 Location: US
|
Member |
|
|
I have the following code:
invoices.lay:
LAYOUT(CustomersWindowLayout, 1112, 476)
ITEM(SqlArray, CustArray, SetFrame(ThinInsetFrame()).LeftPosZ(436, 656).TopPosZ(28, 420))
.
.
.
ITEM(Button, btnAddCustomer, SetLabel(t_("Add")).SetFont(SansSerifZ(16)).SetFrame(ButtonFrame()).LeftPosZ(24, 88).TopPosZ(352, 28))
END_LAYOUT
customers.cpp:
CustomersWindow::CustomersWindow() {
String DBFile;
String configfile = ConfigFile();
CtrlLayout(*this, "Customers");
btnAddCustomer <<= THISBACK(btnAddCustomerClick); // <-- only line added in this function since last successful run
...
void CustomersWindow::btnAddCustomerClick()
{
PromptOK("Click Add");
return;
}
customers.h:
struct CustomersWindow : WithCustomersWindowLayout<TopWindow>
{
String GetOutputDirectory();
String SelectDB();
String DBFile;
String OutputDirectory;
String configfile = ConfigFile();
String cfg;
FileSel selectdbwin;
FileSel selectodirwin;
public:
typedef CustomersWindow CLASSNAME;
CustomersWindow();
void btnAddCustomerClick();
void Paint ( Draw& w )
{
w.DrawRect ( GetSize(), Color ( 204, 255, 255 ) ); // <= enter your background color here
}
};
Every time I try to run this, I get:

The only change is adding this callback function in the places shown.
I can't find a thing wrong with the code, any suggestions?
Running current stable release (14429) installed from dpkg on Linux Mint (2020).
Thank you!
-
Attachment: crash.png
(Size: 4.17KB, Downloaded 413 times)
[Updated on: Sun, 20 September 2020 22:49] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 13 08:27:51 CEST 2025
Total time taken to generate the page: 0.00924 seconds
|