Re: gtkmm comments



Actually the problem comes in trying to set the icon later - I declare my 
buttons in the header:  Gtk::Button myButton;  then in the constructor I was 
trying to use myButton.set_label(...) but that method only works for a string 
so I guess I have to instatiate the button in the constructor declaring the 
icon.  The error was referring to BuiltinStockID which is where I was getting 
confused - what would be nice is to have a Button::set_Icon(...) or 
set_label(..)  method that would take the stock icon.  
John

On Thursday 17 March 2005 00:35, Timothy M. Shead wrote:
> John Taber wrote:
> > Thanks everyone for the comments and screenshots - I'm converted.
> >
> > Question though:  I cannot get stock icons to compile - I've included the
> > stock.h header and tried "Gtk::BuiltinStockID OK" as well as
> > "Gtk::BuiltStockID::OK" and even Gtk::BuiltinStockID Gtk::Stock::OK -
> > nothing seems to work - can someone help out ?  thks.
>
> I don't believe BuiltinStockID is meant to be created by client code,
> which makes sense - they're built-in.  Use Gtk::StockID if you really
> have to pass stock ids around - it has an implicit conversion from
> BuiltinStockID.  Better yet, don't store stock ID temporaries at all:
>
> mycontainer.add(*Gtk::manage(new Gtk::Button(Gtk::Stock::OK)));
>
> Cheers,
> Tim

-- 
John Taber, Ph.D.
P.O. Box 71949
Salt Lake City, UT 84171
(801)440-2831



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