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 » Problem with SetTimeCallback in TrayIcon
Problem with SetTimeCallback in TrayIcon [message #6015] Sat, 28 October 2006 10:34 Go to next message
zaurus is currently offline  zaurus
Messages: 41
Registered: May 2006
Member
Hi!

I have done a 'Trayicon-Application' and want to use a SetTimeCallback, but I'm getting an error during compiling the application.

C:/UPP_610/uppsrc/CtrlCore/CtrlCore.h:963: error: `void Ctrl::SetTimeCallback(int, Callback, int)' is inacces
sible


I thought TrayIcon is inherited from Ctrl, so why I cannot access SetTimeCallback? If I use the 'Class Browser' I can find SetTimeCallback in TrayIcon class.

Anything I did wrong?

Thanks for any tips or help.

Zaurus
Re: Problem with SetTimeCallback in TrayIcon [message #6026 is a reply to message #6015] Sat, 28 October 2006 21:41 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
have you seen this message:
http://www.arilect.com/upp/forum/index.php?t=msg&goto=38 80&#msg_3882

there is a blinking lable with TimeCallback, maybe that helps

Bas
Re: Problem with SetTimeCallback in TrayIcon [message #6040 is a reply to message #6026] Sun, 29 October 2006 06:32 Go to previous messageGo to next message
zaurus is currently offline  zaurus
Messages: 41
Registered: May 2006
Member
Hi Bas!

Thanks for the link, but this is inside a Ctrl where it also works for me. I have used it in this way many times, but now I have a class inherited from TrayIcon and then SetTimeCallback seems to be not available. Even TrayIcon is inherited from Ctrl, so in my logic it should work, but I'm just a beginner in U++ and so most likely I did something wrong.

This is from the class declaration:

class MyClass : public TrayIcon {
public:
typedef MyClass CLASSNAME;
MyClass();
private:
void OnTimer();


Then this in my constructor:

SetTimeCallback(1500, THISBACK(OnTimer));


And I get this error during compiling:

C:/UPP/uppsrc/CtrlCore/CtrlCore.h: In constructor `MyClass::MyClass()':
C:/UPP/uppsrc/CtrlCore/CtrlCore.h:936: error: `void Ctrl::SetTimeCallback(int, Callback, int)' is inaccessibl
e
C:\MyApps\MyClass\main.cpp:17: error: within this context
C:/UPP/uppsrc/CtrlCore/CtrlCore.h:936: error: `void Ctrl::SetTimeCallback(int, Callback, int)' is inaccessibl
e
C:\MyApps\MyClass\main.cpp:17: error: within this context
C:\MyApps\MyClass\main.cpp:17: error: `Ctrl' is not an accessible base of `MyClass'


Any ideas how to get it working?
Re: Problem with SetTimeCallback in TrayIcon [message #6045 is a reply to message #6040] Sun, 29 October 2006 08:22 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Well for a fast hack change the line
class TrayIcon : private Ctrl

to
class TrayIcon : public Ctrl

then it should work.

@others
Why is Ctrl a private base-class of TrayIcon? I guess to hide some functions like SetRect etc - in that case it would be great to add SetTimeCallback to TrayIcon.

Bas
Re: Problem with SetTimeCallback in TrayIcon [message #6049 is a reply to message #6045] Sun, 29 October 2006 09:34 Go to previous messageGo to next message
zaurus is currently offline  zaurus
Messages: 41
Registered: May 2006
Member
Hi!

Thanks for the hint. Seems I was a bit blind and overlooked that Ctrl is inherited as private.
Re: Problem with SetTimeCallback in TrayIcon [message #6050 is a reply to message #6049] Sun, 29 October 2006 09:53 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
No Problem Very Happy
Re: Problem with SetTimeCallback in TrayIcon [message #6065 is a reply to message #6045] Sun, 29 October 2006 20:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11701
Registered: November 2005
Ultimate Member
fallingdutch wrote on Sun, 29 October 2006 02:22

Well for a fast hack change the line
class TrayIcon : private Ctrl

to
class TrayIcon : public Ctrl

then it should work.

@others
Why is Ctrl a private base-class of TrayIcon? I guess to hide some functions like SetRect etc - in that case it would be great to add SetTimeCallback to TrayIcon.

Bas


Because Ctrl is used just as implementation helper. TrayIcon really is not Ctrl.

Mirek
Re: Problem with SetTimeCallback in TrayIcon [message #6074 is a reply to message #6065] Sun, 29 October 2006 22:25 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
luzr wrote on Sun, 29 October 2006 20:31


Because Ctrl is used just as implementation helper. TrayIcon really is not Ctrl.


So SetTimeCallback won't work with TrayIcon at all?

Bas
Re: Problem with SetTimeCallback in TrayIcon [message #6086 is a reply to message #6074] Mon, 30 October 2006 07:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11701
Registered: November 2005
Ultimate Member
Well, ::SetTimeCallback would. But I recommend using TimerCallback, which can be considerd "highest level" version.

Trouble with ::SetTimeCallback is that you are responsible for killing callbacks in destructor (otherwise timer would call dangling callback).

Mirek
Re: Problem with SetTimeCallback in TrayIcon [message #6101 is a reply to message #6086] Mon, 30 October 2006 16:26 Go to previous message
zaurus is currently offline  zaurus
Messages: 41
Registered: May 2006
Member
Hi Mirek!

Thanks for the explanation. I tried TimeCallback and it works fine for what I want to do.

Just to highlight in case somebody reads through the thread again. The class is TimeCallback not TimerCallback.

Zaurus
Previous Topic: trayicon and shutdown
Next Topic: Borderless TopWindow
Goto Forum:
  


Current Time: Tue Feb 19 09:54:48 CET 2019

Total time taken to generate the page: 0.00904 seconds