Re: About Gtk::Bin?
- From: Simon Fuhrmann <simonfuhrmann gmx de>
- To: Robert Pearce <rob bdt-home demon co uk>
- Cc: gtkmm-list gnome org
- Subject: Re: About Gtk::Bin?
- Date: Sun, 14 Dec 2008 13:30:33 +0100
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
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]