Re: Gtk::Button set_image()/ how can I put a Gdk::DrawingArea into the same window as other widgets?



>Well, I don't think there is a ready-made method for it.  Most of the
>time, you'd just destroy the HBox.

You can empty a box using the boxlist.  It's a STL type list attached to the box that contains its widgets, with the expected methods.
Gtk::Box_Helpers::BoxList PClist = m_PC_data.children();
            Gtk::Box_Helpers::BoxList::iterator PCiterbegin= PClist.begin();
            Gtk::Box_Helpers::BoxList::iterator PCiterend= PClist.end();
            if(PCiterbegin != PCiterend){
                PCdata.erase(PCiterbegin, PCiterend);
            }

On an unrelated topic, can a Gdk::DrawingArea be put inside another widget?  For example, the clock in the docs works fine as a standalone program.  If I try to put it inside a Frame, the program fails to draw the clock.  For instance, changing the main.cc in the clock example to

#include "clock.cc"
#include <gtkmm/main.h>
#include <gtkmm/window.h>
#include <gtkmm/frame.h>

int main(int argc, char** argv)
{
   Gt
k::Main kit(argc, argv);

   Gtk::Window win;
   Gtk::Frame frame;
   win.set_title("Cairomm Clock");
   Clock c;
   /*win.add(c);*/
   win.add(frame);
   frame.add(c);

   c.show();

   Gtk::Main::run(win);

   return 0;
}
results in an empty box.
I'm guessing the on_expose_event() that is used in the manual as the only method for initiating the drawing process is hidden if it's not called on a top- level window, but I can't see a work-around.  Can I pass the event to the Window somehow?

Ian


Generally, rearranging widgets is sometimes necessary, but overall it's
definitely one of the rarer operations an application usually performs.
I think that in your case, you probably shouldn't change the Gtk::Image
widgets at all, but instead just set a different pixbuf to display.



_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Need a Holiday? Win a $10,000 Holiday of your choice. Enter now..

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