Re: C vs C++ for GTK

2007-11-26 Thread Fernando Apesteguía
On 11/25/07, Benoît Dejean [EMAIL PROTECTED] wrote:

 Le dimanche 25 novembre 2007 à 00:03 +0100, Tomas Carnecky a écrit :
  Patrick wrote:
   is C++ to complicated?
  C++ is more complex than C, and thus harder to fully understand.
 
   Is C going out of date?
  No, it's still being used for lots of projects.
 
   Am I limited with C?
  No, there are very few features in C++ that are hard/impossible to
  imitate in C, but you usually won't need those for small projects.

 You can also do it in assembly if you have time.

  What people prefer mostly depends on their taste. I do C, my brother
  does C++, I can't say why that is.
 
  Since you worked with python which is object oriented I would imagine
  going with C++ will be easier for you during the first weeks.

 I've switched gnome-system-monitor to C++ and i'm very happy with it.

Two questions about the sentence above:

- What improvements or benefits did you find to switch to C++?

- Is it going to be a C++ application from now on?

BTW: excellent application

 --
 Benoît Dejean
 GNOME http://www.gnomefr.org/
 LibGTop http://directory.fsf.org/libgtop.html

 ___
 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: is there a memory leak problem with gtk_widget_queue_draw()?

2007-09-07 Thread Fernando Apesteguía
On 9/6/07, okty [EMAIL PROTECTED] wrote:

 Hi,

 I am using GLib's memory profiling to check memory usage of my program. I
 noticed that for each refresh in my screen with gtk_widget_queue_draw(), I
 am checking my allocated memory and each refresh increases the size of
 allocated memory. Do you know any memory leak problem in
 gtk_widget_queue_draw()?

I've never used Glib's memory profiling, but sometimes other programs
like Valgrind (you could use this as well) report false positives in
memory leaks. It has something to do with the way the memory is
allocated (GAllocator is specially confusing for profilers)
Does the profiler report the problem is inside gtk_widget_queue_draw code?

Cheers


 Regards,
 --
 View this message in context: 
 http://www.nabble.com/is-there-a-memory-leak-problem-with-gtk_widget_queue_draw%28%29--tf4392383.html#a12523308
 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.

 ___
 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: Problem with gtk_label_set_text

2007-06-28 Thread Fernando Apesteguía
On 6/28/07, Divya yadav [EMAIL PROTECTED] wrote:
 Hello everyone
 I am using gtk_label_set_text in a dynamic gui and label keeps on changing
 around 1-2 times every second.My program crashes because of this.
 Is there any way to do the same.

Is this a multi-threaded application?


 Thanks
 Divya
 ___
 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: g_idle_add and thread safety

2007-06-06 Thread Fernando Apesteguía
On 6/4/07, Gabriele Greco [EMAIL PROTECTED] wrote:
 I know GTK APIs are not thread safe, I've an app with a thread doing a
 massive job that wants to update the gui status every few cycles, to do
 so I remembered an old post speaking about g_idle_add.

 The question I have and which I didn't find answers both googling, both
 looking at the sources is if g_idle_add can be called without any extra
 mutex/lock from another thread.

AFAIK g_idle_add() is thread-safe. If I'm wrong you will notice soon :)

Cheers


 - I have to use gdk_threads_init() mechanism?
 - I have to use gdk_threads_enter/leave() around gtk_main() and around
 the g_idle_add call?
 - If so, if I use the gdk_threads_idle_add() facility I can avoid all
 the locks or I have to lock around gtk_main anyway? (the example doesn't
 clarify this)

 Ideally my code should be something like:

 static progress_datas;

 gint myfunc(vod *unused)
 {
 gtk_label_set_text(blablabla, progress_data);

 return FALSE; // call only once
 }

 work_thread() {
 while(1) {
 loops++;
 [... do the real work ...]
 if ((loops % 1000) == 0) {
 update_progress_datas();
 g_idle_add(myfunc, NULL);
 }
 }
 }

 int main()
 {
 [..gui init and thread start]
 gtk_main()
 }
 ___
 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: gnome_program_init id necessary?

2006-12-26 Thread Fernando Apesteguía
On 12/26/06, Enrico Sardi [EMAIL PROTECTED] wrote:
 Hi all!

 I was wondering...is gnome_program_init necessary in an application for
 gnome or gtk_init is sufficient? What is the exact utility of
 gnome_program_init?

The best answer:

http://developer.gnome.org/doc/API/2.0/libgnome/libgnome-gnome-program.html#gnome-program-init

Best Regards

 Many thansk!

 Enrico
 ___
 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


Debugging application

2006-12-18 Thread Fernando Apesteguía
Hello list!

I'm developing a gtk application. The point is that I see in Gnome
System Monitor that my application (a loop that continuously read a
file and update data in the window) is eating more memory as it is
executing... There are no problems (no errors or warnings) during
compilation and valgrind, with: -v --leak-check=full doesn't show any
problems of my code.

However, it seems to be some problems with other code (like CORBA and
more...). The fact is that my application grows (slowly) as Gnome
System Monitor says: it starts with 4.6 MB and it reaches 5.6 after
more than an hour...

The point is that if I look at the gnome-system-monitor process in
itself, this program also grows from 5.2 to 6.4...

Is this normal? Is this related to the GSlice allocator or something similar?
Should I be worried about memory leaks in my application? If I
should... since valgrind doesn't show any errors, which tool should I
use?

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


Re: Debugging application

2006-12-18 Thread Fernando Apesteguía
On 12/18/06, Fernando Apesteguía [EMAIL PROTECTED] wrote:
 Hello list!

 I'm developing a gtk application. The point is that I see in Gnome
 System Monitor that my application (a loop that continuously read a
 file and update data in the window) is eating more memory as it is
 executing... There are no problems (no errors or warnings) during
 compilation and valgrind, with: -v --leak-check=full doesn't show any
 problems of my code.

 However, it seems to be some problems with other code (like CORBA and
 more...). The fact is that my application grows (slowly) as Gnome
 System Monitor says: it starts with 4.6 MB and it reaches 5.6 after
 more than an hour...

 The point is that if I look at the gnome-system-monitor process in
 itself, this program also grows from 5.2 to 6.4...

 Is this normal? Is this related to the GSlice allocator or something similar?
 Should I be worried about memory leaks in my application? If I
 should... since valgrind doesn't show any errors, which tool should I
 use?

OK, after the application reached 7.3 MB it went down (according to
gnome-system-monitor) to 6.4 again...

Any clues?


 Thanks in advance.

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


Re: Libglade application distribution how-to?

2006-11-27 Thread Fernando Apesteguía
On 11/27/06, Fabricio Rocha [EMAIL PROTECTED] wrote:
 Dearest ones,

I have a working set of .C and .H source files for my
 application, a bunch of Glade files and their icons in a subdirectory
 called pixmaps, and I can get all this stuff compiled and functional
 through Anjuta. Ok.

But could you please point out a good tutorial of how to put all
 this stuff in a source tarball, so the application can be downloaded and
 tested by other people? I could not find anything like that with Google.

Anjuta generates tarball files for your sources. A good one, without
complications. Go to Build - build tarball.

 I am sure I am NOT doing it right:

 - There is all that EXTREMELY complicated stuff of autoconf,
 automake, makefiles, etc., first of all. Can I presume that just putting
 my Anjuta-generated Makefiles along with the sources in the tarball will
 work? Or what exactly must be done?

No.


 - Although Glade can see and draw the pixmaps in ./pixmaps
 when I edit the interface files, I found out (after a project directory
 change) that the pixmaps are not found in runtime. Maybe this is the
 reason I get those Failed to read a valid object file image from
 memory when running the app from GDB. How can one force libglade to
 find these pixmaps?

If you just use the tarball generated by Anjuta, the paths will be
properly configured (for example if you use the ./configure
--prefix=/mydirectory/myapplication)


- I have been using the config.h macro PACKAGE_SRC_DIR in the
 sources for loading the Glade files, but what will happen if someone
 wants to build a, for example, Debian binary package with the software?
 I suppose there will be no source directory in this case, so what
 would be the correct way of coding this libglade stuff?


 Thank you all and best regards!

 Fabricio Rocha
 Brasilia, Brasil
 The RADiola Project - http://radiola.sourceforge.net


 ___
 Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. 
 Registre seu aparelho agora!
 http://br.mobile.yahoo.com/mailalertas/


 ___
 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


Glade GUI: changing mechanism

2006-10-21 Thread Fernando Apesteguía
Hi list,

Currently, we're using code generation in our project to build the
GUI. However, AFAIK there is no more code generation support in Glade,
so we would like to build our GUI from a XML file.

Can you point me to a guide to make this migration simpler?

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


gtk_file_chooser_dialog_new

2006-10-16 Thread Fernando Apesteguía
Hi,

I read the documentation about gtk_file_chooser_dialog_new() so I
write this line:

gtk_file_chooser_dialog_new (_(Save File), NULL,
   GTK_FILE_CHOOSER_ACTION_SAVE,
   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE,
   GTK_RESPONSE_ACCEPT, NULL);

