Re: bells and whistle in Gtkmm



You have been already explained that the way to acquire a Gdk::Display to use is to either use:

Gdk::Display::get_default ()  (C API: gdk_display_get_default() )
which will get the default Gtk+ display (which is the one on which your application is running/connected to)

or

Gdk::Display::open() (C API: gdk_display_open() )
To open a specific display e.g. ":1" or ":3" or "localhost:5"

There is certainly no need to derive from Gdk::Display to achieve what you want to do.


Sun, Dec 7, 2008 at 6:15 PM, Jam <arbolone gmail com> wrote:
Yah! as in the message below, there is a problem here, obviously the writer did not want this class to be used directly. So what I have done is derive a class from it, and that solve the problem!
namespace hamd
class Display : virtual public Gdk::Display{
 public: Display(){}

};
}

#include <gdkmm/display.h>
class SomeClass{
public:
    hamd::Display display;

    void someMethod();
};
---------\
void SomeClass::someMethod(){
        display.beep();
}




Jamiil wrote:
Thanks Mohamed for the help!
I read the documentation and it is exactly what I am looking for and more.
However, the compiler complains saying that Display() is protected and in Gdk::Display::Display *is a 'protected' method (?)
What can I do to fix this problem?

Thanks
-------
#include <gdkmm/display.h>
class SomeClass{
...
public:
...Gdk::Display display;
 void someMethod();
};
---------\
void SomeClass::someMethod(){
display.beep();
}




--
Know this... God will move heavens and earth to do what you cannot do and that He will not for something you can.

Happiness has many doors, and when one of them closes another opens, yet we spent so much time looking at the one that is shut that we don't see the one that just opened..

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



--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]


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