Re: custom_widget example not working



* Immanuel Scheerer (scheerei in tum de) wrote:
> More precisely I want to create a SDL widget. So i have to draw it 
myself.
>
> Thanks for your answer, Murray.

I asked about creating a gtkmmsdl widget not so long ago, so I thought I 
would post you my attempt. Its available at 
http://www.bath.ac.uk/~ma2snm/gtksdl_example/ and it does what I want it 
to do. The widget should be fairly easy to use, and also works on 
windows. You have to create a timeout signal to draw to the surface 
every so often, as otherwise the sdl surface gets drawn over by gtk (how
 I understand it anyway). Something like this is fine,
 
Glib::signal_timeout().connect(sigc::mem_fun(*this, 
&MainWindow::renderView),100 );

with renderView drawing directly to the sdl surface. To allow the 
capture of events to be compatible with both windows and nix, and 
handled by gtkmm, put the widget in an eventbox. I think thats 
everything. Any questions, mail me, as well as any improvements / 
suggestions.

Thanks,

Simon



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