Re: Putting a image on the Gtk::Button..?



On Thu, 2010-01-28 at 21:17 +0530, sankar bose wrote:
> Hi
>  i have  a small question . Recently i experimented with some  code to
> put a image into a button, my code is given below..
> 
> Gtk::Image *m_image=new Gtk::Image("gtk-paste.png"); 
> m_Button->set_image_position(Gtk::POS_LEFT); 
> m_Button->set_image(*m_image); 
> m_image->show(); 
> show_all_children();
> 
>                                     At first the image did not show up
> at all. i hoped that the calling the show_all_children() was enough to
> display the all children but i fixed the problem when i called the
> show method of the image object .My question is that why do i have to
> call the show method isn't calling show_all_childer() enough to
> display all children ? .

It should be enough, yes, if m_Button has already been added to the
window. And m_Button.show_all() should do the same.

If not, a test case might be a good idea, though it's probably a problem
in the C API.

>                                          i am a newcomer to c++ and
> gtkmm, i have never programed gtk+ before so i dont know anything
> about gtk+ so i am very sorry if there is a easy explanation to this.


-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



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