Re: Contribution: portuguese translation for GTK+ 2.0 Tutorial

2010-09-30 Thread frederico schardong
Hi Peter,

My name is Frederico and I'm from Brazil too. I work with GTK+ from some
years, I can work with you to create a Portuguese documentation or tutorial
to GTK+ 3. As Emmanuele say, is more desirable to us work on GTK+ 3
documentation instead GTK+ 2.

Please, contact me privately for more details.

2010/9/30 Emmanuele Bassi eba...@gmail.com

 On Wed, 2010-09-29 at 23:47 -0300, Peter Jandl Jr. wrote:


  Considering this, I would like to contribute to the GTK+ project with
  the translation of the GTK+2.0 tutorial to brazilian portuguese.
 
 
  May I do this work?

 generally, you don't have to ask for permission.

 for the tutorial, though, you have to realize that the source document
 is pretty much outdated. I wouldn't use it as an authoritative source
 except for the first couple of chapters - the hello world example and
 the box packing theory. everything else is hopelessly out of date, and
 showcases deprecated API.

 I wouldn't want you to waste time on a document that is most likely to
 go away when we release gtk+ 3.0.

 my personal suggestion is to write some new, introductory documentation
 in Portuguese. you might take bits and pieces of the tutorial as a
 starting point.

 ciao,
  Emmanuele.

 --
 W: http://www.emmanuelebassi.name
 B: http://blogs.gnome.org/ebassi

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




-- 
Thanks,
Frederico Schardong,
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Invitation to connect on LinkedIn

2010-06-16 Thread Frederico Schardong
LinkedIn
Frederico Schardong requested to add you as a connection on 
LinkedIn:
--

David Christian,

I'd like to add you to my professional network on LinkedIn.

- Frederico

Accept invitation from Frederico Schardong
http://www.linkedin.com/e/vwOBiyxfgiJSwN6Ctt8mDexxU95ZSV6nVZHx8Z/blk/I2127142107_2/1BpC5vrmRLoRZcjkkZt5YCpnlOt3RApnhMpmdzgmhxrSNBszYOnPsMcj8QcjsOcj99bQxVe6xipzxvbPoPd3wNdj0VcP4LrCBxbOYWrSlI/EML_comm_afe/

View invitation from Frederico Schardong
http://www.linkedin.com/e/vwOBiyxfgiJSwN6Ctt8mDexxU95ZSV6nVZHx8Z/blk/I2127142107_2/39vdP0NczgNdP8NcAALqnpPbOYWrSlI/svi/
 
--

DID YOU KNOW LinkedIn can help you find the right service providers using 
recommendations from your trusted network? Using LinkedIn Services, you can 
take the risky guesswork out of selecting service providers by reading the 
recommendations of credible, trustworthy members of your network. 
http://www.linkedin.com/e/svp/inv-25/

 
--
(c) 2010, LinkedIn Corporation___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: popup and popdown signal of GtkScaleButton

2010-06-09 Thread frederico schardong
It works, but popdown is only emitted in the second time that I press
Escape. In other words..: I press Enter to show the scale widget, this
shot the signal popup. When I press Escape to hide the scale widget
and emit the popdown signal, the scale widget is hidden, but the
signal isn't emitted. To emit the signal popdown, I must press Escape
again.

Is this a bug? My GTK+ version is 2.20.1

2010/6/8 Tadej Borovšak tadeb...@gmail.com:
 Hello.

 I have tried to use the signals popup and popdown of the
 GtkScaleButton but they aren't triggered.

 Both of those signals are key binding signals that get emitted when
 user presses the right button while scale button has focus (try
 focusing scale button on your sample application and press space).

 Tadej

 --
 Tadej Borovšak
 tadeboro.blogspot.com
 tadeb...@gmail.com
 tadej.borov...@gmail.com




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


popup and popdown signal of GtkScaleButton

2010-06-07 Thread frederico schardong
Hi all,

I have tried to use the signals popup and popdown of the
GtkScaleButton but they aren't triggered.

Simple example:

#include gtk/gtk.h

void popup(GtkScaleButton *button, gpointer user_data)
{
g_print(\npopup);
}

int main(int argc, char *argv[])
{
GtkWidget *window, *scaleButton;
gtk_init(argc, argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
scaleButton = gtk_scale_button_new(GTK_ICON_SIZE_LARGE_TOOLBAR, 0,
1, 0.1, NULL);
g_signal_connect(G_OBJECT(scaleButton), popup, G_CALLBACK(popup), NULL);
gtk_container_add(GTK_CONTAINER(window), scaleButton);
gtk_widget_show_all(window);
gtk_main();
return 0;
}

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Erro with key-press-event signal

2010-05-31 Thread frederico schardong
Hi all,

I have a window with a callback to resolve the key-press-event
signal. The callback is:

gboolean alterCurrentTab(GtkWidget widget, GdkEventKey *event,
gpointer user_data)
{
g_print(\nkey: %s - %d - %lu, gdk_keyval_name(event-keyval),
event-state, event-hardware_keycode);
return FALSE;
}

The problem is that the return is always:
key: (null) - -15694833 - 51081

Obs: I'm using the gtk_widget_set_events(window, GDK_KEY_PRESS_MASK);
on this window.

What I'm doing wrong?

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Erro with key-press-event signal

2010-05-31 Thread frederico schardong
Just a attention error, thank you.

2010/5/31 David Nečas y...@physics.muni.cz:
 On Mon, May 31, 2010 at 09:47:26AM -0300, frederico schardong wrote:
 I have a window with a callback to resolve the key-press-event
 signal. The callback is:

 gboolean alterCurrentTab(GtkWidget widget, GdkEventKey *event,
 gpointer user_data)
 {
     g_print(\nkey: %s - %d - %lu, gdk_keyval_name(event-keyval),
 event-state, event-hardware_keycode);
     return FALSE;
 }

 The problem is that the return is always:
 key: (null) - -15694833 - 51081

 Obs: I'm using the gtk_widget_set_events(window, GDK_KEY_PRESS_MASK);
 on this window.

 What I'm doing wrong?

 If you really declare the first argument as GtkWidget widget instead of
 GtkWidget *widget then you get complete rubbish in the function
 arguments.

 Yeti





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


GtkScaleButton missing method

2010-05-30 Thread frederico schardong
Hi all,

Why the GtkScaleButton don't have a function to get the value of the
property icons?

All the properties as I saw have a get and set function, this is the
first time that I see this. Have a special reason to this?

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
The error is:

error: Canal termina num caractere parcial

This means Channel ending in a partial character.

2010/5/27 Robert Pearce r...@bdt-home.demon.co.uk:
 Hi frederico,

 On Thu, 27 May 2010 11:02:47 -0300 you wrote:
  Why don't you test the error returns?
 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

 It causes segmentation fault. What I'm doing wrong here?

 You're not testing the error return. If the g_io_channel_read_to_end 
 completes without error, then it doesn't change 'b', so the printf is doing a 
 de-reference of a NULL pointer. You should change it to :

 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\n, string, size );
 if ( b )
    g_print(error: %s\n, b-message);
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
This is very strange. Yesterday I have got 998 characters from the
g_io_channel_read_to_end, but today I have compiled with and without
the if to show the error, but every time I'm getting 0 characters from
the channel! I don't know what can cause it, because nothing has been
changed unless the if.

2010/5/28 frederico schardong frede@gmail.com:
 The error is:

 error: Canal termina num caractere parcial

 This means Channel ending in a partial character.

 2010/5/27 Robert Pearce r...@bdt-home.demon.co.uk:
 Hi frederico,

 On Thu, 27 May 2010 11:02:47 -0300 you wrote:
  Why don't you test the error returns?
 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

 It causes segmentation fault. What I'm doing wrong here?

 You're not testing the error return. If the g_io_channel_read_to_end 
 completes without error, then it doesn't change 'b', so the printf is doing 
 a de-reference of a NULL pointer. You should change it to :

 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\n, string, size );
 if ( b )
    g_print(error: %s\n, b-message);
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
As I talked later, my channel receives the output of a php script, in
those script I have:

echo | . utf8_encode($r) . ;

I have changed the utf8_encode to base64_encode and my channel don't
crash. What's the matter with utf8?

2010/5/28 frederico schardong frede@gmail.com:
 This is very strange. Yesterday I have got 998 characters from the
 g_io_channel_read_to_end, but today I have compiled with and without
 the if to show the error, but every time I'm getting 0 characters from
 the channel! I don't know what can cause it, because nothing has been
 changed unless the if.

 2010/5/28 frederico schardong frede@gmail.com:
 The error is:

 error: Canal termina num caractere parcial

 This means Channel ending in a partial character.

 2010/5/27 Robert Pearce r...@bdt-home.demon.co.uk:
 Hi frederico,

 On Thu, 27 May 2010 11:02:47 -0300 you wrote:
  Why don't you test the error returns?
 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

 It causes segmentation fault. What I'm doing wrong here?

 You're not testing the error return. If the g_io_channel_read_to_end 
 completes without error, then it doesn't change 'b', so the printf is doing 
 a de-reference of a NULL pointer. You should change it to :

 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\n, string, size );
 if ( b )
    g_print(error: %s\n, b-message);
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
I resolved part of the problem. The encoding problem was resolved with
base64 encoding between PHP and C. Now the problem is the same of the
first mail, the received string just have 998 characters. The
g_io_channel_read_to_end( channel, string, size, erro ); don't show
any errors.  I also have tried the g_io_channel_read_line but the
limit of 998 characters happen again.