However, I get four buttons: Cancel, Save, Cancel, Open. It seems like
the gtk_file_chooser_dialog_new function always place the Cancel and
Open buttons.
How can I get only Cancel and Save buttons?

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


Re: Use of fgets, puts, rewind in Gtk+

2006-10-13 Thread Fernando Apesteguía
On 10/12/06, Sucheta Ghosh [EMAIL PROTECTED] wrote:
 Hello,

 I wished to read a file and get some lines from there like this:
 -
 fp=fopen(filename, r);
 for(k=0; k8; k++){
 n=a[k];
 for (i=1; i=n; i++) //Here 'n' is the line number
 fgets(s, 100, fp);
 puts(s);
 rewind(fp);
 }
 -
 -
 This is the code snippet, which is working so well after compiling with
 'gcc' compiler, but when I added this code inside Gtk+ callback.c, a
 runtime error is occuring before execution of 'fgets'. I have already
 included 'stdio.h', but even then it is not executing.

Please, copy-paste the error.


 Do you have any idea that how to overcome this problem?

 Thanks  regards,
 Sucheta Ghosh
 Indian Statistical Institute, Kolkata
 ___
 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: Gnome memory requirements

2006-09-16 Thread Fernando Apesteguía
On 9/14/06, Tomasz Jankowski [EMAIL PROTECTED] wrote:

 GNOME (sometimes) use more memory, then KDE, but it's almost always faster!
 Funny, isn't it? I used KDE in version 3.5.x some time ago and I must say,
 that it was sometimes quite slow on my machine, which isn't old (1GB of ram
 memory, celeron D ~3GHz). I read, that new Qt 4 is much faster, so far I
 only read about that, we will se if it's true when KDE 4 will be ready.

 Next thing is, that GLib memory subsystem don't really free memory on g_free
 (), but do this when program exits. Memory freed with g_free () is still
 'located' for program, which allocated it for first time.

Yes, that's true. I suppose that it is done for performance reasons, am I right?
This leads me to another question: how can I free (this is, completly
deallocate) memory from my process using just Glib?


 In my opinion article publicated by osnews.com is unreliable because of
 GLib's memory subsystem behavior. btw, are cario and pango based on GLib
 too?

Yes, from pango.org:

Pango depends on 2.x series of the GLib library; more information
about GLib can be found at http://www.gtk.org/;

But I don't know about Cairo...
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Gnome memory requirements

2006-09-13 Thread Fernando Apesteguía
Hi list,

First of all, I have to say that I'm not sure if this is the proper
list to make this post. My apologies if it's not.

Today I read this article:

http://ktown.kde.org/~seli/memory/

via osnews.com

I was surprised because the amount of memory taken by Gnome, specially
if we compare the results with KDE. I would like to know what are the
reasons for this. I use KDE and Gnome with a Debian with 2.6.15.6 and
I'm not able to see significant differences that explain this (from a
user's point of view).

According these tests, Gnome sometimes takes almost 25% more memory than KDE.

Some comments at osnews.com suggests that this is because the use of
Cairo and Pango. I have no enough experience with gtk/gnome libs, so
if there is a gnome developer around here... :) can you through some
light here?

As gtk-developers is there any recommendations that we should follow
in order to take less memory in our applications (although they are
not part of the Gnome desktop itself) ?

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


ProgressBar

2006-08-30 Thread Fernando Apesteguía
Hi All!

I would like to know if it is possible that the progress bar behaves like a
thermometer, this is, change the color of the progress bar in certain
regions, and maybe I want to have a specific text for each of these regions.

Which functions should I look for? I see
http://developer.gnome.org/doc/API/2.0/gtk/GtkProgressBar.html but I'm not
sure what to do...

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


Fwd: Resizing window

2006-08-23 Thread Fernando Apesteguía
-- Forwarded message --
From: Iago Rubio [EMAIL PROTECTED]
Date: Aug 22, 2006 12:40 PM
Subject: Re: Resizing window
To: gtk-app-devel-list@gnome.org

On Tue, 2006-08-22 at 11:54 +0200, Iago Rubio wrote:
 On Tue, 2006-08-22 at 09:22 +0200, Fernando Apesteguía wrote:
  I'm still looking for a solution. My app has internationalization
support.
  So make the window fixed is not possible in order to allow all the
different
  messages to fit in the window. I'll read more documentation.
 
  More ideas?

 Have you tried to pick the child's requisition and resize the window to
 it ?

 Try out the example attached.

Sorry, the attachment didn't make it.


// gcc test.c -o test `pkg-config --cflags --libs gtk+-2.0`
#include gtk/gtk.h

void
on_notebook_switch_page (GtkNotebook *notebook,
  GtkNotebookPage *page,
  guintpage_num,
  gpointer user_data)
{
  GtkWidget *child;
  GtkRequisition requisition;

  child = gtk_notebook_get_nth_page   (notebook,
   page_num);

  // pick the child's requisition
  gtk_widget_size_request (child, requisition);

  // The +10 stuff below is used because we're not taking
  // into account the frame's width.
  gtk_window_resize  (GTK_WINDOW(user_data),
  requisition.width + 10,
  requisition.height + 10);
}

int main(int argc, char **argv)
{
  GtkWidget *window, *window_vbox;
  GtkWidget *notebook, *small_label, *big_label;

  gtk_init (argc, argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  window_vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_add (GTK_CONTAINER(window), window_vbox);
  gtk_widget_show (window_vbox);

  notebook = gtk_notebook_new  ();
  gtk_widget_show (notebook);
  gtk_box_pack_start (GTK_BOX (window_vbox), notebook, TRUE, TRUE, 0);


  small_label = gtk_label_new (Small label);
  gtk_widget_show (small_label);
  gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
small_label,
NULL);

  big_label = gtk_label_new (
  T H I S   I S  A  B I G G E RL A B E L
  );
  gtk_widget_show (big_label);
  gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
big_label,
NULL);

  g_signal_connect ( notebook,
   switch-page,
   G_CALLBACK(on_notebook_switch_page),
   window );

  g_signal_connect_swapped ( window,
   delete_event,
   gtk_main_quit,
   NULL );
  // force it to be smaller than it ought to be
  gtk_widget_set_size_request (GTK_WIDGET(window), 100, 50);
  gtk_widget_show (window);
  gtk_main ();

  return 0;
}

--
Iago Rubio


Many thanks Iago. I'll try it when I can get a bit of time.

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


Re: Resizing window

2006-08-22 Thread Fernando Apesteguía
On 8/22/06, Samuel Cormier-Iijima [EMAIL PROTECTED] wrote:

 I had the same problem with a FileChooserWidget with an extra
 GtkExpander widget in it. One solution is to make the window fixed
 (unresizable). Of course, the downside is that the user can't ­­resize
 it himself. Let me know if you find another solution!
 Cheers,
 Samuel


Hi Samuel.

I'm still looking for a solution. My app has internationalization support.
So make the window fixed is not possible in order to allow all the different
messages to fit in the window. I'll read more documentation.

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


Resizing window

2006-08-21 Thread Fernando Apesteguía
Hi list!

I'm developing a simple application. I have a tabbed pane. Some of these
tabs are bigger than others, with more text and more widgets.
When I click on one of these tabs, the window growns, what is great, but
when I click in a smaller tab, the window doen't return to the minimum
required size... How can I achieve this behaviour? How can I have always
just the size what I need?

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


GtkTreeView, GtkListStore and more...

2006-08-17 Thread Fernando Apesteguía
Hi List!

I have a problem dealing with my GtkTreView and related objects.

In a first step, I need to add some rows to my GtkTreeView, so I used a pair
of:

gtk_list_store_append(model,iter);
gtk_list_store_set(model,iter,0,data1,1,data2,-1);

functions inside a loop.

After this, I will need to delete some elements in order to keep my list up
to date. My model is a GtkListStore.
So I need to rewind the Iter and then make it move one element at a time and
checking if it should be removed. I did something like this:

gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model),iter)

for(){
   ...
   if(should_be_deleted)
gtk_list_store_remove(model,iter);


gtk_tree_model_iter_next(GTK_TREE_MODEL(model),iter);
}

But this doesn't work, the first element is always deleted, so I'm not
incrementing the iter properly.

I tried doing:

iter2=iter;
gtk_list_store_move_after(model,iter,iter2);

to make the iter go after iter2 (who has the same position), but once again
the first element is always deleted

Can you help me?

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


Fwd: GtkTreeView, GtkListStore and more...

2006-08-17 Thread Fernando Apesteguía
Thanks,
I'll take it into account, but it doesn't fix the problem. The iter is not
incremented... I don't know why. The compilation shows no errors as the
debug terminal does not.

Can you point me to an example on how to traverse a GtkListStore?

Thanks

-- Forwarded message --
From: Iago Rubio [EMAIL PROTECTED]
Date: Aug 17, 2006 6:14 PM
Subject: Re: GtkTreeView, GtkListStore and more...
To: gtk-app-devel-list@gnome.org

