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 » TopWindow&PopUp, TrayIcon » Crash on ToolTip painting
Crash on ToolTip painting [message #28713] Mon, 13 September 2010 18:00 Go to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

I've come to a problem where painting tooltip crashes the application with invalid memory access message. It only happens after I open and close a dialog within my app.

Simple testcase:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define IMAGECLASS Imgs
#define IMAGEFILE <CtrlLib/Ctrl.iml>
#include <Draw/iml.h>

struct Dlg : TopWindow{
	Button b;

	typedef Dlg CLASSNAME;

	Dlg() {
		Title("Dialog").Sizeable();
		SetRect(0,0,300,200);
		Add(b.TopPos(10,20).LeftPos(10,100));
		b.SetLabel("OK");
		b<<=THISBACK(DoStuffAndExit);
	}

	void DoStuffAndExit(){
		Hide();
		Progress p;
		p.SetText("Pretending  work...");
		for(int i=0;i<100;i++){
			Sleep(25);
			p.Step();
		}
		Close();
	}
};

struct App : TopWindow {
	ToolBar tool;

	typedef App CLASSNAME;

	App() {
		Title("My application with bars").Sizeable();
		AddFrame(tool);
		tool.Set(THISBACK(TBar));
	}

	void MenuFn() {
		Dlg().Execute();
	}
	void TBar(Bar& bar) {
		bar.Add("Function", Imgs::open(), THISBACK(MenuFn));
	}
};

GUI_APP_MAIN {
	App().Run();
}

Steps to trigger the crash:
1) Click the icon on the toolbar.
2) Click "OK" button on the dialog.
3) Put the mouse above the icon on toolbar for a while to get the tooltip.
The app crashes even before the tooltip is displayed.

Environment: Linux, GCC 4.5.1, flags GUI MT

Now the question is what am I doing wrong? Confused Any hints are more then welcome...

Best regards,
Honza
Re: Crash on ToolTip painting [message #29285 is a reply to message #28713] Wed, 13 October 2010 23:50 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Nasty... Hopefully fixed.

Mirek
Previous Topic: New Theme caption problem.
Next Topic: how to communicate between windows?
Goto Forum:
  


Current Time: Wed Apr 24 16:25:45 CEST 2024

Total time taken to generate the page: 0.02423 seconds