Hello every body out there! Thank you Marco for taking the time to dive into my code, and thank to Kjell for having try and give me some help. So, I was actually missing something. Attached is the corrected code. I guess – hope – everything is fine now. Some details about what I have done as answers to Marco’s corrections. On 25/02/2013 11:30, Dos Santos, Oliveira wrote:
A Gtk::DrawingArea is used to draw something; The realize signal is used to map into the Gtk::DrawingArea some signal/action/event/data and instantiates it....
Indeed. According to Gtkmm tutorial (<http://developer.gnome.org/gtkmm-tutorial/2.24/>), as “on_realize” is virtual, when overriding it, you do not need to connect it to the signal, as it is already done. Anyway, I have tried it and I have obtained a segmentation fault as expected. Anyway, if you look for instance to Cairo Clock (<http://developer.gnome.org/gtkmm-tutorial/2.24/sec-drawing-clock-example.html.en>), you can use the compilation constant “GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED” to make sure signal will be connected. Remembering somebody called Murphy and talking about what can turn wrong, I have used it into the code.
To set a DrawingArea in fullscreen, you must disable the main window decorations (the main window contains the DrawingArea), then maximize the window and set it as fullscreen. set_decorated(!get_decorated()); (get_decorated()) ? unmaximize() : maximize(); (get_decorated()) ? unfullscreen() : fullscreen();
So that was it! Thank you, it simply worked this way, no need to take care whether or not the window has been mapped. Anyway, to make cursor disappear, you need and use “get_window().” This function returns a non-null pointer only if the window has been realised (e.g. <http://developer.gnome.org/gtkmm/2.24/classGtk_1_1Widget.html#a403777253417c5c7653aac9e932de76b>). As a consequence, to switch into full-screen mode at initialisation, I call “realise()” before. This time, it all makes sense anyway. Problem solved! Regards. Yoann
Attachment:
lesson2.tar.gz
Description: GNU Zip compressed data