On Thu, 2006-08-17 at 17:43 +0200, Fernando Apesteguía wrote:

 for(){
...
if(should_be_deleted)
 gtk_list_store_remove(model,iter);
 
 gtk_tree_model_iter_next(GTK_TREE_MODEL(model),iter);
 }

Try:

   if(should_be_deleted)
gtk_list_store_remove(model, iter);
   else
gtk_tree_model_iter_next(GTK_TREE_MODEL(model),iter);

gtk_list_store_remove() updates the iter to point to the next element,
so you should call gtk_tree_model_iter_next if the list item have not
been deleted. Otherwise you're moving the iter twice - one on remove,
second on  gtk_tree_model_iter_next.

Cheers.
--
Iago Rubio

___
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


Fwd: GtkTreeView, GtkListStore and more...

2006-08-17 Thread Fernando Apesteguía
I re-checked my code and I think I fixed it. It was a problem of sorting
(bad sorting, of course). Now it appears to work find.

Thanks for your advices

Best regards

-- Forwarded message --
From: Fernando Apesteguía [EMAIL PROTECTED]
Date: Aug 17, 2006 6:34 PM
Subject: Fwd: GtkTreeView, GtkListStore and more...
To: gtk-app-devel-list@gnome.org

Thanks,
I'll take it into account, but it doesn't fix the problem. The iter is not
incremented... I don't know why. The compilation shows no errors as the
debug terminal does not.

Can you point me to an example on how to traverse a GtkListStore?

Thanks


-- Forwarded message --
From: Iago Rubio [EMAIL PROTECTED]
Date: Aug 17, 2006 6:14 PM
Subject: Re: GtkTreeView, GtkListStore and more...
To: gtk-app-devel-list@gnome.org

On Thu, 2006-08-17 at 17:43 +0200, Fernando Apesteguía wrote:

 for(){
...
if(should_be_deleted)
 gtk_list_store_remove(model,iter);
 
 gtk_tree_model_iter_next(GTK_TREE_MODEL(model),iter);
 }

Try:

   if(should_be_deleted)
gtk_list_store_remove(model, iter);
   else
gtk_tree_model_iter_next(GTK_TREE_MODEL(model),iter);

gtk_list_store_remove() updates the iter to point to the next element,
so you should call gtk_tree_model_iter_next if the list item have not
been deleted. Otherwise you're moving the iter twice - one on remove,
second on  gtk_tree_model_iter_next.

Cheers.
--
Iago Rubio

___
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


Fwd: Fwd: Systray icon..

2006-08-13 Thread Fernando Apesteguía
I have no idea.. never heard before.

Tip: If you need help on using eggtrayicon, see the jabber code ;)

Regards

-- Forwarded message --
From: Enrico [EMAIL PROTECTED]
Date: Aug 13, 2006 12:27 PM
Subject: Re: Fwd: Systray icon..
To: gtk-app-devel-list@gnome.org

Fernando Apesteguía pronuncio' le seguenti parole il 11/08/2006 17:09:
 Using eggtrayicon.c and eggtrayicon.h

 Best regards


Many thanks for the help! I have noticed that there is also an
edgestatusicon.c and an edgestatusicon.h, what is the difference?

Thanks

Enrico
___
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


Fwd: Systray icon..

2006-08-11 Thread Fernando Apesteguía
Using eggtrayicon.c and eggtrayicon.h

Best regards

-- Forwarded message --
From: Enrico [EMAIL PROTECTED]
Date: Aug 11, 2006 5:05 PM
Subject: Systray icon..
To: gtk-app-devel-list@gnome.org

Hi at all!

