Re: Are there such tings like custom signals?

2012-01-23 Thread Manuel Ferrero

Il 20/01/2012 18.08, Jack ha scritto:


However, that is separate from knowing that the button has been pushed,
so you can then start the communications. For this, is there any reason
to use a custom signal? Wouldn't it be easier to catch the standard
signal emitted when a button is pushed, by attaching a call-back routine?


Infact there is no need for a custom signal once you know about GIOChannel.
But my question was intended for general cases. If I need to trigger a 
complicated task when a button is pushed I'll write a callback to manage 
the standard signal in which I'll start my $COMPLEX_PROCESS then return.
The question was about how to write $COMPLEX_PROCESS: it doesn't involve 
GUI so it doesn't have any standard signal, but I'd like to have the 
signal-callback paradigm and I was wondering if GTK gives me some tool 
or if I have to rely on an external infrastructure for it.


Maybe I'm misunderstanding something: remember, I'm really new in this 
world and my questions could and probably are stupid...

--
Regards,
Manuel Ferrero
RD department

Reer SpA
Tel.  +39 011 2482215
Fax. +39 011 859867

L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe 
costituire reato.
Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve 
essere considerato
come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, 
via e-mail,
ce ne comunicasse l'errata ricezione.

The unauthorized use of this e-mail is prohibited and could constitute an 
offence.
If you are not the intended recipient of this message its contents shall be 
understood as neither
given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in 
that case.

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


Re: Are there such tings like custom signals?

2012-01-23 Thread Michael Torrie
On 01/23/2012 02:18 AM, Manuel Ferrero wrote:
 Il 20/01/2012 18.08, Jack ha scritto:
 
 However, that is separate from knowing that the button has been pushed,
 so you can then start the communications. For this, is there any reason
 to use a custom signal? Wouldn't it be easier to catch the standard
 signal emitted when a button is pushed, by attaching a call-back routine?
 
 Infact there is no need for a custom signal once you know about GIOChannel.
 But my question was intended for general cases. If I need to trigger a 
 complicated task when a button is pushed I'll write a callback to manage 
 the standard signal in which I'll start my $COMPLEX_PROCESS then return.
 The question was about how to write $COMPLEX_PROCESS: it doesn't involve 
 GUI so it doesn't have any standard signal, but I'd like to have the 
 signal-callback paradigm and I was wondering if GTK gives me some tool 
 or if I have to rely on an external infrastructure for it.

GTK indeed gives you a tool for generating your own signals.  You can
then catch them normally.

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


Re: Are there such tings like custom signals?

2012-01-23 Thread Chris Vine
On Mon, 23 Jan 2012 08:41:22 -0700
Michael Torrie torr...@gmail.com wrote:
 On 01/23/2012 02:18 AM, Manuel Ferrero wrote:
  Il 20/01/2012 18.08, Jack ha scritto:
  
  However, that is separate from knowing that the button has been
  pushed, so you can then start the communications. For this, is
  there any reason to use a custom signal? Wouldn't it be easier to
  catch the standard signal emitted when a button is pushed, by
  attaching a call-back routine?
  
  Infact there is no need for a custom signal once you know about
  GIOChannel. But my question was intended for general cases. If I
  need to trigger a complicated task when a button is pushed I'll
  write a callback to manage the standard signal in which I'll start
  my $COMPLEX_PROCESS then return. The question was about how to
  write $COMPLEX_PROCESS: it doesn't involve GUI so it doesn't have
  any standard signal, but I'd like to have the signal-callback
  paradigm and I was wondering if GTK gives me some tool or if I have
  to rely on an external infrastructure for it.
 
 GTK indeed gives you a tool for generating your own signals.  You can
 then catch them normally.

This runs the risk of being horribly misunderstood.  You don't catch
emissions from GSignal objects, you connect to them (you catch unix/C
asynchronous signals and interrupts).  And rather than generating a
GSignal, you implement a GObject which registers the signal in its
class init function to connect to, and emit on the signal.

But the OP's reference to GIOChannels (which don't use GSignals) may
indicate that he wants something different, namely to execute an event
in a glib main loop.  g_idle_add() is available for that.

Chris
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Are there such tings like custom signals?

