Hi Robert,
yes, I changed the code a bit, but with no affect. There seems to be a
bug with Gtk::Bin or a reason I don't know. Here is a simplest-possible
testcase that confirms that it does not work (at least for me and Zhu):
#include <gtkmm.h>
class MyBin : public Gtk::Bin
{
public:
MyBin (void)
{ add(*Gtk::manage(new Gtk::Button("My Button"))); }
};
int
main (int argc, char** argv)
{
Gtk::Main kit(argc, argv);
Gtk::Window win;
win.add(*Gtk::manage(new MyBin));
win.show_all();
kit.run(win);
return 0;
}
Robert Pearce wrote:
> Hi Simon,
>
> On Sat, 13 Dec 2008 15:54:13 +0100 you wrote:
>> Actually, I have no idea why it does not work. Seems to be a problem
>> with the Gtk::Bin. I replaced it with a Box and it worked.
>>
>
> I've seen one change between your two posted versions that would explain it.
> In the working one you have:
>
>> class Window : public Gtk::Window
>> {
>> public:
>> Window()
>> {
>> add(viewer_);
>> show_all();
>> }
>> };
>
> Whereas the original had:
>
>>>>> class Window:public Gtk::Window
>>>>> {
>>>>> public:
>>>>> Window(){
>>>>> add(viewer_);
>>>>> viewer_.show();
>>>>> }
>>>>> };
>
> Comparing these extracts you'll note that the original only showed the
> viewer, and not the window itself, while the new version shows "all", meaning
> the window and all its children.
> _______________________________________________
> gtkmm-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list