How can I display an icon in the system tray without using GtkStatusIcon
(I've only GTK 2.8).

Many thanks!

Enrico
___
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


Fwd: Which widget should I use?

2006-08-09 Thread Fernando Apesteguía
Ok, Many thanks

I think I'll use a GtkTreeView.

Best Regards

-- Forwarded message --
From: Guy Rouillier [EMAIL PROTECTED]
Date: Aug 9, 2006 4:00 AM
Subject: Re: Which widget should I use?
To: gtk-app-devel-list@gnome.org

Fernando Apesteguía wrote:
 Hi list!

 I need to represent some data in my application. The data is actually a
 trace of functions. The size of the list is not fixed, but it has a limit
of
 200 elements. When the 200 limit is reached, I clear the older element and
 then add the new one.
 I have the list in a file (from procfs) and now I need to show it. I
thought
 about to draw the name of the function inside a rectangle and then an
arrow
 pointing to the next element. Something like this:

 __
 |func1|   ---   |func2|
 --   

 But I don't know what kind of widget I need to use. Maybe this is not the
 best way to represent this... should I use a treeview to show the list?
 Which are the advantages?

Well, unless you have a phenomenally wide screen, 200 boxes pointing to
each other as you depict above will never fit.  Besides, once you get
above 5-10 boxes, comprehension begins to plummet.

I'd just put them in a simple list, in whatever order makes sense to
your audience (first to last or last to first.)  You can do that with a
tree view backed by a list store.

--
Guy Rouillier
___
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


Which widget should I use?

2006-08-08 Thread Fernando Apesteguía
Hi list!

I need to represent some data in my application. The data is actually a
trace of functions. The size of the list is not fixed, but it has a limit of
200 elements. When the 200 limit is reached, I clear the older element and
then add the new one.
I have the list in a file (from procfs) and now I need to show it. I thought
about to draw the name of the function inside a rectangle and then an arrow
pointing to the next element. Something like this:

__
|func1|   ---   |func2|
--   

But I don't know what kind of widget I need to use. Maybe this is not the
best way to represent this... should I use a treeview to show the list?
Which are the advantages?

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


Fwd: threads gtk

2006-08-05 Thread Fernando Apesteguía
I'm not sure about what are you asking...
Bur I think that you should check the fork() return value in order to guess
if you are the parent or if you are the child (forked) process.

In addition... you could consider to use GThreads instead of the libc fork()
system call. It's not a good idea to mix different API's.

Here is a link you can take a look:

http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html

Regards

-- Forwarded message --
From: chabayo [EMAIL PROTECTED]
Date: Aug 5, 2006 6:22 PM
Subject: threads  gtk
To: gtk-app-devel-list@gnome.org

Hello, i'll ask for help with gtk  threading.


The rules of my template:

Create an output Window.
Listen on a Socket for commands.
Listen on a Socket for data.


I wanna have 3 threads - naturally.

Therefor i built that scheme:

main () {
...
   /* init threads */
   g_thread_init(NULL);
   gdk_threads_init();
...
   if ( ! pid ) {
 pid_t pid=fork ();
 gdk_threads_enter ();
 ...
 gdk_threads_leave ();
 exit ( 0 ); }
   else {
 pid_t pid=fork ();
 gdk_threads_enter ();
 ...
 gdk_threads_leave ();
 exit ( 0 ); }
}

...somebody will help me that to trick??


nynhjan





___
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail:
http://mail.yahoo.de


___
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


Fwd: glade begginer - callbacks.c

2006-07-19 Thread Fernando Apesteguía
In general, don't write anything in those files marked as generated by
glade. Most of them will be overwritten. (see the disclairmer at the top of
the file).

Instead, you could call the initialization functions from main.c before you
run into the gtk_main loop.

Best Regards

-- Forwarded message --
From: nuser [EMAIL PROTECTED]
Date: Jul 19, 2006 12:56 AM
Subject: glade begginer - callbacks.c
To: gtk-app-devel-list gtk-app-devel-list@gnome.org



hi,

my application is writen in c, and I use a file for the functions, another
one to hold the several structs are being used (using typedef), and the
functions prots.
another application uses these methods to manipulate data. so in the
other source.c, in the main() function i declared the pointers to those
custom data types (the structs), and include the header file I wrote. this
way all the menu options know that those functions I tell them to run, and
the data types I give as args, they exist somewhere.
my problem, i use anjuta and open glade from there when I need to edit
something on the GUI. I don't know yet what each file does on this default
template glade uses to save projects (on anjuta i started a GTK2 APP on the
wizard). where should i put:

- the declaration of those (pointers to) structs i'm going to use?
- where should i put those functions that manipulate data (create an
instance of those structs, destroy them, add information, retrieve
information), and that are going to be called from the GUI widgets (buttons,
etc)?
- depending on what is on certain data field of a given struct (those that I
made, which sometimes create sub structs that are another custom type of
data), some of these widgets may or may not be active (clickable, etc).

so forgive me if these are annoying and frequent questions, but i 'm
somewhat lost.

thanks!!

___
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: periodically check if a service is running

2006-07-13 Thread Fernando Apesteguía
Maybe you are looking for g_timeout_add function

http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#g-timeout-add


Regards

On 7/13/06, rupert [EMAIL PROTECTED] wrote:

 Hello,

 imm trying to create a small window that shows me if a serice is running
 and
 displays a small icon that shows the status
 i created this function that checks if a PID is there:

 gint check_samba(){
 gint smb_pid2;
 gchar check_smb_cmd[512];
 sprintf(check_smb_cmd, cat /var/run/samba/smbd.pid 2/dev/null);
 //g_print(%s, check_smb_cmd);
 smb_pid2 = system(check_smb_cmd);
 //g_print(%s, smb_pid2);
 return smb_pid2;
 }

 the function is called here:

   gint smb_pid;
   smb_pid=check_samba();
   //g_print(PID: %i, smb_pid);
 //while(1){
   if(smb_pid  0)
   {
   image1 =  g_object_new(GTK_TYPE_IMAGE,file,
 pics/ledgreen.png,
 NULL);
   }else{
   image1 =  g_object_new(GTK_TYPE_IMAGE,file, pics/ledred.png,
 NULL);
   }
   //}

   gtk_widget_show (image1);


 So how can I check and if neccessary change the picture lets say every
 each
 2 seconds?
 I thought i could use an endless while loop, but that didnt worked.
 Also the PID gets displayes when I call the function, but a g_print(PID:
 %i, smb_pid); give me (null)
 has been quite a while since i worked with C, so this may be a dump error
 by
 me.

 thx for your help
 ___
 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: GNOME tray

2006-07-13 Thread Fernando Apesteguía
Try with GtkStatusIcon

http://developer.gnome.org/doc/API/2.0/gtk/GtkStatusIcon.html

you can also use the eggtrayicon.c and eggtrayicon.h if you have an older
Gtk version.

This last approximation works on kde (sorry, I don't remember the version...
some of the newest that Gentoo uses)

Regards

On 7/13/06, César Leonardo Blum Silveira [EMAIL PROTECTED] wrote:

 Hello,

 How can I make my app appear on the GNOME system tray?
 If I can make it, will it also work on KDE and other environments were
 there is a system tray?

 Thank you,

 César B. S.
 ___
 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: Do GTKhave tabbed pane or multi-page or such?

2006-07-05 Thread Fernando Apesteguía
Are you looking for GtkNotebook?

http://developer.gnome.org/doc/API/2.0/gtk/GtkNotebook.html

Remember that the Guideline suggests not to use this if there are a lot of
tabs and they need to be scrolled... if that is the case, then use a list:
http://developer.gnome.org/projects/gup/hig/1.0/controls.html#controls-notebooks

Regards

On 7/5/06, justforfun [EMAIL PROTECTED] wrote:

 I am using GTK to develop a GUI for a low level app on Linux, so far so
 good.

 However, my app grows, I need more and more display capabilities. One
 window
 seems not having enough space...

 I have checked the tutorial on gtk.org, could not find abbed pane or
 multi-page or such.

 Am I missing something?

 Any help will be appreciated!!!

 Thanks!
 ___
 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: gtk_statusbar!

2006-06-30 Thread Fernando Apesteguía
As I previously said, you should call to gtk_main_iteration after you do a
GUI change (update the gtk_statusbar, update a label, whatever...). If not,
the GUI will be updated when the control is out of the callback (and you
call to real_operation() from a callback)

Try with the links I posted before.

Regards

On 6/30/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I'm new in gtk develop...so i'll need a bit more help!!

 Where do i've to include this part of code??

 this is mine...
 on_button1_activete
 {
 
 
 novd=real_opration(file);
 }

 int real_operation_file
 {
   fgets(fp,200,registro)  /*read number1*/
   gtk_statusbar_push(reading numeber1)
   gtk_statusbar_pop()

   fgets(fp,200,registro)  /*read number2*/
   gtk_statusbar_push(reading numeber2)
   gtk_statusbar_pop()

   fgets(fp,200,registro)  /*read operation*/
   if(strstr(operation,sum)
   {
 suma=num1+num2
   gtk_statusbar_push(operating..)
 }

 it onmy writes in the status bar operating...

 pleas,help me!!


 Mensaje citado por Fernando Apesteguía [EMAIL PROTECTED]:

  That's because you are calling real_opration() from the button callback.
 So
  the event loop is not running and it can't update your GUI. You should
 call
  gtk_main_iteration while gtk_events_pending==true
 
  more at
 

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-General.html#gtk-events-pending
  and
  http://developer.gnome.org/doc/GGAD/sec-mainloop.html
 
  Regards
 
  On 6/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  
  
  
   Hi everyone!
  
   I built a gtk_application with glade,it's a main window with menu.Wheni
   select
   a menu option, my program opens a new window with entries and buttons.
   In  the entry i write the name of a file to open.
  
   This file has the structure:
  
   number1   (ex.25)
   number 2   (ex.34)
   operation   (product)
  
   after writing the name,i push the button and it's called the function
   real_opration()
   This function mekes a lot of things,but the first one is read the
 numbers
   of
   entry_file and the opration.
   i'd like that in the status bar of this window(not main_window),it'll
 be
   written...
  
   reading number 1...
   reading number 2...
   operating..
   End
  
   i tried but only is written End.
   How can i change the content of statusbar,during reading the
 entry_file??
  
   thanks a lot
  
   ___
   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: gtk_statusbar!

2006-06-29 Thread Fernando Apesteguía
That's because you are calling real_opration() from the button callback. So
the event loop is not running and it can't update your GUI. You should call
gtk_main_iteration while gtk_events_pending==true

more at
http://developer.gnome.org/doc/API/2.0/gtk/gtk-General.html#gtk-events-pending
and
http://developer.gnome.org/doc/GGAD/sec-mainloop.html

Regards

On 6/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



 Hi everyone!

 I built a gtk_application with glade,it's a main window with menu.When i
 select
 a menu option, my program opens a new window with entries and buttons.
 In  the entry i write the name of a file to open.

 This file has the structure:

 number1   (ex.25)
 number 2   (ex.34)
 operation   (product)

 after writing the name,i push the button and it's called the function
 real_opration()
 This function mekes a lot of things,but the first one is read the numbers
 of
 entry_file and the opration.
 i'd like that in the status bar of this window(not main_window),it'll be
 written...

 reading number 1...
 reading number 2...
 operating..
 End

 i tried but only is written End.
 How can i change the content of statusbar,during reading the entry_file??

 thanks a lot

 ___
 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: where is GtkStatusIcon

2006-06-27 Thread Fernando Apesteguía
I had the same problem, finally solved with eggtrayicon.c and the
proper.h I'm not sure where I found it. But try in:

http://svn.ndesk.org/ndesk/nbind/ngtkext/eggtray/glue/eggtrayicon.c
http://svn.ndesk.org/ndesk/nbind/ngtkext/eggtray/glue/eggtrayicon.h

It worked fine for me :)

Best regards
On 6/27/06, zhang yang  [EMAIL PROTECTED] wrote:

 I have read gtk-reference on www.gtk.org. I found
 GtkStatusIcon - Display an icon in the system tray
 I want to set a icon in my tray,but I cann't find the difinition of
 GtkStatusIcon in gtk-devel package.I use suse-10 with
 gtk2-2.8.3-4.Why ?Can anyone tell me.Thanks in advance!

 ___
 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


Simple Yes/No dialog

2006-06-17 Thread Fernando Apesteguía
There is something named GnomeDialog with Accept and Cancel buttons, but it
is marked as deprecated in my Glade 2.10 so you should use it

More ideas?

-- Forwarded message --
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Jun 16, 2006 5:50 PM
Subject: Simple Yes/No dialog
To: gtk-app-devel-list@gnome.org

Ok, you guys were a great help with my last question :)  Does GTK have a
simple blocking yes/no dialog?  Something that will return true or false,
or similar?  I could write my own really quickly, but I was kinda hoping
GTK would save me a few lines of code.

___
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


C/GTK question

2006-06-17 Thread Fernando Apesteguía
Please, refer to some C tutorials and handbooks on Internet. This is a very
basic question. You should include .h files, not .c .

I recommend that you read first to learn C and then to learn GTK.
I liked C Course by Dave Marshal and Advanced Linux Programming as well,
both available on Internet.

Best regards

-- Forwarded message --
From: Matías Torres [EMAIL PROTECTED]
Date: Jun 15, 2006 5:08 PM
Subject: C/GTK question
To: gtk-app-devel-list@gnome.org

I'm building an application in C that uses GTK. The reason i'm doing this is
to learn GTK (and C as well) the main problem I've found is that i write all
the GTK code in only one file and is getting too da## big, so i tried to
divide the GTK code in different files, but it seems i'm do not understand C
that good. This is what i did:

global.c
   GtkWidget *mainWindow

gtkarch1.c   gtkarch2.c  gtkarch3.c   gtkarch4.c
/* Al this files uses the mainWindow variable, this is what i do:
gtkarchX.c
  #include global.c
  GtkWidget *mainWindow */

ant then the main.c file which looks like this:

main.c
#include gtkarch1.c
#include gtkarch2.c
#include gtkarch3.c

But the compiler gives me an error, which I understand but i don't know how
to solve it, that says that i'm redefining the variables declared in
global.c in each gtkarchX.c

So Help? please?
___
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


using gtk preffix, it's ok??

2006-06-07 Thread Fernando Apesteguía

Only for my curiosity... what does egg means? I remember that I asked this
to myself when I used eggTrayIcon :)

Best regards

