GTK-EventCallback and Unicode
Posted: Sun Jan 20, 2013 5:31 pm
Hope somebody can help. The following code works fine in ascii mode, but not with unicode.
What do I have to do, to make it work in unicode?
Thanks
gerd
What do I have to do, to make it work in unicode?
Code: Select all
; Wrapper to call the correct function for Gtk.
Procedure GTKSignalConnect(*Widget, Signal$, Function, user_data)
g_signal_connect_data_(*Widget, @Signal$, Function, user_data, 0, 0)
EndProcedure
; This is a signal callback. Note the CDLL declaration. that is important.
; the user_data field helps to pass additional data.
;
ProcedureCDLL EventCallback(*Widget, *Event.GdkEventCrossing, user_data)
If user_data = 1
Debug "Enter Event"
Else
Debug "Leave Event"
EndIf
EndProcedure
If OpenWindow(0,0,0,345,105,"Event Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
myButton = ButtonGadget(#PB_Any, 200, 10, 100, 30, "Test")
; connect the signals...
GTKSignalConnect(GadgetID(myButton), "enter-notify-event", @EventCallback(), 1)
GTKSignalConnect(GadgetID(myButton), "leave-notify-event", @EventCallback(), 2)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow : EndIf gerd