GTK3 on Windows 8.1: Touch Events Problem

2015-09-26 Thread Vincenzo Carletti
I'm working on a multiplatform project and I decided to use GTK3 both for
Windows and Linux because of its availability on these os.
I'm using the last distribution for windows (GTK 3.6 package) but I have
the following problem: I'm trying to handle Touch Events coming from a
touch screen but I'm not able to get them form the GTK event system.
I'm able to catch all the others events (mouse, scroll, keys) but not touch.
There is someone who can help me?

Here, there is the code I have used to create my gtk window

static GtkWidget* CreateGTKWindow(DES_VIEW* pView){
   GtkWidget *window, *scrollWindow, *table, *vbox, *hbox;
   GdkCursor *cursor;
   GtkWidget *cr;

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

   gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
   gtk_window_move(GTK_WINDOW(window), pView->m_Window.m_StartX,
pView->m_Window.m_StartY);
   gtk_window_set_default_size(GTK_WINDOW(window), pView->m_Window.m_Width,
pView->m_Window.m_Height);
   gtk_window_set_title(GTK_WINDOW(window), pView->m_Window.m_Title);
   gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
   gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK);
   gtk_widget_add_events(window, GDK_BUTTON_RELEASE_MASK);
   gtk_widget_add_events(window, GDK_SCROLL_MASK);
   gtk_widget_add_events(window, GDK_TOUCH_MASK);

   if (m_Utente == SYSTEM) {
  gtk_widget_add_events(window, GDK_KEY_PRESS_MASK);
  gtk_widget_add_events(window, GDK_KEY_RELEASE_MASK);
   }

   if (pView->TipoSelezione == SEL_INTERNA){
  pView->cursorSel = (GdkCursor*)createCursor(PATH_NAME_CURSOR,
DIM_CURSOR, window);
   }

   g_signal_connect(G_OBJECT(window), "button-press-event",
G_CALLBACK(OnMouseEvent), pView);
   g_signal_connect(G_OBJECT(window), "button-release-event",
G_CALLBACK(OnMouseEvent), pView);
   g_signal_connect(G_OBJECT(window), "scroll-event",
G_CALLBACK(OnScrollEvent), pView);
   g_signal_connect(G_OBJECT(window), "touch-event",
G_CALLBACK(OnTouchEvent), pView);

   if (m_Utente == SYSTEM) {
  g_signal_connect(G_OBJECT(window), "key-press-event",
G_CALLBACK(OnKeyEvent), pView);
  g_signal_connect(G_OBJECT(window), "key-release-event",
G_CALLBACK(OnKeyEvent), pView);
   }

   cr = gtk_drawing_area_new();
   g_signal_connect(cr, "draw", G_CALLBACK(OnExposeEvent), pView);
   gtk_widget_show(window);

   return window;

}

Best Regards
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK3 on Windows 8.1: Touch Events Problem

2015-09-26 Thread Emmanuele Bassi
Hi;

GTK 3.6 is not the latest version for Windows. We don't provide binary
packages any more, but you can use the MSYS2 project to get a build of the
latest stable version of GTK - one that is not hopelessly out of date like
3.6, which was released 3.5 years ago.

Ciao,
 Emmanuele.

On Saturday, July 25, 2015, Vincenzo Carletti  wrote:

> I'm working on a multiplatform project and I decided to use GTK3 both for
> Windows and Linux because of its availability on these os.
> I'm using the last distribution for windows (GTK 3.6 package) but I have
> the following problem: I'm trying to handle Touch Events coming from a
> touch screen but I'm not able to get them form the GTK event system.
> I'm able to catch all the others events (mouse, scroll, keys) but not
> touch.
> There is someone who can help me?
>
> Here, there is the code I have used to create my gtk window
>
> static GtkWidget* CreateGTKWindow(DES_VIEW* pView){
>GtkWidget *window, *scrollWindow, *table, *vbox, *hbox;
>GdkCursor *cursor;
>GtkWidget *cr;
>
>window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>
>gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
>gtk_window_move(GTK_WINDOW(window), pView->m_Window.m_StartX,
> pView->m_Window.m_StartY);
>gtk_window_set_default_size(GTK_WINDOW(window), pView->m_Window.m_Width,
> pView->m_Window.m_Height);
>gtk_window_set_title(GTK_WINDOW(window), pView->m_Window.m_Title);
>gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
>gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK);
>gtk_widget_add_events(window, GDK_BUTTON_RELEASE_MASK);
>gtk_widget_add_events(window, GDK_SCROLL_MASK);
>gtk_widget_add_events(window, GDK_TOUCH_MASK);
>
>if (m_Utente == SYSTEM) {
>   gtk_widget_add_events(window, GDK_KEY_PRESS_MASK);
>   gtk_widget_add_events(window, GDK_KEY_RELEASE_MASK);
>}
>
>if (pView->TipoSelezione == SEL_INTERNA){
>   pView->cursorSel = (GdkCursor*)createCursor(PATH_NAME_CURSOR,
> DIM_CURSOR, window);
>}
>
>g_signal_connect(G_OBJECT(window), "button-press-event",
> G_CALLBACK(OnMouseEvent), pView);
>g_signal_connect(G_OBJECT(window), "button-release-event",
> G_CALLBACK(OnMouseEvent), pView);
>g_signal_connect(G_OBJECT(window), "scroll-event",
> G_CALLBACK(OnScrollEvent), pView);
>g_signal_connect(G_OBJECT(window), "touch-event",
> G_CALLBACK(OnTouchEvent), pView);
>
>if (m_Utente == SYSTEM) {
>   g_signal_connect(G_OBJECT(window), "key-press-event",
> G_CALLBACK(OnKeyEvent), pView);
>   g_signal_connect(G_OBJECT(window), "key-release-event",
> G_CALLBACK(OnKeyEvent), pView);
>}
>
>cr = gtk_drawing_area_new();
>g_signal_connect(cr, "draw", G_CALLBACK(OnExposeEvent), pView);
>gtk_widget_show(window);
>
>return window;
>
> }
>
> Best Regards
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org 
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>


-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK3 on Windows 8.1: Touch Events Problem

2015-09-26 Thread Stefan Salewski
On Sat, 2015-09-26 at 19:15 +0100, Emmanuele Bassi wrote:
> Hi;
> 
> GTK 3.6 is not the latest version for Windows. We don't provide
> binary
> packages any more, but you can use the MSYS2 project to get a build
> of the
> latest stable version of GTK - one that is not hopelessly out of date
> like
> 3.6, which was released 3.5 years ago.
> 
> Ciao,
>  Emmanuele.

I have the strong feeling that most people think that 3.6 is the latest
supported version for Windows. And they are very disappointed.

You may know that I was working on the Nim Bindings for GTK3, see 
https://github.com/StefanSalewski?tab=repositories

Recently I got this:

https://github.com/StefanSalewski/nim-gtk3/issues/3

I told that man from China that versions of GTK3 > 3.6 may be available
for windows. But it seems what they see is 3.6 as binary only.

I got more such report. Can not really help, because I am using Linux
only currently.

Maybe that MSYS2 project should be made more visible for Windows users.
Most windows users seem to be using binaries only, and are afraid when
something is not binary.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list