-- Forwarded message --
From: John (J5) Palmieri [EMAIL PROTECTED]
Date: Jun 6, 2006 11:29 PM
Subject: Re: using gtk preffix, it's ok??
To: Alexandre [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org

On Tue, 2006-06-06 at 15:04 -0300, Alexandre wrote:

  Hi

  I'm in a project, to make a library with scientific widgets for gtk, and

I want to know if it's ok to use the gtk preffix in the functions and
objects.

  Or we have to use another preffix, since it's not official of gtk??

  Thanks,
  Alexandre.


Don't use the gtk namespace.  We don't even use the gtk namespace when
developing new widgets.  We use the egg namespace and then rename
everything when it gets merged in.

--
John (J5) Palmieri [EMAIL PROTECTED]

___
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


Xlib, thread and gnome

2006-05-15 Thread Fernando Apesteguía

That's a synchronization problem.  I experimented something similar a few
time ago.
The problem with Xlib is because probably you are not returning from a
callback or you take too long to go back and return to gtk.

If you are attempting to access gtk widgets from other thread than the
main one, you should prevent other threads access with gdk_threads_enter
and gdk_threads_leave as you did for gtk_main()

For instance, if your secondary thread updates a gtk_label you should do:

gdk_threads_enter();
gtk_label_set_text(label, text);
gdk_threads_enter();

Best regards.

PS: I'm not an expert at all... if I'm wrong, my apologies for all of the
list :)


-- Forwarded message --
From: nik600 [EMAIL PROTECTED]
Date: 15-may-2006 14:12
Subject: Xlib, thread and gnome
To: gtk-app-devel-list@gnome.org

hi

i am developing an application with gtk and thread.

I've received some Xlib: unexpected async reply  errors and looking on
the web i've see that i must use this code:

int
main (int argc, char *argv[])
{
GtkWidget *window;

/* init threads */
g_thread_init(NULL);
gdk_threads_init();

/* init gtk */
gtk_init(argc, argv);

window = create_window();
gtk_widget_show(window);

gdk_threads_enter();
gtk_main();
gdk_threads_leave();

return 0;
}

i've tried to add this code at my application but when i try to
execute it i get a segmentation fault error...

this is the reports of gdb:

Starting program:
/home/programmi/nik_stresser/nik_stresser/bin/nik_stresser_gtk
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 2739)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 2739)]
0x40037a12 in pthread_mutex_lock () from /lib/libpthread.so.0
(gdb) bt
#0  0x40037a12 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x40731cc5 in g_mem_chunk_new () from /usr/lib/libglib-2.0.so.0
#2  0x4071e809 in g_hash_table_size () from /usr/lib/libglib-2.0.so.0
#3  0x4071de12 in g_hash_table_insert () from /usr/lib/libglib-2.0.so.0
#4  0x40719073 in g_quark_to_string () from /usr/lib/libglib-2.0.so.0
#5  0x40718ec8 in g_quark_from_static_string () from /usr/lib/libglib-
2.0.so.0
#6  0x406f2b72 in g_type_init_with_debug_flags () from
/usr/lib/libgobject-2.0.so.0
#7  0x406f2d02 in g_type_init () from /usr/lib/libgobject-2.0.so.0
#8  0x405fb554 in gdk_pre_parse_libgtk_only () from /usr/lib/libgdk-
x11-2.0.so.0
#9  0x4042f6e3 in gtk_disable_setlocale () from /usr/lib/libgtk-x11-2.0.so.0
#10 0x4042f928 in gtk_disable_setlocale () from /usr/lib/libgtk-x11-2.0.so.0
#11 0x4073805b in g_option_context_parse () from /usr/lib/libglib-2.0.so.0
#12 0x4042fbce in gtk_parse_args () from /usr/lib/libgtk-x11-2.0.so.0
#13 0x4042fc06 in gtk_init_check () from /usr/lib/libgtk-x11-2.0.so.0
#14 0x4042fc56 in gtk_init () from /usr/lib/libgtk-x11-2.0.so.0
#15 0x0804cf5a in main (argc=1, argv=0xba84) at
src/nik_stresser_gtk.c:336
(gdb)

can you help me please? where am i wrong? thanks nik
___
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


Gnome Help

2006-05-11 Thread Fernando Apesteguía

Hi,

I would like to write the gnome help for a little application that I'm
developing, but I can't find any tutorials.
At developer.gnome.org I only found routines for displaying help, but... how
should I write the help? Is it XML or HTML?

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


Directory tree library?

2006-05-09 Thread Fernando Apesteguía

You should use a GtkTreeView object.

Read more at:
http://developer.gnome.org/doc/API/2.0/gtk/TreeWidgetObjects.html

Best regards

-- Forwarded message --
From: raul o [EMAIL PROTECTED]
Date: 08-may-2006 15:47
Subject: Directory tree library?
To: gtk-app-devel-list@gnome.org

Hello people:

I must implement a directory tree and I do not know by
where to begin. Somebody knows a library for GTK+ that
makes that task?

Thanks
RO





___
Win tickets to the 2006 FIFA World Cup Germany with Yahoo! Messenger.
http://advision.webevents.yahoo.com/fifaworldcup_uk/
___
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


Gthreads again

2006-04-24 Thread Fernando Apesteguía
Hi, I wrote a mail some time ago, but nobody answered me :(

My problem is that I had two threads. The second one was a pthread. I
performed and exit from a callback, so I had to pthread_cancel the secondary
thread to avoid a race condition and an eventual app crash.

Now, I'm using GThreads. I don't perform a pthread_cancel nor an equivalent
for GThreads, but the application appears to run well. Does gtk_main_quit()
kill the secondary thread properly or should I expect a crash of my
application?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Gthreads again

2006-04-24 Thread Fernando Apesteguía
The main thread is the only one that is running inside the gtk_main loop.
The secondary thread is only reading files. So if I do a gtk_main_quit() the
secondary thread will be no longer running because I have not a gtk_main
loop, right?

If I'm right why I had to explicitly kill the other thread when it was
created with pthread instead of g_thread?

-- Forwarded message --
From: Tristan Van Berkom [EMAIL PROTECTED]
Date: 24-abr-2006 19:21
Subject: Re: Gthreads again
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org

Fernando Apesteguía wrote:
[...]
 Now, I'm using GThreads. I don't perform a pthread_cancel nor an
equivalent
 for GThreads, but the application appears to run well. Does
gtk_main_quit()
 kill the secondary thread properly or should I expect a crash of my
 application?

Threads are allowed to run whether there is a GMainLoop, gtk_main() or
whatever else running in any other thread; if you are running gtk_main()
from a created thread; gtk_main_quit will not kill its own thread.

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


Gthreads again

2006-04-24 Thread Fernando Apesteguía
And how to kill the gthread if there is not something like pthread_cancel?

(Thanks for your patience)

Best regards

-- Forwarded message --
From: Tristan Van Berkom [EMAIL PROTECTED]
Date: 24-abr-2006 20:04
Subject: Re: Gthreads again
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org

Fernando Apesteguía wrote:
 The main thread is the only one that is running inside the gtk_main loop.
 The secondary thread is only reading files. So if I do a gtk_main_quit()
the
 secondary thread will be no longer running because I have not a gtk_main
 loop, right?

Wrong, the main thread is not running inside the gtk_main loop, the
gtk_main is running inside an arbitrary thread (happens to be the
main one); if you call gtk_main_quit(); then gtk_main() (in the main
thread) will return and the main thread will continue to execute
(typicly untill the return 0 a few lines later on).

 If I'm right why I had to explicitly kill the other thread when it was
 created with pthread instead of g_thread?

There is no reason why you dont have to explicitly kill the GThread,
if there is a race condition with your old code, there is still
a race in the GThread version.

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


refreshing widgets from callback

2006-04-19 Thread Fernando Apesteguía
Hi,

I had a function to refresh some widgets. Inside this function I perfomed a
gdk_threads_enter() / gdk_threads_leave() to prevent access from the
secondary thread.

update()
{
gdk_threads_enter()
...
...
gdk_threads_leave()
}

I wanted to reuse this function from a callback, but since callbacks run
inside a gdk lock I should remove my own lock to avoid a deadlock problem.
So I move the lock out of the function:

gdk_threads_enter()
update()
gdk_threads_leave()

This works fine and solves my problem. Should I assume is not a good
practice (for reusing at least) to lock gdk inside a function?
Am I confussing concepts? Is there a better way to do this?
I mean that it is possible that some code in update() could be done outside
of the lock... and if it can, it should be done outside to not locking the
other threads for a long time, right? (extrictly more time than necessary)

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


List of functions available against gtk/glib version(s)?

2006-04-18 Thread Fernando Apesteguía
Look in your gtk headers to know what is available and what is not.
At least I do this.

Best regards!

-- Forwarded message --
From: Justin Clift [EMAIL PROTECTED]
Date: 18-abr-2006 14:07
Subject: List of functions available against gtk/glib version(s)?
To: GTK App Dev Mailing List gtk-app-devel-list@gnome.org

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

Just tried compiling an app on Solaris 10, that I've been developing on
Linux.

A _bunch_ of errors ensured, mainly due to my using glib/gtk functions
that are in the (newer) versions installed on my Linux box.

Looking through the html docs for some gtk functions, some functions do
mention when they've become available.

However, a lot of functions (i.e. the GIO Channel stuff) don't.

Does anyone have, or know of, any kind of comprehensive list of which
functions are/aren't available for a specific version of GLib/GTK?

It would be really helpful. :)

