Re: Where to place init code (in which event handler) needing custom widget's window mapped?



David Sillou wrote:

Marco wrote:


On Wed, 23 Mar 2005 23:40:05 +0100, David Sillou <silloudavid yahoo fr> wrote:

Hello,
I need to execute various initialization code in a derived widget; That code need to be executed only one time but it also need that widget's window is mapped since i need to perform few operation (xine related stuff) on that window (GDK object).

Could someone please tell me where is the best place to put that code?



try on_realize()
in that function call on_realize() on the parent first and then do your initialization.

Is there any available documentation that could help me to have a better idea of when and why events are fired in a typical widget's life (for example: relation between widget's state and events ) ? It's rather difficult to find out in which circumstances events are fired for a beginner; Studying xlib (and gtk) helped me but it remains obscure to me.



http://developer.gnome.org/doc/GGAD/z57.html

--
Marco



Thanks for the link.
Concerning on_realize, it's the way i tried to achieve the work (including calling base class method before any other thing) but the window I create for xine to render to:

m_window = Gdk::Window::create(get_window(), &attributes,GDK_WA_X|GDK_WA_Y);

isn't mapped yet. I verified it by calling:

std::cout <<m_window->is_viewable ()<<std::endl;

and i get a "bad drawable or bad window error" if I execute xine init functions (passing the created window as arg).


DAve


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

Hi,
After verification, it seems that I get the same error even if my custom widget's window is mapped before passing it to xine' functions...


-->The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
 (Details: serial 12 error_code 9 request_code 55 minor_code 0)

When i call the exactly same init code in a button_cliked event handler , all works fine.

I don't understand where the problem is now...

DAve.





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