2012-01-20 Thread Manuel Ferrero
I'm learning GTK+ and I was able to write, compile and run a simple code 
on my win32 PC to create a window with a button in it and monitor with a 
callback if the user presses the button.
I learned that GTK+ reacts to user events signalling on the object that 
received the event.


Now I'd like to execute some custom code when the button is pressed, 
i.e. I'd like to open a COM port and send some strings on it and then 
wait for an answer.
I was wondering if there is some custom signal I can use to keep the 
same event-driven philosophy to exchange messages between process.


Maybe the question is not well placed, I'm really newbie on this 
programmation style, I'm an embedded C developer so I don't know a lot 
about GUI and OSes...


TIA

GTK+ 2.24.8
Windows XP
--
Regards,
Manuel Ferrero
RD department

Reer SpA
Tel.  +39 011 2482215
Fax. +39 011 859867

L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe 
costituire reato.
Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve 
essere considerato
come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, 
via e-mail,
ce ne comunicasse l'errata ricezione.

The unauthorized use of this e-mail is prohibited and could constitute an 
offence.
If you are not the intended recipient of this message its contents shall be 
understood as neither
given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in 
that case.

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


Re: Are there such tings like custom signals?

2012-01-20 Thread Igor Chetverovod
Hi Manuel,

Please see  glibGIOChannel.  It is  unified way  to make  I/O data
from  files, sockets an so on.
I am using it for Ethernet sockets under win32.

Best regars,
Igor

2012/1/20, Manuel Ferrero mferr...@reer.it:
 I'm learning GTK+ and I was able to write, compile and run a simple code
 on my win32 PC to create a window with a button in it and monitor with a
 callback if the user presses the button.
 I learned that GTK+ reacts to user events signalling on the object that
 received the event.

 Now I'd like to execute some custom code when the button is pressed,
 i.e. I'd like to open a COM port and send some strings on it and then
 wait for an answer.
 I was wondering if there is some custom signal I can use to keep the
 same event-driven philosophy to exchange messages between process.

 Maybe the question is not well placed, I'm really newbie on this
 programmation style, I'm an embedded C developer so I don't know a lot
 about GUI and OSes...

 TIA

 GTK+ 2.24.8
 Windows XP
 --
 Regards,
 Manuel Ferrero
 RD department

 Reer SpA  
 Tel.  +39 011 2482215
 Fax. +39 011 859867

 L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe
 costituire reato.
 Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve
 essere considerato
 come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati
 se, via e-mail,
 ce ne comunicasse l'errata ricezione.

 The unauthorized use of this e-mail is prohibited and could constitute an
 offence.
 If you are not the intended recipient of this message its contents shall be
 understood as neither
 given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately
 in that case.

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

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


Re: Are there such tings like custom signals?

2012-01-20 Thread Michael Torrie
On 01/20/2012 06:42 AM, Manuel Ferrero wrote:
 I was wondering if there is some custom signal I can use to keep the 
 same event-driven philosophy to exchange messages between process.

Of course.  Though the other poster's idea of using gio channels is a
good one.  But yes you can create custom signals and emit them.

http://developer.gnome.org/gtk/stable/gtk-Signals.html
http://stackoverflow.com/questions/1557025/create-and-emit-gtk-signal
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Are there such tings like custom signals?

2012-01-20 Thread Jack

On 2012.01.20 11:36, Michael Torrie wrote:

On 01/20/2012 06:42 AM, Manuel Ferrero wrote:
I was wondering if there is some custom signal I can use to keep the  
same event-driven philosophy to exchange messages between process.


Of course.  Though the other poster's idea of using gio channels is a  
good one.  But yes you can create custom signals and emit them.


http://developer.gnome.org/gtk/stable/gtk-Signals.html
http://stackoverflow.com/questions/1557025/create-and-emit-gtk-signal


Aren't there two separate issue here?  Using gio channels is a way to  
deal with communicating with the COM channel.


However, that is separate from knowing that the button has been pushed,  
so you can then start the communications.  For this, is there any  
reason to use a custom signal?  Wouldn't it be easier to catch the  
standard signal emitted when a button is pushed, by attaching a  
call-back routine?

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