So, why I have this limit?

Here is a log of the received contend:

 received in base64:
bG9naW4gVFJVRXw=Mjc=fDM3MzY=fFRyZWluYW1lbnRvL1F1YWxpZmljYcOnw6NvIE1pb2xvfERpdmVyc29zIC0gRGV2ZWw=fEJhbmNvfDEwMDY=fDc0NjowNzowMA==fDExNzE=fDQxMTU=fFRyYWJhbGhhciBTb2xpcyAtIEFwcmVuZGl6YWdlbQ==fERpdmVyc29zIC0gRGV2ZWw=fDE1MDA6MDA6MDA=fDEwMDY=fDEwMDc6NTE6MDA=fDExNzE=fDM4NDQ=fEVzdHVkbyBGZXJyYW1lbnRhcyBNaW9sbw==fERpdmVyc29zIC0gRGV2ZWw=fEJhbmNvfDEwMDY=fDEzOTY6NDY6MDA=fDExNzE=fDM3MzE=fFRyYWJhbGhhciBuYSBTb2xpcyAtIERldmVsfERpdmVyc29zIC0gRGV2ZWw=fDEwMDA6MDA6MDAuMDAwMDAyfDEwMDY=fDMyMDo1NzowMA==fDExNzE=fDM1OTQ=fE1hbnV0ZW7Dp8OjbyBTaXN0ZW1hcyBJbnRlcm5vcw==fERpdmVyc29zIC0gU09MSVM=fEJhbmNvfDEwMDY=fDE4NTU6NTk6MDA=fDkyNg==fDQxNzI=fFRlc3Rlcw==fE1hcmF0b25hIDIwMDk=fDQwOjAwOjAwfDEwNDU=fDE1OjMwOjAwfDEyNDk=fDQxNzQ=fERpc3BvbmliaWxpemHDp8OjbyBkb3MgRm9ybXVsw6FyaW9zfEF2YWxpYcOnw6NvIEluc3RpdHVjaW9uYWwgMjAwOUE=fDUwOjAwOjAwfDEwNDU=fDMyOjA1OjAwfDEyNDg=fDQxNzY=fERlc2Vudm9sdmltZW50byBlIFJlZXN0cnV0dXJhw6fDo28gZG9zIEZvcm11bMOhcmlvcw==fEF2YWxpYcOnw6NvIEluc3RpdHVjaW9uYWwgMjAwOUE=fDEwMDowMDowMA==fDEwNDU=fDkyOjQwOjAwfDEyNDg=fD
size: 998


translated to utf8: login TRUE|27|3736|Treinamento/Qualificação
Miolo|Diversos - Devel|Banco|1006|746:07:00|1171|4115|Trabalhar Solis
- Aprendizagem|Diversos -
Devel|1500:00:00|1006|1007:51:00|1171|3844|Estudo Ferramentas
Miolo|Diversos - Devel|Banco|1006|1396:46:00|1171|3731|Trabalhar na
Solis - Devel|Diversos -
Devel|1000:00:00.02|1006|320:57:00|1171|3594|Manutenção Sistemas
Internos|Diversos -
SOLIS|Banco|1006|1855:59:00|926|4172|Testes|Maratona
2009|40:00:00|1045|15:30:00|1249|4174|Disponibilização dos
Formulários|Avaliação Institucional
2009A|50:00:00|1045|32:05:00|1248|4176|Desenvolvimento e
Reestruturação dos Formulários|Avaliação Institucional
2009A|100:00:00|1045|92:40:00|1248
size: 692

2010/5/28 frederico schardong frede@gmail.com:
 As I talked later, my channel receives the output of a php script, in
 those script I have:

 echo | . utf8_encode($r) . ;

 I have changed the utf8_encode to base64_encode and my channel don't
 crash. What's the matter with utf8?

 2010/5/28 frederico schardong frede@gmail.com:
 This is very strange. Yesterday I have got 998 characters from the
 g_io_channel_read_to_end, but today I have compiled with and without
 the if to show the error, but every time I'm getting 0 characters from
 the channel! I don't know what can cause it, because nothing has been
 changed unless the if.

 2010/5/28 frederico schardong frede@gmail.com:
 The error is:

 error: Canal termina num caractere parcial

 This means Channel ending in a partial character.

 2010/5/27 Robert Pearce r...@bdt-home.demon.co.uk:
 Hi frederico,

 On Thu, 27 May 2010 11:02:47 -0300 you wrote:
  Why don't you test the error returns?
 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

 It causes segmentation fault. What I'm doing wrong here?

 You're not testing the error return. If the g_io_channel_read_to_end 
 completes without error, then it doesn't change 'b', so the printf is 
 doing a de-reference of a NULL pointer. You should change it to :

 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\n, string, size );
 if ( b )
    g_print(error: %s\n, b-message);
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
Well there is nothing in Glib that limits data to 998, it just keeps
reading and extending the buffer until it gets EOF.  Better look at
the PHP side some more and how you are transferring the data.

Can't be this because I have substitute my script for a echo with
thousands of letters and just 998 have been read by
g_io_channel_read_line and g_io_channel_read_end.

Anyone have one more idea?

Cheers
Lex

2010/5/28 frederico schardong frede@gmail.com:
 I resolved part of the problem. The encoding problem was resolved with
 base64 encoding between PHP and C. Now the problem is the same of the
 first mail, the received string just have 998 characters. The
 g_io_channel_read_to_end( channel, string, size, erro ); don't show
 any errors.  I also have tried the g_io_channel_read_line but the
 limit of 998 characters happen again.

 So, why I have this limit?

 Here is a log of the received contend:

  received in base64:
 bG9naW4gVFJVRXw=Mjc=fDM3MzY=fFRyZWluYW1lbnRvL1F1YWxpZmljYcOnw6NvIE1pb2xvfERpdmVyc29zIC0gRGV2ZWw=fEJhbmNvfDEwMDY=fDc0NjowNzowMA==fDExNzE=fDQxMTU=fFRyYWJhbGhhciBTb2xpcyAtIEFwcmVuZGl6YWdlbQ==fERpdmVyc29zIC0gRGV2ZWw=fDE1MDA6MDA6MDA=fDEwMDY=fDEwMDc6NTE6MDA=fDExNzE=fDM4NDQ=fEVzdHVkbyBGZXJyYW1lbnRhcyBNaW9sbw==fERpdmVyc29zIC0gRGV2ZWw=fEJhbmNvfDEwMDY=fDEzOTY6NDY6MDA=fDExNzE=fDM3MzE=fFRyYWJhbGhhciBuYSBTb2xpcyAtIERldmVsfERpdmVyc29zIC0gRGV2ZWw=fDEwMDA6MDA6MDAuMDAwMDAyfDEwMDY=fDMyMDo1NzowMA==fDExNzE=fDM1OTQ=fE1hbnV0ZW7Dp8OjbyBTaXN0ZW1hcyBJbnRlcm5vcw==fERpdmVyc29zIC0gU09MSVM=fEJhbmNvfDEwMDY=fDE4NTU6NTk6MDA=fDkyNg==fDQxNzI=fFRlc3Rlcw==fE1hcmF0b25hIDIwMDk=fDQwOjAwOjAwfDEwNDU=fDE1OjMwOjAwfDEyNDk=fDQxNzQ=fERpc3BvbmliaWxpemHDp8OjbyBkb3MgRm9ybXVsw6FyaW9zfEF2YWxpYcOnw6NvIEluc3RpdHVjaW9uYWwgMjAwOUE=fDUwOjAwOjAwfDEwNDU=fDMyOjA1OjAwfDEyNDg=fDQxNzY=fERlc2Vudm9sdmltZW50byBlIFJlZXN0cnV0dXJhw6fDo28gZG9zIEZvcm11bMOhcmlvcw==fEF2YWxpYcOnw6NvIEluc3RpdHVjaW9uYWwgMjAwOUE=fDEwMDowMDowMA==fDEwNDU=fDkyOjQwOjAwfDEyNDg=fD
 size: 998


 translated to utf8: login TRUE|27|3736|Treinamento/Qualificação
 Miolo|Diversos - Devel|Banco|1006|746:07:00|1171|4115|Trabalhar Solis
 - Aprendizagem|Diversos -
 Devel|1500:00:00|1006|1007:51:00|1171|3844|Estudo Ferramentas
 Miolo|Diversos - Devel|Banco|1006|1396:46:00|1171|3731|Trabalhar na
 Solis - Devel|Diversos -
 Devel|1000:00:00.02|1006|320:57:00|1171|3594|Manutenção Sistemas
 Internos|Diversos -
 SOLIS|Banco|1006|1855:59:00|926|4172|Testes|Maratona
 2009|40:00:00|1045|15:30:00|1249|4174|Disponibilização dos
 Formulários|Avaliação Institucional
 2009A|50:00:00|1045|32:05:00|1248|4176|Desenvolvimento e
 Reestruturação dos Formulários|Avaliação Institucional
 2009A|100:00:00|1045|92:40:00|1248
 size: 692

 2010/5/28 frederico schardong frede@gmail.com:
 As I talked later, my channel receives the output of a php script, in
 those script I have:

 echo | . utf8_encode($r) . ;

 I have changed the utf8_encode to base64_encode and my channel don't
 crash. What's the matter with utf8?

 2010/5/28 frederico schardong frede@gmail.com:
 This is very strange. Yesterday I have got 998 characters from the
 g_io_channel_read_to_end, but today I have compiled with and without
 the if to show the error, but every time I'm getting 0 characters from
 the channel! I don't know what can cause it, because nothing has been
 changed unless the if.

 2010/5/28 frederico schardong frede@gmail.com:
 The error is:

 error: Canal termina num caractere parcial

 This means Channel ending in a partial character.

 2010/5/27 Robert Pearce r...@bdt-home.demon.co.uk:
 Hi frederico,

 On Thu, 27 May 2010 11:02:47 -0300 you wrote:
  Why don't you test the error returns?
 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

 It causes segmentation fault. What I'm doing wrong here?

 You're not testing the error return. If the g_io_channel_read_to_end 
 completes without error, then it doesn't change 'b', so the printf is 
 doing a de-reference of a NULL pointer. You should change it to :

 GError *b = NULL;

 g_io_channel_read_to_end( channel, string, size, b);

 g_print(returned: %s\nsize: %d\n, string, size );
 if ( b )
    g_print(error: %s\n, b-message);
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582

Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-28 Thread frederico schardong
Problem solved. I have a very very simple and noob error in my code.
GLib and PHP script works right.

