Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
jimlef is currently offline  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:

index.php?t=getfile&id=6207&private=0

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 300 times)

[Updated on: Sun, 20 September 2020 22:49]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Background color of StaticText or EditString
Next Topic: LabelBase vertical alignment
Goto Forum:
  


Current Time: Fri Apr 26 20:58:30 CEST 2024

Total time taken to generate the page: 0.03330 seconds