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 » Community » Newbie corner » Toolbuttons
Re: Toolbuttons [message #25003 is a reply to message #24993] Sun, 07 February 2010 04:50 Go to previous messageGo to previous message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
Ok, finally got it to work. I'm a bad typist. The main thing is if you use the example in the help file, you won't have an object to reference, or you will, but you'll have to pull it off the vector and I don't know if it is exposed.

I find it easier to create the ToolButton explicitly, set its attributes and add it to the ToolBar, like this:

1) Create the toolbar and button on my class spec:

ToolBar toolbarFrame;
ToolButton repeat;

2) In the callback, configure and add the button:

void toolbarFrameCallback(Bar &bar) {
repeat.WhenAction = THISBACK(RepeatSongs);
repeat.Tip("Boo!");
repeat.Image(MyImages::misc());
bar.AddMenu("Function",
MyImages::misc(),
THISBACK(MenuFn));
bar.Add(repeat);
}

3) Where ever you like, change the tip:

repeat.Tip("Hoo!");

Works fine.

I haven't got the toggle state yet, but I need it for my project.


cd7651feeb698f6ac6cec1f6deda5e5b
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: v.1952 errors
Next Topic: TopMost
Goto Forum:
  


Current Time: Wed May 14 20:25:21 CEST 2025

Total time taken to generate the page: 0.03447 seconds