Thanks to all!

2010/5/28 Tadej Borovšak tadeb...@gmail.com:
 Hi.

Well there is nothing in Glib that limits data to 998, it just keeps
reading and extending the buffer until it gets EOF.  Better look at
the PHP side some more and how you are transferring the data.

 Can't be this because I have substitute my script for a echo with
 thousands of letters and just 998 have been read by
 g_io_channel_read_line and g_io_channel_read_end.

 Have you tried substituting your PHP script with some other source of
 data? Or maybe try reading data in chunks of 100 chars to see if this
 makes any difference.

 Tadej

 --
 Tadej Borovšak
 tadeboro.blogspot.com
 tadeb...@gmail.com
 tadej.borov...@gmail.com




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


g_io_channel_read_to_end read just 998 chars, not more

2010-05-27 Thread frederico schardong
Hi all,

I'm reading a string from a GIOChannel, I'm using
g_io_channel_read_to_end to read it, but it read just 998 chars, is
there a function limitation or what?

g_io_channel_read_to_end( channel, string, size, NULL );
g_print(returned: %s\nsize: %d, string, size);

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_io_channel_read_to_end read just 998 chars, not more

2010-05-27 Thread frederico schardong
 What system, what version of glib?
Ubuntu 9.10 64 bits, Kernel: 2.6.31-17-generic. Glib version is 2.22.3

 Why don't you test the error returns?
GError *b = NULL;

g_io_channel_read_to_end( channel, string, size, b);

g_print(returned: %s\nsize: %d\nerror: %s, string, size, b-message);

It causes segmentation fault. What I'm doing wrong here?

2010/5/27 Lex Trotman ele...@gmail.com:
 On 27 May 2010 21:59, frederico schardong frede@gmail.com wrote:
 Hi all,

 I'm reading a string from a GIOChannel, I'm using
 g_io_channel_read_to_end to read it, but it read just 998 chars, is
 there a function limitation or what?

 What system, what version of glib?

 g_io_channel_read_to_end( channel, string, size, NULL );

 Why don't you test the error returns?

 Cheers
 Lex

 g_print(returned: %s\nsize: %d, string, size);

 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: is popen thread safe?

2010-05-14 Thread frederico schardong
LiNuCe,

I have tried the the g_spawn_command_line_sync, the simple version of
g_spawn_sync, but it work as the popen.

I have attached a example of what I'm trying to do. As you can see, in
this example I have two threads, and in the thread_func I have the
g_spawn_command_line_sync that call a soap php script that get
informations of a user on my intranet web server. The problem is that
when the g_spawn_command_line_sync is called the multi thread system
is broken, the other thread is stopped and waits for this thread ends!
This is the same problem with the popen, the others threads are
stopped and waits for the soap thread end.

Someone can help me? I don't know why this is happen...

2010/5/8 LiNuCe lin...@gmail.com:
 I'm trying to add the popen in a thread (using g_thread_create()) but
 it keep frozen my application. So, is popen thread safe? there is
 another simple alternative if it isn't?

 Try GLib's simple, portable alternative :

  http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html#g-spawn-sync




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
/* Compile me with:
 *  gcc -o sample3 sample3.c $(pkg-config --cflags --libs gtk+-2.0 gthread-2.0)
 */
#include gtk/gtk.h

static gpointer
thread_func( gpointer data )
{
while( TRUE )
{
usleep( 50 );

gdk_threads_enter();
gchar *my_stderr = NULL;
gchar *my_stdout = NULL;
GError *my_error = NULL;
gint my_return_value;


if( !g_spawn_command_line_sync(php5 /home/frederico/Desktop/xponto/xponto_C/classes/soap/soap.php loginf user passord, my_stdout, NULL, NULL, NULL))
{
printf(I could not run the command\n);
}
else
{
// command worked
printf(STDOUT:\n%s\n\n, my_stdout);
}
gdk_threads_leave();
}

return( NULL );
}

static gpointer
thread_func1( gpointer data )
{
while( TRUE )
{
sleep( 1 );

gdk_threads_enter();
g_print(\nbb);
gdk_threads_leave();
}

return( NULL );
}

int
main( intargc,
char **argv )
{
GThread   *thread, *th;
GError*error = NULL;

/* Secure glib */
if( ! g_thread_supported() )
g_thread_init( NULL );

/* Secure gtk */
gdk_threads_init();

/* Obtain gtk's global lock */
gdk_threads_enter();

/* Do stuff as usual */
gtk_init( argc, argv );

/* Create new thread */
thread = g_thread_create( thread_func, NULL,
FALSE, error );
if( ! thread )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

/* Create new thread */
th = g_thread_create( thread_func1, NULL,
FALSE, error );
if( ! th )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

gtk_main();

/* Release gtk's global lock */
gdk_threads_leave();

return( 0 );
}
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: is popen thread safe?

2010-05-13 Thread frederico schardong
Hi Pádraig,

Can you explain in details what is going on in this commit? Sorry, but
I don't understand.

2010/5/13 Pádraig Brady p...@draigbrady.com:
 On 06/05/10 20:51, frederico schardong wrote:
 Hi all,

 I'm trying to add the popen in a thread (using g_thread_create()) but
 it keep frozen my application. So, is popen thread safe? there is
 another simple alternative if it isn't?

 Well it used to lock up ages ago, but that was fixed.
 http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=34183f57

 cheers,
 Pádraig.




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: is popen thread safe?

2010-05-13 Thread frederico schardong
If it was fixed, why isn't working right?

Have you tested it? Do you have some functional example?

2010/5/13 Pádraig Brady p...@draigbrady.com:
 On 13/05/10 15:17, frederico schardong wrote:
 Hi Pádraig,

 Can you explain in details what is going on in this commit? Sorry, but
 I don't understand.

 http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=34183f57

 For more context see:
 http://www.pixelbeat.org/patches/glibc_threading_bug.txt

 In summary popen() should be thread safe unless it has regressed.
 Note also the e flag, mentioned elsewhere in this thread.

 cheers,
 Pádraig.




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: is popen thread safe?

2010-05-06 Thread frederico schardong
Do you have a example of this?

2010/5/6 Max Kellermann m...@duempel.org:
 On 2010/05/06 21:51, frederico schardong frede@gmail.com wrote:
 I'm trying to add the popen in a thread (using g_thread_create()) but
 it keep frozen my application. So, is popen thread safe? there is
 another simple alternative if it isn't?

 popen() is not thread safe, unless you use the GNU specific option e
 for enabling close-on-exec.  But that causes just fd leaks, and is
 probably unrelated to a possible freeze (unless the sub process drains
 the fd).

 Max




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: future GTK+ rendering to browser

2010-04-07 Thread frederico schardong
Hi all,

Is possible develop complex web systems with this API? Complex as PHP/AJAX/JS.

2010/4/6 Michael Torrie torr...@gmail.com:
 On 04/05/2010 08:34 AM, shakil anwar wrote:
 Is there anyone working on or planning to create a way to render GTK+
 UI's in a browser ? The benefits would be :

 In practice conventional desktop apps don't translate directly to the
 web very well, even with things like ajax.  Hence you're unlikely to
 ever see a version of GTK that targets a web browser.

 A far better solution is to write apps in a modular, flexible way, with
 a clear delineation between front end and back end.  That way you can
 easily move your app between platforms, UI tool kits, and even to the
 web by writing a web UI that accesses your backend code via an exposed
 service.
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Identi.ca and twitter GTK+ accounts

2010-02-22 Thread frederico schardong
Cool

2010/2/22 Javier Jardón jjar...@gnome.org:
 Hello all,

 An identi.ca [1] and twitter [2] accounts have been created.

 The account is managed by aruiz (Alberto Ruiz) and me, but if any GTK+
 devel want to have permissions, please tell us.

 Stay tunned!

 [1] http://identi.ca/gtktoolkit
 [2] http://twitter.com/gtktoolkit

 --
 Javier Jardón Cabezas
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Function gtk_window_get_mnemonics_visible since what version?

2010-02-12 Thread frederico schardong
Hi,

