|
|
Home » U++ Library support » TreeCtrl » gui crashes.
gui crashes. [message #19592] |
Mon, 22 December 2008 01:49 |
sapiency
Messages: 56 Registered: September 2008
|
Member |
|
|
hi,
I use Refresh() at the end of the method where I create an Element in the Vector.
The Method Paint() of my Window I have overloaded and it looks if there are new elements in the Vector. If so it
clears the Tree and build it new. If I insert Elements in the Toolbar manually by clicking on the Button (very fast ) the gui crashes. I'm using Refresh() because I want to see the changes directly after I insert a new element.
Any Idea how to avoid this?
the logfile ...:
[12/22/2008 01:29:08.542] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.722] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.1003] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.1103] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.1303] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.1464] DeviceTree::createDummyDevice()
[12/22/2008 01:29:09.1634] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.1794] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.1954] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.2104] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.2295] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.2465] DeviceTree::createDummyDevice()
[12/22/2008 01:29:10.2635] DeviceTree::createDummyDevice()
[12/22/2008 01:29:11.2795] DeviceTree::createDummyDevice()
[12/22/2008 01:29:11.2986] DeviceTree::createDummyDevice()
[12/22/2008 01:29:11.3196] DeviceTree::createDummyDevice()
[12/22/2008 01:29:11.3386] DeviceTree::createDummyDevice()
[12/22/2008 01:29:11.3557] DeviceTree::createDummyDevice()
[12/22/2008 01:29:12.3717] DeviceTree::createDummyDevice()
[12/22/2008 01:29:12.3897] DeviceTree::createDummyDevice()
Assertion failed in c:\upp\uppsrc\CtrlCore\Win32Proc.cpp, line 77
IsNull(sPainting)
regards
reinhard
[Updated on: Mon, 22 December 2008 12:12] Report message to a moderator
|
|
|
|
|
Re: gui crashes. [message #19605 is a reply to message #19604] |
Mon, 22 December 2008 16:58 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I couldn't reproduce the problem with MSC8 on XP. I suspect the problem is caused by refilling the TreeCtrl in TopWindow::Paint. This should really be done when you add the new device, which would also make your code much shorter and cleaner.
There are a couple of other tips you might find useful:
- Instead of using 'new' to create the Devices you should make it Moveable or use Array. 'new' is almost never needed with Upp.
- Unless you are doing something very complicated in the real application you could just store the Devices directly in the TreeCtrl as keys, for even simpler code. If you add Value conversion to Devices:
operator Value() const { return RawToValue<Devices>(*this); }
Devices &operator=(const Value &v) { *this = ValueTo<Devices>(v); }
then your createDevice function becomes:
bool TreeTest::createDevice(int handle)
{
Devices newDevice(handle, "0.0.0.0");
newDevice.setName(Format("nummer: %d",_counter));
_myTree.Add(0, Image(), newDevice, newDevice.getName());
_counter++;
return true;
}
This will also make Drag-Drop much easier as you don't have to mirror the changes in your storage container.
[Updated on: Mon, 22 December 2008 17:03] Report message to a moderator
|
|
|
|
Re: gui crashes. [message #19646 is a reply to message #19605] |
Sat, 27 December 2008 23:38 |
sapiency
Messages: 56 Registered: September 2008
|
Member |
|
|
mrjt wrote on Mon, 22 December 2008 16:58 | I couldn't reproduce the problem with MSC8 on XP. I suspect the problem is caused by refilling the TreeCtrl in TopWindow::Paint. This should really be done when you add the new device, which would also make your code much shorter and cleaner.
|
I compiled it with the prebuild Release 643 ... No problems any more ...
But there are allways the same problems, even with the new example (see other post ) with the Release 2008.1 (with mingw) from July
regards
reinhard
[Updated on: Sat, 03 January 2009 17:10] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 09:56:17 CEST 2024
Total time taken to generate the page: 0.02695 seconds
|
|
|