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 » Menus&Toolbars » update state of a toolbar icon
update state of a toolbar icon [message #6215] Thu, 02 November 2006 18:34 Go to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
how do i update a toolbar icon?
i have set the toolbar with code similar to this:
[...]
tb.Set(THISBACK(MySetToolbar);
[...]
void MyClass::MySetToolbar(Bar& tb) {
   tb.Add(count > 10,"some text",Img::SomeImage(),THISBACK(SomeFunction));
};


how can i redraw the toolbar, that the boolean function "count>10" is rechecked and the Button is enabled again?

tried Refresh(), SyncBar(), RefreshLayout(), RefreshParentLayout(), but nothing worked Sad

Bas
Re: update state of a toolbar icon [message #6230 is a reply to message #6215] Fri, 03 November 2006 10:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Using ToolBar::Set.

Usually, I add method SetBar to may application that calls Set with proper callback and then call SetBar each time ToolBar needs refreshing.

There is quite smart update logic in SetBar so that things get repainted only if needed even if "SetBar" looks like rebuilding the toolbar from the scratch (in other words, calling SetBar is relatively cheap).

Mirek

Re: update state of a toolbar icon [message #6233 is a reply to message #6230] Fri, 03 November 2006 11:52 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Thanks, Mirek
you answered already the question i was going to ask Smile

can you read my mind? Rolling Eyes

Bas
Previous Topic: ToolBar as Ctrl not as Frame [BUG?]
Next Topic: MenuBar does not show slahses
Goto Forum:
  


Current Time: Thu Mar 28 21:47:58 CET 2024

Total time taken to generate the page: 0.01302 seconds