I take a look at the documentation of the function
gtk_window_get_mnemonics_visible() and I see that it is null.
http://library.gnome.org/devel/gtk/unstable/GtkWindow.html#gtk-window-get-mnemonics-visible

Is this function in development? Is this function in what version of GTK+?

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Function gtk_window_get_mnemonics_visible since what version?

2010-02-12 Thread frederico schardong
Thanks!

2010/2/12 Jonh Wendell jwend...@gnome.org:
 Em Sex, 2010-02-12 às 13:23 -0200, frederico schardong escreveu:
 Hi,

 I take a look at the documentation of the function
 gtk_window_get_mnemonics_visible() and I see that it is null.
 http://library.gnome.org/devel/gtk/unstable/GtkWindow.html#gtk-window-get-mnemonics-visible

 Is this function in development? Is this function in what version of GTK+?


 It was introduced in 2.19 (unstable) cycle[1]. Perhaps you might want to
 look at stable documentation instead of unstable.

 [1]-http://mail.gnome.org/archives/gtk-list/2009-December/msg00134.html

 Cheers,
 --
 Jonh Wendell
 http://www.bani.com.br





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Trying to add a page to a notebook

2010-02-03 Thread frederico schardong
Yes, a invisible page are added every time.

Adding this, it works:

gtk_widget_show_all(vbox);
gtk_notebook_remove_page(GTK_NOTEBOOK(notebook), 0);
gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, 0);

Thanks everyone.

2010/2/3 Tristan Van Berkom t...@gnome.org:
 a.) you dont show the widgets you add in generateButtons
 b.) you dont remove the original page either

 maybe it works and adds an invisible page every time ?

 And... maybe it will be easier if you hold on to a GtkBox
 child of the first page and reconstruct the contents of
 that instead (so as to be sure not to muck up page indexes).

 Cheers,
        -Tristan

 On Tue, Feb 2, 2010 at 9:13 PM, frederico schardong frede@gmail.com 
 wrote:
 Hi,

 I'm trying to reconstruct the first page of a notebook on a click of a
 button in second page.

 The problem is that when click, nothing happen. The function works
 because the page is constructed when calling from the function main().

 Code:

 #include gtk/gtk.h

 void end (GtkWidget*, gpointer);
 void generateButtons(GtkWidget*, gpointer);

 int main(int argc, char *argv[])
 {
    gint i;
    GtkWidget *window, *label, *button, *notebook;

    gtk_init (argc, argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), Box example);
    gtk_widget_set_size_request (window, 300, 100);

    g_signal_connect (G_OBJECT(window), destroy, G_CALLBACK (end), NULL);

    label = gtk_label_new(Page Two);

    button = gtk_button_new_with_label(Click to reconstruct the page one);

    /* Append to pages to the notebook container. */
    notebook = gtk_notebook_new();

    generateButtons(NULL, (gpointer)notebook);
    gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), button, label, 1);

    gtk_container_add (GTK_CONTAINER (window), notebook);
    gtk_widget_show_all (window);

    g_signal_connect (G_OBJECT(button), clicked, G_CALLBACK
 (generateButtons), (gpointer)notebook);

    gtk_main();
    return 0;
 }

 void generateButtons(GtkWidget *widget, gpointer data)
 {
    GtkWidget *vbox, *button, *button1, *label, *notebook = GTK_WIDGET(data);
    vbox = gtk_vbox_new (TRUE, 5);

    button = gtk_button_new_with_label (John);
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);

    g_signal_connect (G_OBJECT (button), clicked, G_CALLBACK
 (gtk_widget_destroy), (gpointer) button);

    button1 = gtk_button_new_with_label (Maria);
    gtk_box_pack_start (GTK_BOX (vbox), button1, FALSE, TRUE, 0);

    g_signal_connect (G_OBJECT (button1), clicked, G_CALLBACK
 (gtk_widget_destroy), (gpointer) button1);

    label = gtk_label_new(Page One);

    gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, 0);
 }

 void end(GtkWidget *window, gpointer data)
 {
    gtk_main_quit();
 }

 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Trying to add a page to a notebook

2010-02-02 Thread frederico schardong
Hi,

I'm trying to reconstruct the first page of a notebook on a click of a
button in second page.

The problem is that when click, nothing happen. The function works
because the page is constructed when calling from the function main().

Code:

#include gtk/gtk.h

void end (GtkWidget*, gpointer);
void generateButtons(GtkWidget*, gpointer);

int main(int argc, char *argv[])
{
gint i;
GtkWidget *window, *label, *button, *notebook;

gtk_init (argc, argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), Box example);
gtk_widget_set_size_request (window, 300, 100);

g_signal_connect (G_OBJECT(window), destroy, G_CALLBACK (end), NULL);

label = gtk_label_new(Page Two);

button = gtk_button_new_with_label(Click to reconstruct the page one);

/* Append to pages to the notebook container. */
notebook = gtk_notebook_new();

generateButtons(NULL, (gpointer)notebook);
gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), button, label, 1);

gtk_container_add (GTK_CONTAINER (window), notebook);
gtk_widget_show_all (window);

g_signal_connect (G_OBJECT(button), clicked, G_CALLBACK
(generateButtons), (gpointer)notebook);

gtk_main();
return 0;
}

void generateButtons(GtkWidget *widget, gpointer data)
{
GtkWidget *vbox, *button, *button1, *label, *notebook = GTK_WIDGET(data);
vbox = gtk_vbox_new (TRUE, 5);

button = gtk_button_new_with_label (John);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);

g_signal_connect (G_OBJECT (button), clicked, G_CALLBACK
(gtk_widget_destroy), (gpointer) button);

button1 = gtk_button_new_with_label (Maria);
gtk_box_pack_start (GTK_BOX (vbox), button1, FALSE, TRUE, 0);

g_signal_connect (G_OBJECT (button1), clicked, G_CALLBACK
(gtk_widget_destroy), (gpointer) button1);

label = gtk_label_new(Page One);

gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), vbox, label, 0);
}

void end(GtkWidget *window, gpointer data)
{
gtk_main_quit();
}

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: State of GTK3 (especially the theme api)

2010-01-31 Thread frederico schardong
Maybe this question should be discuss in gtk-devel-list.

