Re: [gtkmm] Gtk::Toolbar_Helpers::RadioElem



--- RMM <morelli cs utah edu> wrote:
> I'm a little puzzled what the intended paradigm is
> for radiobuttons
> in a toolbar,  i.e. 
> Gtk::Toolbar_Helpers::RadioElem
> I must be missing something here.  This class is
> just a struct,  so
> everything about toolbar radio buttons must be
> controlled in an
> external,  non-OO way.  But where?  I can't find any
> methods
> for setting or querying the state of a toolbar radio
> button anywhere.  
> Which one in a group is initially set?  Why do these
> radio buttons 
> have a different interface and paradigm from
> ordinary radio buttons?
I cannot answer this question.

> Is there a way to attach information to the signal
> generated by a 
> click?  The only thing I can see to do is to bind a
> different callback 
> to each toolbar radio button and make some
> assumptions about how
> these buttons get set and unset.

When build the GUI, I do
m_Toolbar.tools().
push_back(RadioElem(group, "Stop", m_Images[STOP],
SigC::bind(slot(*this,&CMain_Window::on_state_changed),STOP)));
pStop_tool=&m_Toolbar.tools()[m_Toolbar.tools().size()-1];
(pstop_tool is a member variable.)
then in my on_state_changed:

Gtk::ToggleButton* button;
if(state==STOP)      
button=(Gtk::ToggleButton*)pStop_tool->get_widget();
if(!button->get_active()) return;
....

Is that what you want?

Cheers,
Dan

=====
----------------------------------------------------------
Have fun!
__________________________________________________________

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]