Regards and best wishes,

Justin Clift
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFERNZ1FAuZn5lS2IMRAvT5AJ9ZMVejbcMx0CyHSg1DPtK8uvFqaQCgwoPK
qoK8WeX1EEsdZdQHpql+rDw=
=Mdyu
-END PGP SIGNATURE-
___
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


Xlib: unexpected async reply

2006-04-16 Thread Fernando Apesteguía
I think it's better you put some pieces of code so more people can help you.
I'm not an expert, but basically, you should block other threads when you
want to access GtkWidgets, e.g.

gdk_threads_enter()

  gtk_label_set_text(my_label,my_text);

gdk_threads_leave()

And try to return to GTK as soon as possible when you are inside a callback
or event handler.

A search in Google revealed, this kind of error with Xlib is usually related
to a function that doesn't return or makes too long before return.
Some parts of the Xlib are implemented as synchronous (message queues, for
example) and this error occurs when an asynchronous signal is received while
processing in synchronous mode.

Try to find if you are returning from all of your callbacks.

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


Xlib: unexpected async reply

2006-04-15 Thread Fernando Apesteguía
Hi list!

I get this error when runing my GTK application:

Xlib: unexpected async reply (sequence 0xdfd)!
(Te sequence number varies.)


A little explanation about the application:

It runs two threads. One of them is runing inside the gtk_main() loop.
The other one, periodically reads from different files and updates the
labels in the window. I use gdk_threads_enter() and gdk_threads_leave() to
block the other thread.

The aplication has a Tabbed Pane. Each tab shows information from a
different file.

Now, I get this error when I try to see the information showed by the last
tab I added. Basically, the cycle I implement is (pseudocode):

infinite_loop{
  ...
  if tab1_is_visible{
update_tab
  }
  ...
 pause;
}

and update_tab performs:

read_value_from_file();

gdk_threads_enter();
  update_labels();
gdk_threads_leave();

Since the error is realted to Xlib, I think I'm doing something wrong about
multi-threading, but I can't find what.
I'm doing as I did with the other tabs and I hadn't any errors like this

I've read http://mail.gnome.org/archives/gtk-list/1999-July/msg00438.htmlbut
I think this does not match my problem. I'm not calling to gtk
functions
from callbacks or signal handlers.

Any suggestions?

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


Xlib: unexpected async reply

2006-04-15 Thread Fernando Apesteguía
Hi, it's me again... now a bit embarrassed

I found the problem after more and more debugging.
The read_data_from_file() function was a function with variable number of
parameters implemented with va_list...
Due to a stupid mistake this function did not return when a certain number
of parameters was passed and then the function run into an infinite loop.

So I suppose that the message queue of Xlib was overflowed in some way.

Well, I hope this is helpful for someone with a similar problem :)

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


Segmentation Fault

2006-04-04 Thread Fernando Apesteguía
Are you dealing with threads?
Maybe it's a problem of concurrency.

Could you be more precise?

Best regards!

-- Forwarded message --
From: Sandeep KS [EMAIL PROTECTED]
Date: 04-abr-2006 19:31
Subject: Segmentation Fault
To: Gtk gtk-app-devel-list@gnome.org

Hello everyone,
  I have written a program using GTK which executes some shellscripts in
the background...After the shellscripts complete executing, a window is
displayed showing the completion details At this time segmentation fault
occurs.
Is there anyway to trace the exact cause of the segmentation fault...

I tried gdb, but it didn't show any error while executing the code..The
segmentation fault occured when the execution went to loop after displaying
the final window and waiting for user's interaction...

How can i find the reason for the segmentation fault?

Thanking you in advance...
Sandeep


Regards







-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save
big.
___
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


show/hide widget within other widget

2006-04-04 Thread Fernando Apesteguía
If you expected the user works with the calendar I think you can create it
at start up.

If using the calendar is not usual, maybe you could delay the creation and
when the user enables it, create the calendar and place it in your window.

Creating all widgets at start up is faster for you.. but if you planned to
show only one at a time, it is quite inefficient.

-- Forwarded message --
From: Andreas Kotowicz [EMAIL PROTECTED]
Date: 04-abr-2006 19:36
Subject: show/hide widget within other widget
To: gtk-app-devel-list@gnome.org

I have a main.c file like this:

int main(int argc, char **argv)
{
  GnomeProgram *program;

  program = gnome_program_init(bla, bla, ..)
  create_mainwindow();
  gtk_main();
  return 0;
}

where create_mainwindow reads like following:

void create_mainwindow (void)
{
  GnomeApp *window;
  window = create_ui();
  GtkWidget *calendar;
  calendar = create_calendar();
  gnome_app_set_contents(window, GTK_WIDGET(calendar));

  gtk_widget_show_all(GTK_WIDGET(window));
}

as you may guess, create_ui just sets up the window with menu and tool
bars, etc.
create_calendar creates a gtkcalendar.

Now in my create_ui function I have a menu option for enabling/disabling
the calendar. as the calendar is enabled by default, how should I now
disable (maybe hide) it? what's the most elegant solution for this
problem? I also think about the possibility to choose from a variety of
widgets to be displayed inside the contents window. and in my eyes it
doesn't make sense to first create all those widgets and then manually
show/hide them as needed (suppose I just want to have one widget at a
time).

I'm welcome for any suggestions,
cheers,
Andreas

___
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


Gthreads

2006-03-26 Thread Fernando Apesteguía
Hi,

I'm porting an application from pthread semantic to GThreads framework. I
used pthread_cancel(pid) to kill a thread, does exists something similar in
gthreads?

I've read
http://mail.gnome.org/archives/gtk-devel-list/2003-February/msg00082.htmland
it appears it doesn't exist.
So, if I performed a pthread_cancellation from a callback, how do I perform
the same with gthreads?

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


GUI construction tips

2006-03-21 Thread Fernando Apesteguía
Hi,

I'm creating a GUI with Gtk. I'm using VBoxes and HBoxes, so my app resizes
when dpi changes and so on.
But I don't like the look of some aspects. For example, If I have a Hbox
with two columns and I place two label (one in each column)
the label is so close to the window border. So I place additional columns
with a label beside the border. The label text is only a space. The effect
is that
I have now my other labels not close to the border, and it looks nice.

But I think this is not the way to manage this in fact I think this is a
bad workaround. I didn't see any  separator widget.
How can I do this?

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


GUI construction tips

2006-03-21 Thread Fernando Apesteguía
Yes, I'm using Glade and I knew there was a better way to do this :)
Thanks a lot.

So i'll try to set padding for my labels.

One more thing: what about if my problem now is with vertical alignment? i.e.
my labels are so close to the top border of the window.

Thanks in advance!!

-- Forwarded message --
From: Daniel Pekelharing [EMAIL PROTECTED]
Date: 21-mar-2006 13:48
Subject: Re: GUI construction tips
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org

It's easy enough to add padding space when packing your label into the
box like so:
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, padding)

I get the impression however that you are using Glade.. I don't use
glade myself but it should be perfectly possible to specify the padding
space somewhere in the widget properties editor.

Hope this helps..

- Daniel Pekelharing

On Tue, 2006-03-21 at 12:13 +0100, Fernando Apesteguía wrote:
 Hi,

 I'm creating a GUI with Gtk. I'm using VBoxes and HBoxes, so my app
resizes
 when dpi changes and so on.
 But I don't like the look of some aspects. For example, If I have a Hbox
 with two columns and I place two label (one in each column)
 the label is so close to the window border. So I place additional columns
 with a label beside the border. The label text is only a space. The effect
 is that
 I have now my other labels not close to the border, and it looks nice.

 But I think this is not the way to manage this in fact I think this is
a
 bad workaround. I didn't see any  separator widget.
 How can I do this?

 Best regards!
 ___
 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


Problem with GValue

2006-02-17 Thread Fernando Apesteguía
Sorry if this is so trivial...

Did you try to g_free it?

Best regards!

-- Forwarded message --
From: Maciej Piechotka [EMAIL PROTECTED]
Date: 17-feb-2006 11:43
Subject: Problem with GValue
To: Gtk Mailing list gtk-app-devel-list@gnome.org

I'd like to destroy GValue.
How should I do it?
I cannot find any information about it.

___
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


Threads and waits

2006-02-15 Thread Fernando Apesteguía
Hi,

I have an app. that runs two threads, the main one and other thread that
collects information from files. I launch the thread by calling
pthread_create and here comes my first question

¿Should I use g_thread_create instead? Now I have no problems with these
pthreads and I can perform mutual exclusion with gdk_threads_enter() and
gdk_threads_leave() so I'm not sure about change the kind of thread.

Under some conditions I would like the collector thread to make a pause. I
don't know how to do it with POSIX functions. I've seen Glib's API
documentation and I'm not sure how could I make this. ¿Should I use a Gcond?
As I can see in documentation, g_thread_yield is not recommended to be used.

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


