Mouse events on WidowedScreen

Linux specific forum
scrat
User
User
Posts: 34
Joined: Tue Nov 25, 2008 5:00 pm

Mouse events on WidowedScreen

Post by scrat »

Hello

I try to get mouse events on a widowedscreen with gtk and opengl subsystem
I use this code

Code: Select all

CompilerCase #PB_OS_Linux

  *IdMain.GtkWidget
  *IdMain=WindowID(#Main)
   gdk_window_set_events_(*IdMain\window,#GDK_ALL_EVENTS_MASK)
  g_signal_connect_data_(WindowID(#Main), "button_release_event", @MouseUp(), #Null, #Null, #G_CONNECT_SWAPPED)
  g_signal_connect_data_(WindowID(#Main), "button_press_event", @MouseDown(), #Null, #Null, #G_CONNECT_SWAPPED)  

  CompilerEndSelect  
I get the events on the window around the screen but not on the screen

Any idea without initmouse()
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

Re: Mouse events on WidowedScreen

Post by GBeebe »

I don't know about opengl with gtk, but you can use opengl with sdl:

Screen = SDL_SetVideoMode_(width, height, depth, #SDL_OPENGL | #SDL_HWSURFACE)

Then you can get mouse and keyboards through the SDL_PollEvent
Post Reply