2010/1/30 Clemens Eisserer linuxhi...@gmail.com:
 Hi,

 Does anybody know whats the state of GTK3?
 I am especially interested in what the theme api looks like, or wether
 it has been worked on at all?

 All wiki pages I found were quite outdate :-(

 Thank you in advance, Clemens
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: difference between event and signal

2010-01-14 Thread frederico schardong
Are the signals only emitted by GLib and GDK?

2010/1/13 Tadej Borovšak tadeb...@gmail.com:
 Hi.

 What means the Run First, Run Last and others in
 http://library.gnome.org/devel/gtk/unstable/GtkWidget.htm at Signals?

 http://library.gnome.org/devel/gobject/stable/gobject-Signals.html#gobject-Signals.description
 http://library.gnome.org/devel/gobject/stable/gobject-Signals.html#GSignalFlags

 Tadej

 --
 Tadej Borovšak
 tadeboro.blogspot.com
 tadeb...@gmail.com
 tadej.borov...@gmail.com




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: difference between event and signal

2010-01-14 Thread frederico schardong
Only GObject can emit signals?

My question is if other can emit signals, others structures from GDK or GTK+.

2010/1/14 David Nečas y...@physics.muni.cz:
 On Thu, Jan 14, 2010 at 08:47:04PM -0200, frederico schardong wrote:
 Are the signals only emitted by GLib and GDK?

 Any GObject can emit signals.

 But, generally, only widgets receive events.

 Not sure if this answers your question...

 Yeti





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: difference between event and signal

2010-01-13 Thread frederico schardong
Thanks!

2010/1/13 Ben Pfaff b...@cs.stanford.edu:
 frederico schardong frede@gmail.com writes:

 I'm confusing about the difference between event and signal.

 According to the GTK+ FAQ:

 First of all, Havoc Pennington gives a rather complete
 description of the differences between events and signals in his
 free book (two chapters can be found at
 http://www106.pair.com/rhp/sample_chapters.html).

 Moreover, Havoc posted this to the gtk-list Events are a stream
 of messages received from the X server. They drive the Gtk main
 loop; which more or less amounts to wait for events, process
 them (not exactly, it is really more general than that and can
 wait on many different input streams at once). Events are a
 Gdk/Xlib concept.

 Signals are a feature of GtkObject and its subclasses. They have
 nothing to do with any input stream; really a signal is just a
 way to keep a list of callbacks around and invoke them (emit
 the signal). There are lots of details and extra features of
 course. Signals are emitted by object instances, and are entirely
 unrelated to the Gtk main loop. Conventionally, signals are
 emitted when something changes about the object emitting the
 signal.

 Signals and events only come together because GtkWidget happens
 to emit signals when it gets events. This is purely a
 convenience, so you can connect callbacks to be invoked when a
 particular widget receives a particular event. There is nothing
 about this that makes signals and events inherently related
 concepts, any more than emitting a signal when you click a button
 makes button clicking and signals related concepts.

 --
 Now I have to go wash my mind out with soap.
 --Derick Siddoway

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




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: difference between event and signal

2010-01-13 Thread frederico schardong
What means the Run First, Run Last and others in
http://library.gnome.org/devel/gtk/unstable/GtkWidget.htm at Signals?

2010/1/13 frederico schardong frede@gmail.com:
 Thanks!

 2010/1/13 Ben Pfaff b...@cs.stanford.edu:
 frederico schardong frede@gmail.com writes:

 I'm confusing about the difference between event and signal.

 According to the GTK+ FAQ:

 First of all, Havoc Pennington gives a rather complete
 description of the differences between events and signals in his
 free book (two chapters can be found at
 http://www106.pair.com/rhp/sample_chapters.html).

 Moreover, Havoc posted this to the gtk-list Events are a stream
 of messages received from the X server. They drive the Gtk main
 loop; which more or less amounts to wait for events, process
 them (not exactly, it is really more general than that and can
 wait on many different input streams at once). Events are a
 Gdk/Xlib concept.

 Signals are a feature of GtkObject and its subclasses. They have
 nothing to do with any input stream; really a signal is just a
 way to keep a list of callbacks around and invoke them (emit
 the signal). There are lots of details and extra features of
 course. Signals are emitted by object instances, and are entirely
 unrelated to the Gtk main loop. Conventionally, signals are
 emitted when something changes about the object emitting the
 signal.

 Signals and events only come together because GtkWidget happens
 to emit signals when it gets events. This is purely a
 convenience, so you can connect callbacks to be invoked when a
 particular widget receives a particular event. There is nothing
 about this that makes signals and events inherently related
 concepts, any more than emitting a signal when you click a button
 makes button clicking and signals related concepts.

 --
 Now I have to go wash my mind out with soap.
 --Derick Siddoway

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




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Benchmark test

2010-01-01 Thread frederico schardong
Anyone?

2009/12/28 frederico schardong frede@gmail.com:
 Hi,

 Does anyone know about benchmark testing GTK in C and it
 bindings(PyGTK, PHPGtk, etc..)? I've searched but not found nothing.

 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-29 Thread frederico schardong
 a hint to 60MB of sourcecode (18.000+ pages
 if printed out) is no good answer to such a
 question from someone new to gtk. Especially
 with all that hurdles like GSEAL to understand
 it.

Well, I not so new in gtk+. I'm here more than a year. This thread is
just to clarify a question that's not clarify for me, because I've
never been behind the low level of a window system...

And yes, I agree that search on 60 MB of sourcecode is a good way to
clarify this, so I came here and created this thread.

Thanks for all that respond my question, it's now clear to me.

2009/12/29 David Nečas y...@physics.muni.cz:
 On Tue, Dec 29, 2009 at 02:19:38PM +0100, Joost wrote:
 a hint to 60MB of sourcecode (18.000+ pages
 if printed out) is no good answer to such a
 question from someone new to gtk. Especially
 with all that hurdles like GSEAL to understand
 it.

 Someone new to Gtk+ but knowing X or GDI+the windowing bits of Win32 or
 something similar just looks at the Gdk docs table of contents and says
 `I see' as he notices the familiar topics: windows, rectangles, bitmaps,
 drawing primitives, font/text handling, devices, etc.  (Of course, *how*
 Gdk handles them still involves ugly technical code, but that's
 expected.)

 Someone new to both Gtk+ and the fundamentals does not need to know that
 Gdk *exists*.  There are many more important things to learn first if
 you want to develop Gtk+ apps.

 But if he's curious and wishes to study the low-level stuff then, by all
 means, he should look at the source code.  But first look at some
 overview of X because the influence of X concepts on Gdk is strong and
 evident (and due to X's importance and age much more have been written
 about it than about Gdk).  Actually, going to MSDN and reading about
 Win32 might do too.

 A clue to understanding gtk is certainly to
 understand the difference between gtk.Window and
 gtk.gdk.Window (here in the spelling of pygtk).
 Thus to read and thoroughly understand

 http://library.gnome.org/devel/gtk/stable/GtkWindow.html

 and

 http://library.gnome.org/devel/gdk/stable/gdk-Windows.html

 Aside from the first short paragraph, the GtkWindow documentation is
 utter gibberish if you don't already know *what* it's talking about.

 For instance, the first paragraph is immediately followed by a
 complicated 100+ lines example showing how to do composited windows.
 What the hell are composited windows?  (I know, but this is the likely
 reaction.)

 So, no, don't read this to figure out what Gdk does.

 Yeti

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




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread frederico schardong
gdk wraps the business of creating a window and getting events

only a window or all the widgets?

2009/12/28  jcup...@gmail.com:
 2009/12/28 frederico schardong frede@gmail.com:
 So how low level GDK goes? It renders the widgets according the OS?
 Where GTK+ ends and GDK starts? Where GDK ends and GLib starts?

 You can read about it here:

 http://www.gtk.org/documentation.html

 gdk wraps the business of creating a window and getting events, cairo
 does low-level drawing, glib does data structures, utility functions
 and event loops, gobject is the object model, pango renders text,
 gdkpixbuf loads and transforms images, gtk issues all the drawing
 commands to display widgets, your application does everything else.

 John




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Benchmark test

2009-12-28 Thread frederico schardong
Hi,

Does anyone know about benchmark testing GTK in C and it
bindings(PyGTK, PHPGtk, etc..)? I've searched but not found nothing.

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


What, in detail, the GDK do?

2009-12-27 Thread frederico schardong
Hi,

I have looked at wikipedia the explication about GDK and would like to
know more about this sentence: GDK (GIMP Drawing Kit) is a computer
graphics library that acts as a wrapper around the low-level drawing
and windowing functions provided by the underlying graphics system.

So how low level GDK goes? It renders the widgets according the OS?
Where GTK+ ends and GDK starts? Where GDK ends and GLib starts?

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Fwd: GTK+ is real object oriented?

2009-12-21 Thread frederico schardong
 The only difference is one of convention.  Don't get hung up on where
 the . or - is.  One might be preferred over the other by you, but
 that does not mean that GTK is not object-oriented.  If you don't like
 the C syntax used to constuct, destroy, and call methods on an object,
 then I suggest you use GTKmm with C++, Vala, or PyGTK.  In each case the
 Gobject system is accessed via the native object-oriented conventions.
 Since GObject OO, the bindings are really just thin wrappers to thunk
 from one object system to another.

 I like C sintax, but is it that create this confusion to me... Thanks
 for clearly, and I agree that GTK is OO.

 2009/12/21 Michael Torrie torr...@gmail.com:
 frederico schardong wrote:
 Yes, C don't provide sintax support for do my example of method.

 Syntactical support is not required for an object-oriented system; it
 merely makes it easier for you, the programmer.

 In OOP such class must have self methods to set self attributes.

 Yes, and gobject certainly has this.

 What happen is GObject (by the C limitation) just have attributes, the
 methods to set its attributes are functions out of the struct. Ok, is
 this what happen, but for this facts don't broke the OOP?

 No, GObject has both attributes and methods.  Just like in C++, there is
 a struct to hold the data members (the attributes) and a call table to
 hold the methods.  This is why you can call a GtkWidget method on an
 instance that is a descendant of GtkWidget and it still works.  For
 example, a button:

 b=gtk_button_new()
 gtk_widget_show(b)

 The show method of the GtkWidget class can be called on the instance b
 because it descends from GtkWidget, even though it is of the GtkButton
 class.  Even more convincingly, if I overrode the show method in my
 own GtkWidget-derived class, a call to gtk_widget_show(myinstance) would
 call my own classes show because show is a virtual method.  So the call
 table tells the compiler which method to actually call.  Pretty much
 like C++, except that it's not hidden as cleanly.

 Note that there is absolutely no functional difference between using
 this class/method/instance combination for a method call from the
 instance/method idea.  In other words:

 gtk_widget_show(instance)

 is identical to

 instance.show()

 The only difference is one of convention.  Don't get hung up on where
 the . or - is.  One might be preferred over the other by you, but
 that does not mean that GTK is not object-oriented.  If you don't like
 the C syntax used to constuct, destroy, and call methods on an object,
 then I suggest you use GTKmm with C++, Vala, or PyGTK.  In each case the
 Gobject system is accessed via the native object-oriented conventions.
 Since GObject OO, the bindings are really just thin wrappers to thunk
 from one object system to another.
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
Hi,

Is GTK+ really object oriented?

Or just provide a fake object oriented environment?

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Fwd: GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
-- Forwarded message --
From: frederico schardong frede@gmail.com
Date: 2009/12/20
Subject: Re: GTK+ is real object oriented?
To: Michael P. Soulier msoul...@digitaltorque.ca


Real is when the language have the concepts of  class, objects,
instance, method, inheritance, abstraction, encapsulation,
polymorphism...

In GTK+ programmin we don't have something like
widget-setVisibility(TRUE). For me it's broken the concept of object
oriented, because a attribute(visibility) of the class widget is set
by a extern function, not a method of the class widget.

2009/12/20 Michael P. Soulier msoul...@digitaltorque.ca:
 On 20/12/09 frederico schardong said:

 Hi,

 Is GTK+ really object oriented?

 Or just provide a fake object oriented environment?

 Define real. Define fake.

 Mike
 --
 Michael P. Soulier msoul...@digitaltorque.ca
 Any intelligent fool can make things bigger and more complex... It takes a
 touch of genius - and a lot of courage to move in the opposite direction.
 --Albert Einstein




--
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582



-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Fwd: GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
-- Forwarded message --
From: frederico schardong frede@gmail.com
Date: 2009/12/20
Subject: Re: GTK+ is real object oriented?
To: Michael P. Soulier msoul...@digitaltorque.ca


Fake is when change a attribute (visibility) of a class (gtkwidget)
only can be changed by a function (gtk_widget_hide() or
(gtk_widget_show()) not by a method.

2009/12/20 frederico schardong frede@gmail.com:
 Real is when the language have the concepts of  class, objects,
 instance, method, inheritance, abstraction, encapsulation,
 polymorphism...

 In GTK+ programmin we don't have something like
 widget-setVisibility(TRUE). For me it's broken the concept of object
 oriented, because a attribute(visibility) of the class widget is set
 by a extern function, not a method of the class widget.

 2009/12/20 Michael P. Soulier msoul...@digitaltorque.ca:
 On 20/12/09 frederico schardong said:

 Hi,

 Is GTK+ really object oriented?

 Or just provide a fake object oriented environment?

 Define real. Define fake.

 Mike
 --
 Michael P. Soulier msoul...@digitaltorque.ca
 Any intelligent fool can make things bigger and more complex... It takes a
 touch of genius - and a lot of courage to move in the opposite direction.
 --Albert Einstein




 --
 Thanks,
 Frederico Schardong,
 SOLIS - Open source solutions
 www.solis.coop.br
 Linux registered user #500582




--
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582



-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Fwd: GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
-- Forwarded message --
From: frederico schardong frede@gmail.com
Date: 2009/12/20
Subject: Re: GTK+ is real object oriented?
To: David Nečas y...@physics.muni.cz


The difference is that not a really object-oriented, is a fake object-oriented.

I call it fake object-oriented environment, maybe not the most
correctly name, but i think is true.

What do you think?

2009/12/20 David Nečas y...@physics.muni.cz:
 On Sun, Dec 20, 2009 at 03:07:01PM -0200, frederico schardong wrote:
 Is GTK+ really object oriented?

 Or just provide a fake object oriented environment?

 And what is the difference?

 If it walks like an object oriented environment and quacks like an
 object oriented environment, how do you call it?

 Yeti





--
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582



-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Fwd: GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
Yes, C don't provide sintax support for do my example of method.

In OOP such class must have self methods to set self attributes.

What happen is GObject (by the C limitation) just have attributes, the
methods to set its attributes are functions out of the struct. Ok, is
this what happen, but for this facts don't broke the OOP?


2009/12/20 Michael Torrie torr...@gmail.com:
 frederico schardong wrote:
 Fake is when change a attribute (visibility) of a class (gtkwidget)
 only can be changed by a function (gtk_widget_hide() or
 (gtk_widget_show()) not by a method.

 In most languages, methods are functions.

 Sounds to me like you are stuck on syntax rather than the real concept.
  You can do object-oriented programming in most any language, whether it
 has syntactical support or not.  C++'s objects are really structs with a
 function call table (vtable) tacked on.

 You might consider the Vala language, which implements a syntax more
 like what you are expecting.  Under the hood, Vala is straight gobject
 (straight-C), so it's very light-weight.

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




-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Fwd: GTK+ is real object oriented?

2009-12-20 Thread frederico schardong
Thanks to everybody.

You helped me to clarify the concepts of OO.


2009/12/20 David Nečas y...@physics.muni.cz:
 On Sun, Dec 20, 2009 at 05:26:20PM -0200, frederico schardong wrote:
 Yes, C don't provide sintax support for do my example of method.

 In OOP such class must have self methods to set self attributes.

 What happen is GObject (by the C limitation) just have attributes, the
 methods to set its attributes are functions out of the struct. Ok, is
 this what happen, but for this facts don't broke the OOP?

 You have a weird definition of OO.

 Smalltalk people could tell you that calling methods is fake OO because
 to do real OO you must send messages to objects.  Now what?

 To the syntax issue.  In fact, virtual methods in Gtk+ are called

 GTK_WIDGET_GET_CLASS(widget)-show(widget)

 where GTK_WIDGET_GET_CLASS explicitly obtains the virtual table
 (referenced from within the object struct) because the compiler won't do
 it for you and then you can call the method.

 But as everyone else prefers a sane syntax to a cozy objectishy feeling,
 this is wrapped with something like gtk_widget_show() for virtual
 methods and non-virtual methods look entirely like functions.

 If it matters to you whether calling methods looks like

    object.method(arg1, arg2)
    object_method(arg1, arg2)
    (object method arg1 arg2)
    method { arg1 } { arg2 } : object

 then Gtk+ is fake OO by your definition but hardly anyone cares.

 If it matters to you in what bit of memory methods are physically
 stored, then check if Smalltalk, Ocaml, Haskel, etc. are OO according to
 your definition or not.  Hopefully you are aware the methods are seldom
 actually stored in `the object struct' even though they are placed there
 in the source code of e.g. C++ because that would be a collosal waste of
 resources.

 If you are troubled by the fact that one can write gtk_widget_frobnicate()
 that will look exactly like a GtkWidget method but would not be, then
 you simply noticed one of the things that cannot be enforced in C.  The
 rule is that you must not name functions gtk_widget_frobnicate().

 The object file compiled from gtkwidget.c then lists all the GtkWidget
 methods and is as good table of methods of the object as anything else.

 Yeti





-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


error with thread

2009-07-13 Thread frederico schardong
Hi,

I have a so big function (near 600 lines) and it communicates with
some embedded system using serial port... this function have some ties
(for and while).. and a great number of usleep...

When I call this function, GTK windows and widgets are lost.. and this
mustn't be happen... to resolve this I'm using threads like this
example:

/* Compile me with:
 *  gcc -o sample3 sample3.c $(pkg-config --cflags --libs gtk+-2.0 gthread-2.0)
 */
#include gtk/gtk.h

static gpointer
thread_func( gpointer data )
{
while( TRUE )
{
usleep( 50 );

gdk_threads_enter();
g_print(\naa);
gdk_threads_leave();
}

return( NULL );
}

static gpointer
thread_func1( gpointer data )
{
while( TRUE )
{
sleep( 1 );

gdk_threads_enter();
g_print(\nbb);
gdk_threads_leave();
}

return( NULL );
}

int
main( intargc,
  char **argv )
{
GThread   *thread, *th;
GError*error = NULL;

/* Secure glib */
if( ! g_thread_supported() )
g_thread_init( NULL );

/* Secure gtk */
gdk_threads_init();

/* Obtain gtk's global lock */
gdk_threads_enter();

/* Do stuff as usual */
gtk_init( argc, argv );

/* Create new thread */
thread = g_thread_create( thread_func, NULL,
  FALSE, error );
if( ! thread )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

/* Create new thread */
th = g_thread_create( thread_func1, NULL,
  FALSE, error );
if( ! th )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

gtk_main();

/* Release gtk's global lock */
gdk_threads_leave();

return( 0 );
}

//end

I'm using exactly like this example, but all stopped widgets keep
going like before.. have this function any limitations about ties
number (for, while) or time under the while(1) of the thread?

Thanks!

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


how to leave a specific thread?

2009-07-11 Thread frederico schardong
I'm using this example of threads..

/* Compile me with:
 *  gcc -o sample3 sample3.c $(pkg-config --cflags --libs gtk+-2.0 gthread-2.0)
 */
#include gtk/gtk.h

static gpointer
thread_func( gpointer data )
{
while( TRUE )
{
usleep( 50 );

gdk_threads_enter();
g_print(\naa);
gdk_threads_leave();
}

return( NULL );
}

static gpointer
thread_func1( gpointer data )
{
while( TRUE )
{
sleep( 1 );

gdk_threads_enter();
g_print(\nbb);
gdk_threads_leave();
}

return( NULL );
}

int
main( intargc,
  char **argv )
{
GThread   *thread, *th;
GError*error = NULL;

/* Secure glib */
if( ! g_thread_supported() )
g_thread_init( NULL );

/* Secure gtk */
gdk_threads_init();

/* Obtain gtk's global lock */
gdk_threads_enter();

/* Do stuff as usual */
gtk_init( argc, argv );

/* Create new thread */
thread = g_thread_create( thread_func, NULL,
  FALSE, error );
if( ! thread )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

/* Create new thread */
th = g_thread_create( thread_func1, NULL,
  FALSE, error );
if( ! th )
{
g_print( Error: %s\n, error-message );
return( -1 );
}

gtk_main();

/* Release gtk's global lock */
gdk_threads_leave();

return( 0 );
}


And I must know how I can stop some thread without stop all the
others? Just stop one thread, not all

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


GtkCombo events

2009-05-28 Thread frederico schardong
Hi,

I search, but not find the answer of my question..

What event is going on when the string selected of a GtkCombo is chenged?

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


add elements to gtkcombo

2009-05-22 Thread frederico schardong
Hi,

I'm trying to add elements to gtkcombo... but only the last element
than I added to g_list is showed in gtkcombo, is created a exactly
number of elements, but all of them is the last element that I added..


gint pos, i, j, colunas;

for(i = 0; i  j; i++)
{
pos = 0;
for(colunas = 0; colunas  99; colunas++)
{
id[colunas] = 0;
}

fgets(id,99,a);
for(colunas = 0; colunas  99; colunas++)
{
if(id[colunas] == 10)
{
pos = colunas;
id[colunas] = 0;
}
if(colunas  pos  pos != 0)
{
id[colunas] = 0;
}

for(colunas = 0; colunas  99; colunas++)
{
if(id[colunas] == 10)
{
id[colunas] = 0;
}
   // g_print(\n%c = %d,id[colunas],id[colunas]);
}
}
items = g_list_append(items, id);
}
gtk_combo_set_popdown_strings(GTK_COMBO(windowMainProjectSelection),
items);


any idea?

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


something like system function

2009-05-14 Thread frederico schardong
Hi,

I need something like function system of stdlib.h, but I need to get
the output of the command... example:
gchar *returned;

returned = system(pwd);

and returned must be the folder of the program...

Gtk, or glib have something like that?

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


sqlite and gtk

2009-05-13 Thread frederico schardong
Hi,

I'm writing a simple application, and it use sqlite. Sometime I use:

gint linhas, colunas;
gchar *erro;
gchar **resultTable;

if(sqlite3_get_table(db, SELECT user FROM pnt_user;, resultTable,
linhas, colunas, erro) != SQLITE_OK)
{
exit(0);
}

g_print(\nValue: %s,resultTable);

-

This is showed on terminal:

Value: `��  ��� U[`{U[`{I^C

But every time this routine is called, a different thing is showed..
but never what is in the table.

Can anyone help me?

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


GtkAboutDialog

2009-04-18 Thread frederico schardong
Hi,

What I must do to when I click on Close button of GtkAboutDialog to it close?
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


method to erase a drawing area

2009-04-17 Thread frederico schardong
Hi,

I have a drawing area, and a window with 2 gtk_range, and them
variable form 1 to 10, and this values go to posH and posV. I'm doing
this to can draw a rectangular with my specification.. max width: 10,
min: 1, max henght:10, min: 1.

This event is called when drawing area is clicked:

static gboolean button_pressed (GtkWidget *a, GdkEventButton *event)
{
gint x = event-x, y = event-y, x1, y1;

for(x1 = (0-posH); x1  posH; x1++)
{
for(y1 = (0-posV); y1  posV; y1++)
{
gdk_draw_point(desenho-drawingArea-window,
desenho-drawingArea-style-fg_gc[GTK_WIDGET_STATE(desenho-drawingArea)],
x+x1, y+y1);
}
}

g_print(\ndrawing x: %d y: %d tamH: %d tamV: %d, x, y, posH, posV);

g_ptr_array_add(desenho-parray, GINT_TO_POINTER(x));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(y));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posH));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posV));
}

But now I must do a eraser function... I do a simple for:
gint x1, x = event-x, y = event-y;

for (x1 = 0; x1  desenho-parray-len; x1 = x1 + 4)
{
if((GPOINTER_TO_INT(desenho-parray-pdata[x1]) == x) 
(GPOINTER_TO_INT(desenho-parray-pdata[x1+1]) == y))
{   g_print(\nta no lugar certo mano!);
g_ptr_array_remove_index(desenho-parray, x1);
g_ptr_array_remove_index(desenho-parray, x1);
g_ptr_array_remove_index(desenho-parray, x1);
g_ptr_array_remove_index(desenho-parray, x1);
}


 it's work, but not fine... it's only work when i click exactly where
I clicked before to draw this point... but I need to delete from
GPtrArray when I click on somewhere of this rectangle area... not only
center... Can help me list?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


events and lib allegro

2009-03-24 Thread frederico schardong
Hi list,

I'm using lib allegro, because I need use joystick.

I made a simple window containing 4 togglebuttons and some labels ..
the labels will be set  with analog position of the axes of joysitck.
The togglebuttons will set with the state of the 4 buttons on the
joystick. To update the values of the joystick must call a function
(poll_joystick ()) periodically. My doubt is how to do this without
compromising the integrity of the program. How to read to him every 50
milesegundos the joystick?

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


GPtrArray

2009-03-21 Thread frederico schardong
Hi list,

I do a simples struct:

typedef struct
{
GtkWidget *window;
GtkWidget *drawingArea;
GPtrArray *parray;
gint a;
} GtkDesenho;

In main():

GtkDesenho *desenho;

desenho = g_slice_new(GtkDesenho);
desenho-window = glade_xml_get_widget(xml, window2);
desenho-drawingArea= glade_xml_get_widget(xml, drawing_area);


  gtk_window_set_title(GTK_WINDOW(desenho-window), Drawing Areas);

  gtk_widget_set_size_request(desenho-window, 400, 300);



  /* Create a pointer array to hold image data. Then, add event masks to the new
   * drawing area widget. */
   desenho-parray = g_ptr_array_sized_new(500);
g_print(\n tamanho do array: %d, desenho-parray-len);
  GTK_WIDGET_SET_FLAGS (desenho-drawingArea, GTK_CAN_FOCUS);

  gtk_widget_add_events (desenho-drawingArea, GDK_BUTTON_PRESS_MASK |

  GDK_BUTTON_MOTION_MASK |

   GDK_KEY_PRESS_MASK);







  gtk_container_add (GTK_CONTAINER (desenho-window), desenho-drawingArea);


  // and call the events to the callbacks

g_signal_connect(G_OBJECT(desenho-drawingArea),
button_press_event, G_CALLBACK(button_pressed), desenho);
g_signal_connect(G_OBJECT(desenho-drawingArea),
motion_notify_event, G_CALLBACK(button_pressed), desenho);
g_signal_connect(G_OBJECT(desenho-drawingArea), expose_event,
G_CALLBACK(expose_event), desenho);

//the button6 must clear the drawing area

   g_signal_connect(G_OBJECT(button6), clicked,
G_CALLBACK(limpaDrawingArea), desenho);

// out of main, here is my g_callback limpaDrawingArea

static gboolean limpaDrawingArea(GtkWidget *a, GdkEventButton *event,
GtkDesenho *desenho)

{

gdk_window_clear(desenho-drawingArea-window);
g_ptr_array_remove_range(desenho-parray, 0, desenho-parray-len);

return FALSE;
}

It must clear my drawing area, or not?

When I press the button6, this messages are showed:

(main:10566): Gdk-CRITICAL **: gdk_window_clear: assertion `window !=
NULL' failed

(main:10566): GLib-CRITICAL **: g_ptr_array_remove_range: assertion
`index_  array-len' failed

What's happen? The callbacks button_press and expose_event are working
fine, and them use desenho-drawingArea-window, and
desenho-parray-len too, without showing anyone problem!

Thank you!
-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


drawing area and GPtrArray illogical error

2009-03-21 Thread frederico schardong
static gboolean
expose_event (GtkWidget *a, GdkEventButton *event, GtkDesenho *desenho)
{
guint i, x, y, tamH, tamV, x1, y1;
GdkPoint points[5];

// Loop through the coordinates, redrawing them onto the drawing area.
for (i = 0; i  desenho-parray-len; i = i + 4)
{
x = GPOINTER_TO_INT(desenho-parray-pdata[i]);
y = GPOINTER_TO_INT(desenho-parray-pdata[i+1]);
tamH = GPOINTER_TO_INT(desenho-parray-pdata[i+2]);
tamV = GPOINTER_TO_INT(desenho-parray-pdata[i+3]);
g_print(\nloading x: %d y: %d tamH: %d tamV: %d,x,y,tamH,tamV);
for(x1 = (0-tamH); x1 = tamH; x1++)
{
for(y1 = (0-tamV); y1 = tamV; y1++)
{
gdk_draw_point(desenho-drawingArea-window,
desenho-drawingArea-style-fg_gc[GTK_WIDGET_STATE(desenho-drawingArea)],
x+x1, y+y1);
}
}
}

  return TRUE;
}

// Desenha quando o botão do mouse for pressionado, e quando ele
estiver pressionado e se movendo!

static gboolean button_pressed (GtkWidget *a, GdkEventButton *event,
GtkDesenho *desenho)

{

gint x = event-x, y = event-y, x1, y1;

for(x1 = (0-posH); x1  posH; x1++)
{
for(y1 = (0-posV); y1  posV; y1++)
{
gdk_draw_point(desenho-drawingArea-window,
desenho-drawingArea-style-fg_gc[GTK_WIDGET_STATE(desenho-drawingArea)],
x+x1, y+y1);
}
}

g_print(\nsaving x: %d y: %d tamH: %d tamV: %d, x, y, posH, posV);

g_ptr_array_add(desenho-parray, GINT_TO_POINTER(x));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(y));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posH));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posV));


return FALSE;

}

##

Look at the g_print, they are equals, only the first word changes..

When I click with the mouse on the drawing area the callback
button_pressed is called and the g_print message shows, and when I
move the window the callback expose_event is called and shows its
g_print. The only difference between both g_print is the first word,
in other words, o parray is correct and the points should be drawned
in the drawing area. But that isn't happening.

Does anyone have an idea about it?

Thanks

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GPtrArray

2009-03-21 Thread frederico schardong
Hi list,

I do a simples struct:

typedef struct
{
GtkWidget *window;
GtkWidget *drawingArea;
GPtrArray *parray;
gint a;
} GtkDesenho;

In main():

GtkDesenho *desenho;

desenho = g_slice_new(GtkDesenho);
desenho-window = glade_xml_get_widget(xml, window2);
desenho-drawingArea= glade_xml_get_widget(xml, drawing_area);


  gtk_window_set_title(GTK_WINDOW(desenho-window), Drawing Areas);

  gtk_widget_set_size_request(desenho-window, 400, 300);



  /* Create a pointer array to hold image data. Then, add event masks to the new
   * drawing area widget. */
   desenho-parray = g_ptr_array_sized_new(500);
g_print(\n tamanho do array: %d, desenho-parray-len);
  GTK_WIDGET_SET_FLAGS (desenho-drawingArea, GTK_CAN_FOCUS);

  gtk_widget_add_events (desenho-drawingArea, GDK_BUTTON_PRESS_MASK |

  GDK_BUTTON_MOTION_MASK |

   GDK_KEY_PRESS_MASK);







  gtk_container_add (GTK_CONTAINER (desenho-window), desenho-drawingArea);


  // and call the events to the callbacks

g_signal_connect(G_OBJECT(desenho-drawingArea),
button_press_event, G_CALLBACK(button_pressed), desenho);
g_signal_connect(G_OBJECT(desenho-drawingArea),
motion_notify_event, G_CALLBACK(button_pressed), desenho);
g_signal_connect(G_OBJECT(desenho-drawingArea), expose_event,
G_CALLBACK(expose_event), desenho);

//the button6 must clear the drawing area

   g_signal_connect(G_OBJECT(button6), clicked,
G_CALLBACK(limpaDrawingArea), desenho);

// out of main, here is my g_callback limpaDrawingArea

static gboolean limpaDrawingArea(GtkWidget *a, GdkEventButton *event,
GtkDesenho *desenho)

{

gdk_window_clear(desenho-drawingArea-window);
g_ptr_array_remove_range(desenho-parray, 0, desenho-parray-len);

return FALSE;
}

It must clear my drawing area, or not?

When I press the button6, this messages are showed:

(main:10566): Gdk-CRITICAL **: gdk_window_clear: assertion `window !=
NULL' failed

(main:10566): GLib-CRITICAL **: g_ptr_array_remove_range: assertion
`index_  array-len' failed

What's happen? The callbacks button_press and expose_event are working
fine, and them use desenho-drawingArea-window, and
desenho-parray-len too, without showing anyone problem!

Thank you!
-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


drawing area and GPtrArray illogical error

2009-03-21 Thread frederico schardong
static gboolean
expose_event (GtkWidget *a, GdkEventButton *event, GtkDesenho *desenho)
{
guint i, x, y, tamH, tamV, x1, y1;
GdkPoint points[5];

// Loop through the coordinates, redrawing them onto the drawing area.
for (i = 0; i  desenho-parray-len; i = i + 4)
{
x = GPOINTER_TO_INT(desenho-parray-pdata[i]);
y = GPOINTER_TO_INT(desenho-parray-pdata[i+1]);
tamH = GPOINTER_TO_INT(desenho-parray-pdata[i+2]);
tamV = GPOINTER_TO_INT(desenho-parray-pdata[i+3]);
g_print(\nloading x: %d y: %d tamH: %d tamV: %d,x,y,tamH,tamV);
for(x1 = (0-tamH); x1 = tamH; x1++)
{
for(y1 = (0-tamV); y1 = tamV; y1++)
{
gdk_draw_point(desenho-drawingArea-window,
desenho-drawingArea-style-fg_gc[GTK_WIDGET_STATE(desenho-drawingArea)],
x+x1, y+y1);
}
}
}

  return TRUE;
}

// Desenha quando o botão do mouse for pressionado, e quando ele
estiver pressionado e se movendo!

static gboolean button_pressed (GtkWidget *a, GdkEventButton *event,
GtkDesenho *desenho)

{

gint x = event-x, y = event-y, x1, y1;

for(x1 = (0-posH); x1  posH; x1++)
{
for(y1 = (0-posV); y1  posV; y1++)
{
gdk_draw_point(desenho-drawingArea-window,
desenho-drawingArea-style-fg_gc[GTK_WIDGET_STATE(desenho-drawingArea)],
x+x1, y+y1);
}
}

g_print(\nsaving x: %d y: %d tamH: %d tamV: %d, x, y, posH, posV);

g_ptr_array_add(desenho-parray, GINT_TO_POINTER(x));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(y));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posH));
g_ptr_array_add(desenho-parray, GINT_TO_POINTER(posV));


return FALSE;

}

##

Look at the g_print, they are equals, only the first word changes..

When I click with the mouse on the drawing area the callback
button_pressed is called and the g_print message shows, and when I
move the window the callback expose_event is called and shows its
g_print. The only difference between both g_print is the first word,
in other words, o parray is correct and the points should be drawned
in the drawing area. But that isn't happening.

Does anyone have an idea about it?

Thanks

-- 
Abraço,
Frederico Schardong,
SOLIS - O lado livre da tecnologia
www.solis.coop.br
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: newbie question

2009-03-11 Thread frederico schardong
void my_callback_function (GtkButton *widget, gpointer user_ptr);

...

g_signal_connect( G_OBJECT( widget), clicked,
   G_CALLBACK( my_callback_function), user_ptr );


void my_callback_function (GtkButton *widget, gpointer user_ptr) {

   ...
}


http://library.gnome.org/devel/gtk/unstable/GtkButton.html

but how I can pass to my_callback_function the gtk_drawing_area? I
know about the g_signal_connect.. but I not know how pass another
widget, without the widget being passed the first parameter of
function..
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


newbie question

2009-03-10 Thread frederico schardong
Hi,

Sorry, but I know it is a newbie question..

I have a button, and a gtk_drawing_area, and a function to save what
is happen in the gtk_drawing_area.. When this button is pressed, the
function must be run.. I'm using now this gtk_drawing_area how a
global variable, how I can connect the button press action to this
function?

Thank's

-- 
Abraço,
Frederico Schardong,
SOLIS, o lado livre da tecnologia
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


program to desing a simple things

2009-02-28 Thread frederico schardong
Hi,

I need a simple example of a program to desing a simple lines and
geometrics forms.. just in gray scale, anybody haave something like
that?

-- 
Thanks,
Frederico Schardong,
SOLIS, o lado livre da tecnologia
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


how to get a selected filter to save

2009-02-17 Thread frederico schardong
Hello,

I need to get the filter selected by user on a saving file chooser.

How I do It??

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


Re: how to get a selected filter to save

2009-02-16 Thread frederico schardong
2009/2/12 frederico schardong frede@gmail.com:
 Hello,

 I need to get the filter selected by user on a saving file chooser.

 How I do It??

 Thanks!

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


how to get a selected filter to save

2009-02-12 Thread frederico schardong
Hello,

I need to get the filter selected by user on a saving file chooser.

How I do It??

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


Re: GtkImage

2009-01-29 Thread frederico schardong
2009/1/29 Dov Grobgeld dov.grobg...@gmail.com:
 The GtkImage will change its size automatically according to the size of the
 image that you load. If you want to change the image size, then you should
 load it into a GdkPixbuf, resize it, and then set it with
 gtk_image_set_from_pixbuf().

 Btw, please keep CC:ing the mailing list, as there might be others with
 similar questions.

 Regards,
 Dov

 2009/1/29 frederico schardong frede@gmail.com

 Hi,

 But I must resize the image to the size of space of GtkImagem on .glade..

 how I do it?



But GtkImage don't change its size.. On glade I defined the size of GtkImage,   
that is not preventing it to resize?

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


jpeg to bmp with pixbuf

2009-01-28 Thread frederico schardong
Hello,

How I can transform a jpeg imagem to bitmap format using pixbuf?

It's possible??

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


GtkImage

2009-01-27 Thread frederico schardong
Hello,

I was created a space for image on glade-3, and I'm trying to link
some imagem to this space.

GtkWidget space;

space = gtk_image_new_from_file(image.bmp);

only this?

the image will rezise itself to the space dimensions?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


compile 2 libs together

2009-01-20 Thread frederico schardong
Hi,

when I'm using allegro, this line is to compile it:
gcc -o main main.c `allegro-config --libs`

and when I'm using libglade, this line is used:
gcc -o main main.c `pkg-config --cflags --libs libglade-2.0`

But now I must use allegro and libglade together.

How I can compile this together?

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


GtkFileChooser and filter example

2009-01-17 Thread frederico schardong
Somebody can send me a simples example using GtkFileChooser and filter*?

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

ALLEGRO and GTK

2009-01-16 Thread frederico schardong
It's possible?

How I will compile this??

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


some erros

2009-01-15 Thread frederico schardong
Hi,

anybody can help me to resolve this?



GtkFileFilter *filtro;
GtkWidget *chooser;
//GtkFileChooser *chooser;

gtk_file_filter_set_name(filtro,bmp);

chooser = gtk_file_chooser_dialog_new (Open File,
  parent_window,
  GTK_FILE_CHOOSER_ACTION_OPEN,
  GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
  GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
  NULL);

gtk_file_chooser_add_filter(*chooser, *filtro);

gtk_widget_show(chooser);

if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT)
  {
char *filename;

filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));

g_print (filename);
  }

gtk_widget_destroy (chooser);


how I can add filter to my chooser??

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


example of gdk_pixbuf_new_from_file

2008-12-23 Thread frederico schardong
Hello,

Anybody have any example of gdk_pixbuf_new_from_file? Or any tutorial about
starting with the gdk-pixbuf library?

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


gint on gtk_entry_set_text

2008-12-17 Thread frederico schardong
Please look:

gint dado;

dado = inb(0x37A);

gtk_entry_set_text(GTK_ENTRY(entry2),dado);

Whow I can show gint in my entry2?

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