About layouts

2006-02-14 Thread Fernando Apesteguía
Hi !

I'm developing an app with gtk. I use glade for GUI development. My question
is about the different kinds of layouts. I would like my app resizes by
itself when a label text is really long. I've noticed I can do this by
placing a table layout (I think vbox and hbox work well too).
In fact, this behaves well even when changing fonts dpi (This is the answer
to my question  that you can see at
http://mail.gnome.org/archives/gtk-app-devel-list/2006-January/msg00064.html
)

But my app has a lot of labels and buttons so I estimated I need a lot of
layouts creating a complex hierarchy (vbox inside a table layout, inside a
hbox, inside a table layout again...)

Did I forget a simply way to make this??

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


About layouts

2006-02-14 Thread Fernando Apesteguía
First of all, thanks for your suggestions.

Actually my app. uses a static layout and the GtkLabels inside this, don't
grown when the text becomes longer. The same GtkLabel behaves ok if it is
inside a GtkTable. So I think I will change the static container.

My app uses a menu bar and a GtkNotebook. In every tab, I have several
GtkLabels and ProgressBars. So if I choose to use non-static containers I
think I'll need two or three GtkTables for each tab.I have three tabs now
but it is expected to have at least five.

If I change the static layout + label for a deeper containers hierarchy
(three levels for example)... will I have a lack of performance when loading
the UI?

Thanks in advance!!!



-- Forwarded message --
From: Gus Koppel [EMAIL PROTECTED]
Date: 14-feb-2006 14:30
Subject: Re: About layouts
To: gtk-app-devel-list@gnome.org

Fernando Apesteguía wrote:

 I'm developing an app with gtk. I use glade for GUI development. My
question
 is about the different kinds of layouts. I would like my app resizes by
 itself when a label text is really long. I've noticed I can do this by
 placing a table layout (I think vbox and hbox work well too).
 In fact, this behaves well even when changing fonts dpi (This is the
answer
 to my question  that you can see at

http://mail.gnome.org/archives/gtk-app-devel-list/2006-January/msg00064.html
 )

 But my app has a lot of labels and buttons so I estimated I need a lot of
 layouts creating a complex hierarchy (vbox inside a table layout, inside a
 hbox, inside a table layout again...)

 Did I forget a simply way to make this??

Your question is not quite clear to me. It seems to be about two issues:
1. auto-resizing of labels, 2, what containers to use for your layout.

Regarding GtkLabels: automatic resizing is their default behaviour,
regardless of which sort of container (Gtktable, GtkVBox, etc.) it is
being put into.

Example: when working with Glade, just create an empty dialog window.
Drop a new GtkLabel into it (directly into the window, without
additional layout containers). Make the window as small as possible (not
via the minimizie button). You will see that you can't make the window
smaller than the dimensions needed by the GtkLabel to have its text
(should be label1 or similar) fully visible. In Glade's properties
window, when you type in additional text into the Label property of
the GtkLabel, you can see the window grow as you type. Again, this is
the default behaviour of GtkLabel (and most other types of widgets as
well) and is not bound to particular containers like GtkTables or Boxes.

However, if your texts may get really long, this behaviour shouldn't
actually be what you want. Especially if the label has disabled its
wrapping property, restricting the label text to just one line, the
horizontal size requirement by the label may easily exceed the screen's
dimensions, making the window wider than the screen as well. This would
make your application basically useless.

There are three common strategies to consider if you're planning to deal
with display of really long texts. They aim at avoiding unrestricted
size requests by the GtkLabel:
1. enable the wrap text property of the GtkLabel
2. put the GtkLabel into a GtkScrolledWindow
3. use GtkTextView instead of GtkLabel, with editable property unset.

Regarding the other aspect of your question: what layout containers to
use and the extent of complexity is determined solely by what layout you
actually want to achieve. For instance, having 20 rows with each one
consisting of a GtkButton and a GtkLabel next to it, and all widgets
aligned vertically, is quite a simple layout. You would only need one
GtkTable with 2 columns and 20 rows for it. You could also easily use 10
rows with 4 columns (button, label, button, label) each with the same
single table.

More complex layouts require additional layout containers, of course.
You didn't provide any idea what sort of complex layout hierarchy you
want to achieve so I can't give more detailed recommendations.
___
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


labels and dpi

2006-01-10 Thread Fernando Apesteguía
Yes but... in fact if I make a bigger label and the user changes dpi again,
I run into the same problem. My question is if this is fixable? Or can I
only make bigger the label?

Thanks in advance

-- Forwarded message --
From: Ronald Vincent Tarrant [EMAIL PROTECTED]
Date: 10-ene-2006 4:39
Subject: Re: labels and dpi
To: gtk-app-devel-list@gnome.org

Fernando Apesteguía wrote:

I have a problem about displaying text on labels. When I change the dpi
font
configuration, the text doesn't fit the label, so the message appear to be
cutted.

I would like to know if there is any way to handle this. May be I'm
forgetting some gtk_label_set_* function?


Have you tried changing the height/width of the label?

label.set_size_request(width, height)

Or perhaps this is too obvious and I'm going to get flamed for
mentioning it. :-)

-Ron T.


___
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


(no subject)

2006-01-10 Thread Fernando Apesteguía
Yes, in fact, callback function does. You cand do something like:

my_function(GtkWidget *mycontrol)

Best regards!!!

-- Forwarded message --
From: kalyani sathiyamoorthy [EMAIL PROTECTED]
Date: 10-ene-2006 7:39
Subject: (no subject)
To: gtk-app-devel-list@gnome.org

is it possible to pass a widget control as a arugument
to a function
regards
kalyani



__
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

___
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

labels and dpi

2006-01-10 Thread Fernando Apesteguía
2006/1/10, Ronald Vincent Tarrant [EMAIL PROTECTED]:

 Fernando Apesteguía wrote:

 Yes but... in fact if I make a bigger label and the user changes dpi
 again,
 I run into the same problem. My question is if this is fixable? Or can I
 only make bigger the label?
 
 
 
 If you're talking about the width, try adding a space at the end of your
 string like this: Label 

 It took me a while to figure out what you're talking about, but I
 remember running into this when populating a menu. Is that what you're
 doing?

 If so, that's the only fix I could come up with other than doing a lot
 of nonsensical calculations with dpi, etc.

 -Ron T.

 Actually, I want my app behaves for example like the gnome font dialog.
When I change dpi configuration, dialog, gnome panel and others, they expand
their widths and heights to fit the text. Did you try it?.

Maybe I'm missing some widget property to do this automatically. The other
possibility is to code calculations with dpi as you said.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


labels and dpi

2006-01-09 Thread Fernando Apesteguía
Hi,

I have a problem about displaying text on labels. When I change the dpi font
configuration, the text doesn't fit the label, so the message appear to be
cutted.

I would like to know if there is any way to handle this. May be I'm
forgetting some gtk_label_set_* function?

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


Catch signal

2006-01-04 Thread Fernando Apesteguía
Hi,

I've developed an app test to catch a delete_event for a window so I can
show some messages and then depending on the user answer close or not the
window.

My question is if there is a way to handle this signal from an external
application. This is The application B detects when the delete event has
been sent to the application A.

Is this possible?

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


gtk label size

2006-01-02 Thread Fernando Apesteguía
Hi to all of you and Happy new Year!

I'm translating my gtk app but I have a doubt:

Suppose that the window where labels are located is size-fixed. The problem
comes when I create the label longer enough (Great Mistake!!!) for most
of languages...
Normally the text is something like x but in some .po files, this is
translated as xx xxx  

What is the standard way to handle this? Should I  let the string to be
truncated by the size of the label? If this is the case,  would be a good
idea to set a complete tool-tip text?

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


gtk label size

2006-01-02 Thread Fernando Apesteguía
Many thanks Yeti

I tried it but my gtk version doesn't support gtk_label_set_ellipsize(). In
fact I'm not sure about my gtk version. I have a gtk-2.0 directory but I
have not gtk-config so I can't perform a gtk-config --version

Best regards

-- Forwarded message --
From: David Necas (Yeti)  [EMAIL PROTECTED]
Date: 02-ene-2006 18:44
Subject: Re: gtk label size
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org

On Mon, Jan 02, 2006 at 06:24:03PM +0100, Fernando Apesteguía wrote:
 Suppose that the window where labels are located is size-fixed. The
problem
 comes when I create the label longer enough (Great Mistake!!!) for
most
 of languages...
 Normally the text is something like x but in some .po files, this is
 translated as xx xxx  

 What is the standard way to handle this? Should I  let the string to be
 truncated by the size of the label? If this is the case,  would be a good
 idea to set a complete tool-tip text?

The standard way is to not make windows/labels/whatever
fixed-size.  If this isn't possible, use ellipsization --
see gtk_label_set_ellipsize().  Whether to add or not to add
a tooltip depends on situation, but generally it's a good
idea.

Yeti


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


GtkStatusIcon

2005-12-27 Thread Fernando Apesteguía
Hi,

I'm a bit confusing. I'm developing under Whitbox EL 4. I have this packages
installed:

gtk2-2.4.13-14
pygtk2-libglade-2.4.0-1
...
...
gtk2-devel-2.4.13-18
gtk2-engines-2.2.0-7.el4
gtk+-1.2.10-33
gtk2-2.4.13-18

As I can see in http://developer.gnome.org/doc/API/2.0/gtk/ it is
recommended to use GtkProgressBar instead GtkProgress. I did without
problems, and I see GtkStatusIcon in the documentation as a wrapper for
eggtrayicon but I have not that .h in my include files.

If I have gtkprogreesbar in /usr/include/gtk-2.0/gtk but I have not a
gtkstatusicon.h. How is this possible? Am I using a wrong version of gtk?

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


gtk expander

2005-12-23 Thread Fernando Apesteguía
Hi,

I have a problem with gtk expander. I create that object and put it in the
window, using Glade. But how can I attach controls to the expander so when I
click on it the controls are showed and when click again they aren't?

I've visited http://developer.gnome.org/doc/API/gtk/ but there is no
information about any Gtk Expander Widget.

Can you help me?

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


systray icon

2005-12-16 Thread Fernando Apesteguía
Hi,

Do you know how to find a simple example to make a systray icon in gnome
panel?
If you can tell me the name of the related functions, I'll search for
documentation.

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


systray icon

2005-12-16 Thread Fernando Apesteguía
I've looked for that header file and I have not it installed neither in
Ubuntu nor in Whitebox. I found the file in a web page of the GNU project,
but don't I need a lib to link against? I downloaded the header, but then
Anjuta said the functions I tried to use, were not found.

Thanks in advance

-- Forwarded message --
From: HuamiSoft Hubert Sokolowski [EMAIL PROTECTED]
Date: 16-dic-2005 19:52
Subject: Re: systray icon
To: gtk-app-devel-list@gnome.org


HI!

On Fri, 16 Dec 2005 17:42:24 +0100
Fernando Apesteguía [EMAIL PROTECTED] wrote:

 Hi,

 Do you know how to find a simple example to make a systray icon in gnome
 panel?
 If you can tell me the name of the related functions, I'll search for
 documentation.

look for eggtrayicon.h


--
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
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


Custom icons

2005-12-11 Thread Fernando Apesteguía
Hi,

I'm developing my first serious app for GNOME using gtk and Glib. At this
moment, the application works fine but I can set my custom icons. When I run
the application, I get this problems:


** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
lkmonitor/gnome-logo-icon-transparent.png

** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
lkmonitor/gnome-ccperiph.png

** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
lkmonitor/gnome-ccperiph.png

I'm using Anjuta and Glade to develope this program. I've read a discussion
thread between Naba Kumar and Miguel de Icaza but I didn't see the fix for
this problem (actually I think this is a problem on libglade, but may be I'm
wrong).

Can you help me?

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


Custom icons

2005-12-11 Thread Fernando Apesteguía
Its likely the path to your icons isn't right. If your using the glade
auto generated c code check the interfaces.c file for a line like
this

image1 = create_pixmap (window1, project1/blah.png);

I have the line:

img_cpu = create_pixmap (window1, lkmonitor/gnome-ccperiph.png);

but it doesn't work.

If you build the project and then try to run it right in that
directory Gtk can't find the pixmaps dir. A make install should put it
in your path. If you can't get that to work try putting the full path
to your icon instead...

/home/user/Project/project1/pixmaps/blah.png

That should works, but the path should be relative and make use of de
--prefix option in configure script.

I did:
./configure --prefix=/home/fernape/prueba

and copied png files into bin directory with the executable file but still
no enjoy.

More ideas?

Thanks in advance.
On 12/11/05, Fernando Apesteguía [EMAIL PROTECTED] wrote:
 Hi,

 I'm developing my first serious app for GNOME using gtk and Glib. At this
 moment, the application works fine but I can set my custom icons. When I
run
 the application, I get this problems:


 ** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
 lkmonitor/gnome-logo-icon-transparent.png

 ** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
 lkmonitor/gnome-ccperiph.png

 ** (lkmonitor:10713): WARNING **: Couldn't find pixmap file:
 lkmonitor/gnome-ccperiph.png

 I'm using Anjuta and Glade to develope this program. I've read a
discussion
 thread between Naba Kumar and Miguel de Icaza but I didn't see the fix for
 this problem (actually I think this is a problem on libglade, but may be
I'm
 wrong).

 Can you help me?

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



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


SIGABRT due double free

2005-11-24 Thread Fernando Apesteguía
Thanks, now it appears to works fine.

I thought gtk was completly thread safe, but is logic tu use a method
for mutual exclusion. Really thanks a lot.
We'll meet in my next post :)

Best regards!!

-- Forwarded message --
From: Andreas Stricker [EMAIL PROTECTED]
Date: 24-nov-2005 9:27
Subject: Re: SIGABRT due double free
To: gtk-app-devel-list@gnome.org


Fernando ApesteguXa schrieb:
 I'm developing a gtk/gnome application with two threads. An schema of
 the application is this:
 
[SNIP]

 thread_func is updating data periodically with a sleep pause.
 At this point, I suppose the other thread is catching events normally
 (in fact, tabs of the notebook changes without problems). Well, at
 short time from run app, I get:

 *** glibc detected *** double free or corruption (!prev): 0x006115a0 
 ***
 Program received signal SIGABRT, Aborted.

[SNIP]

 The curious thing is that I _have not_ any free, realloc or malloc in
 my code, only those that gtk/glib functions like g_file_get_contents
 can perform.


This looks like a race condition due missing mutual exclusion.
Did you read the API documentation and the various tutorials?

http://www.gtk.org/api/2.6/gdk/gdk-Threads.html

Cheers,

Andy
___
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


SIGABRT due double free

2005-11-23 Thread Fernando Apesteguía
Hi, I'll try to explain my problem as clear as possible:

I'm developing a gtk/gnome application with two threads. An schema of
the application is this:

void thread_func(){
blah
blah
...
}

main(){
blah
blah
...

pthread_create(thread_func);
...
...

gtk_main();
}

thread_func is updating data periodically with a sleep pause.
At this point, I suppose the other thread is catching events normally
(in fact, tabs of the notebook changes without problems). Well, at
short time from run app, I get:

*** glibc detected *** double free or corruption (!prev): 0x006115a0 ***
Program received signal SIGABRT, Aborted.

or

*** glibc detected *** realloc(): invalid size: 0x006122e0 ***
Program received signal SIGABRT, Aborted.

The curious thing is that I _have not_ any free, realloc or malloc in
my code, only those that gtk/glib functions like g_file_get_contents
can perform.

In fact, debugging with gdb and typing a bt after crash, I get:
#0  0x002a97ebb4dd in raise () from /lib64/tls/libc.so.6
#1  0x002a97ebcc8e in abort () from /lib64/tls/libc.so.6
#2  0x002a97eefb41 in __libc_message () from /lib64/tls/libc.so.6
#3  0x002a97ef546f in _int_free () from /lib64/tls/libc.so.6
#4  0x002a97ef5a06 in free () from /lib64/tls/libc.so.6
#5  0x002a9715540f in gdk_region_union ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#6  0x002a9715ac19 in gdk_window_invalidate_maybe_recurse ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#7  0x002a9715aebc in gdk_window_invalidate_rect ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#8  0x002a96e4ecf5 in gtk_notebook_new ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#9  0x002a96e50fb8 in gtk_notebook_get_tab_label ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#10 0x002a96e5177d in gtk_notebook_get_tab_label ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#11 0x002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#12 0x002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#13 0x002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
---Type return to continue, or q return to quit---
#14 0x002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#15 0x002a96f2af07 in gtk_widget_size_allocate ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#16 0x002a96f208a5 in gtk_vbox_new () from /usr/lib64/libgtk-x11-2.0.so.0
#17 0x002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#18 0x002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#19 0x002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#20 0x002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#21 0x002a96f2af07 in gtk_widget_size_allocate ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#22 0x002a96f353b9 in gtk_window_reshow_with_initial_size ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#23 0x002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#24 0x002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#25 0x002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#26 0x002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#27 0x002a96f2af07 in gtk_widget_size_allocate ()
---Type return to continue, or q return to quit---
   from /usr/lib64/libgtk-x11-2.0.so.0
#28 0x002a96f371d8 in gtk_window_get_position ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#29 0x002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#30 0x002a979d9ebc in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#31 0x002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#32 0x002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#33 0x002a96dc4403 in gtk_container_check_resize ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#34 0x002a97d2a606 in g_main_context_dispatch ()
   from /usr/lib64/libglib-2.0.so.0
#35 0x002a97d2c21e in g_main_context_acquire ()
   from /usr/lib64/libglib-2.0.so.0
#36 0x002a97d2c58a in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#37 0x002a96e39471 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#38 0x00406209 in main (argc=1, argv=0x7fb798) at main.c:121

am I doing something wrong? I don't know what to do.
I have:

glib2-2.4.7-1
glibc-2.3.4-2
gtk2-2.4.13-14
gtk-engines-0.12-5

Any ideas?

PS: I'm so, so sorry for this terrible long mail.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list