Re: g_spawn*() on windows

2014-07-03 Thread Vivien Malerba
Hi!
From memory you need a copy the gspawn-win32-helper.exe executable (in your
%PATH% I guess).
Regards,
Vivien


On 3 July 2014 14:25, jcup...@gmail.com wrote:

 Hi all,

 I'm using g_spawn_command_line_sync() to run a series of command-line
 programs (actually ImageMagick's convert, if that's important).

 It works fine, but on Windows I get an incredibly annoying console
 window flash up for a fraction of a second for each command. Does
 anyone have any good ideas for hiding this?

 From a bit of reading it seems that the glib helper program might need
 to be changed: it uses _wspawnv() to start the command and this will
 (I think) always show a console window for a console program. Is this
 right?

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

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


Re: g_spawn*() on windows

2014-07-03 Thread Vivien Malerba
I get it. Did you add the -mwindows flag when linking your exe?

Vivien


On 3 July 2014 15:33, jcup...@gmail.com wrote:

 Hi Vivien,

 Yes, I'm doing that. It all works and I can capture stdout and stderr
 from the convert.exe I'm running, it's just that I get a very annoying
 command window flash on the screen each time.

 If anyone has any ideas about the command window, I'm all ears :-(

 John





 On 3 July 2014 14:26, Vivien Malerba vmale...@gmail.com wrote:
  Hi!
  From memory you need a copy the gspawn-win32-helper.exe executable (in
 your
  %PATH% I guess).
  Regards,
  Vivien
 
 
  On 3 July 2014 14:25, jcup...@gmail.com wrote:
 
  Hi all,
 
  I'm using g_spawn_command_line_sync() to run a series of command-line
  programs (actually ImageMagick's convert, if that's important).
 
  It works fine, but on Windows I get an incredibly annoying console
  window flash up for a fraction of a second for each command. Does
  anyone have any good ideas for hiding this?
 
  From a bit of reading it seems that the glib helper program might need
  to be changed: it uses _wspawnv() to start the command and this will
  (I think) always show a console window for a console program. Is this
  right?
 
  John
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 

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


Re: GTK TreeView

2013-09-13 Thread Vivien Malerba
Hi!


It will probably work if you make the cells editable (
https://developer.gnome.org/gtk3/stable/GtkCellRendererText.html#GtkCellRendererText--editable
).
Alternatively, you could write your own cell renderer (maybe inheriting
GtkCellRendererText) to handle the selection yourself.

Regards,

Vivien


On 11 September 2013 18:05, Tech Support Department 
t...@frontrowcomputer.com wrote:

  Will someone please describe a way to make text selectable for the purposes
 of allowing the user to copy from a GTK TreeView.?   We are stumped.

 Thank you very much.

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


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


Re: UUID Library for Gnome apps

2013-05-30 Thread Vivien Malerba
Hi!

I use the libuuid library (uuid-dev and uuid-runtime packages under Ubuntu).

Regards,

Vivien


On 30 May 2013 07:37, אנטולי קרסנר tomback...@gmail.com wrote:

 Hello list,

 I'm writing a desktop app using Gnome technologies and I want to use
 UUIDs as means of generating URIs for resources.

 I found two UUID libraries: One is part of e2fsprogs, and the other one
 is provided by OSSP and has a C++ binding (perfect for me because I
 write in C++).

 I don't mind using a C library, but I'm not sure which UUID library is
 better for my app. The first one I mentioned, my whole system depends on
 it. And it's part of the Linux kernel. So I'm wondering, does using it
 create a dependency on Linux?

 And what is the recommended UUID to use? I see two options and I don't
 know how to choose. Choosing randomly would just create inconsistency,
 if each module just chooses one of them.

 regards,
 Anatoly

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

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

Re: question on opengl with gtk+

2012-10-26 Thread Vivien Malerba
On 24 October 2012 01:34, belal medhat belal.medha...@gmail.com wrote:

 i want to make scientific software on proteins and molecular cell biology
 i choose to use gtk+ because it is a beautiful GUI and cross platform on
 mac unix linux windows platforms
 and i will use with it CUDA gpu programming  but i need to setup opengl 4
 on gtk+ panel or canvas
 how to make it manualyy by myself
 how to setup opengl 4.2 on gtk+ canvas or panel and write pure opengl code
 ?
 thank you for your reply to my last questions and thank for effort and
 time


I suggest you have a look at Clutter (see https://live.gnome.org/Clutter
http://clutter-project.org/), specifically Clutter-GTK (which allows to mix
Clutter and Gtk widgets). I guess you need to dig a bit to actually use the
OpenGL API directly but it should be doable.

Regards,

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


Re: Knowing if a GThread is still alive

2012-10-01 Thread Vivien Malerba
On 1 October 2012 21:09, Jeff Johnston jeff.johnston...@gmail.com wrote:

 Good timing as I have this exact same question.

 The problem is there is no thread finalize callback to use as that would
 be ideal. It seems the only way that you can know that a thread is done is
 by using g_thread_join, which causes the current thread to wait. So, for
 now, what I did was spin up a thread to handle the thread that I care about
 so I can wait for the other thread to finish using the g_thread_join
 method. Then I use a signal to tell me when that thread is finished (ie,
 gets passed the g_thread_join call).


Isn't it a bit dodgy if there is already another thread calling
g_thread_join() on that same thread, as the doc says *Calling
g_thread_join() from multiple threads for the same thread leads to
undefined behaviour*.? I must say that in my case I'm programming a
library, and the thread which uses the library is not a thread I created
myself, so I guess I can't add a g_thread_join() on it.


 It would be nice to know what the official line on this is...the docs
 state There are better ways to find out if your thread is still alive but
 does not offer up what that better way is. It seems that a callback would
 be the most flexible way to handle it.


I agree, the doc needs to be more precise on these corner cases.

Regards,

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


Knowing if a GThread is still alive

2012-09-30 Thread Vivien Malerba
Hi!

g_thread_foreach() has been deprecated since Glib 2.32, and I wonder how I
can replace it: I used it to know if a GThread pointer corresponded to a
still alive thread.

So I'm looking for some advice on how to check if a GThread (say A) is
still alive while my code executes in another thread (say B). I've thought
about two ways to do this but could find none which seems to work:
1) lock a GMutex at some point when code is executed by A, and in B try to
lock the mutex. I don't think it can work because when A exits, the mutex
remains locked
2) configure thread A to execute a cleanup function when it exits (like
atexit), but I don't think it's doeable

Many thanks for any advice here!

Regards,

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


Re: Where to put graphic elements so I can find them again

2012-09-03 Thread Vivien Malerba
On 2 September 2012 23:04, Frank Cox thea...@melvilletheatre.com wrote:

 1. I have a custom graphic that I'm showing as a sort of a placeholder or
 background in my mailing list program.

 2. I see that most program-specific graphics on my computer seem to be
 located
 in /usr/share/pixmaps.

 Is it proper to put the custom graphic into /usr/share/pixmaps and just
 assume that it will be there, i.e use an absolute path to find it from
 within
 the program?

 If so, then how does  this integrate with a makefile using a ${prefix}
 macro?
 As soon as you change the prefix, you break the program unless you do some
 really fancy work with patch as part of the make, which seems awfully
 convoluted.

 If not, then how do you tell a program where to find this sort of graphic?
  My
 best idea so far is to take argv[0] and using that as a starting point,
 assume
 that the graphic is located in a subdirectory branched off of that path,
 i.e.
 if the program is in /usr/local/bin then we hope the graphic will be in
  /usr/local/share/pixmaps.

 Is there a better way to find a graphic background of this sort than
 specifying
 an absolute path and hoping to find it there?


You can also use Gio's Gresource for this purpose:
http://developer.gnome.org/gio/stable/gio-GResource.html

Regards,

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


Re: Examples of ComboBox using an explicit model?

2012-07-31 Thread Vivien Malerba
On 31 July 2012 00:12, James Tappin jtap...@gmail.com wrote:

 I am currently trying to implement combobox cell renderers in the
 high-level gtk-fortran code. Unfortunately unlike normal comboboxes where
 there is the convenience type of GtkComboBoxText this is not available for
 cell renderers.

 I have hunted for examples of a working combobox that uses an explicit tree
 model without any success. Does anybody on this list have such an example
 (or even better, of a CellRendererCombo) that they would be willing to
 share.


You can have a look at the cell renderer I implemented for Libgda, cf
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.hand
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
.

This cell renderer displays a text, along with a down pointing triangle
which, when clicked, displays a combo box.

Hope this helps you,

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


Re: How to draw GtkCellRendererCombo in (inside) a custom cell renderer?

2012-06-06 Thread Vivien Malerba
On 6 June 2012 09:51, Osmo Antero osm...@gmail.com wrote:

 Hello,
 I wanted to study the GtkCellRendererCombo so I added it directly to the
 treeview (as column).
 The combobox is initially hidden, only the text value is shown.
 The combo becomes visible after user clicks or double-clicks the column in
 the row.

 Unfortunately the click event does not work (or pass through) when the
 GtkCellRendererCombo is baked inside a custom-renderer class. Therefore it
 simply shows the text value, the combo-list itself is not accessible or
 visible.

 This might explain why GTK3 has NO renderer for very common type of
 widgets, like GtkButton.
 There is no GtkCellRendererButton class because it cannot handle the
 events.

 I may need to use the low-level painting functions directly, like
 gtk_paint_arrow(...)
 gtk_paint_shadow(...)
 gtk_paint_box(...)
 And somehow calculate the co-ordinates for click-events.

 Ref: http://developer.gnome.org/gtk3/3.4/GtkStyle.html

 All comments are welcome.
 // Osmo Antero

 /*
 Adding GtkCellRendererCombo directly (as column) to the treeview, just to
 study its behaviour.

 GtkTreeStore *store = gtk_tree_store_new(NUM_COLS,
   G_TYPE_INT,
   G_TYPE_POINTER,
   G_TYPE_STRING); // -- combo text field
 ...

 // Combo cell renderer (directly as column)
 renderer = gtk_cell_renderer_combo_new();

 GtkTreeIter iter;
 GtkListStore *combo_store = gtk_list_store_new (1, G_TYPE_STRING);
 gtk_list_store_append(combo_store, iter);
 gtk_list_store_set(combo_store, iter, 0, First Item, -1);
 gtk_list_store_append(combo_store, iter);
 gtk_list_store_set(combo_store, iter, 0, Second Item, -1);

 g_object_set (renderer, editable, FALSE,
has-entry, TRUE,
model, combo_store,
text-column, 0,
NULL);

 col = gtk_tree_view_column_new();
 gtk_tree_view_column_pack_start (col, renderer, TRUE);
 gtk_tree_view_column_add_attribute(col, renderer, text, COL_2);
 gtk_tree_view_column_set_title (col, Combo);
 gtk_tree_view_append_column(GTK_TREE_VIEW(tv),col);
 */


 On Tue, Jun 5, 2012 at 8:38 PM, Osmo Antero osm...@gmail.com wrote:

  Hello,
  I want to create my own cell-renderer for a treeview widget.
  This custom cell will contain a text string and a combobox with some
  values.
  So my custom cell (row) contains both GtkCellRendererText and
  GtkCellRendererCombo widgets.
 
  The cell renderer works well that it displays the text string, but the
  combobox is *invisible*.
 
  In cell-renderer.c, I carefully get the size of the combobox:
  gtk_cell_renderer_get_preferred_size(p-combo_renderer, widget, NULL,
  size);
  combo_area.width = size.width;
  combo_area.height = size.height;
 
  And then render it to cell with:
  combo_area.x = title_area.x + title_area.width + GUI_PAD;
  combo_area.y = fill_area.y + (fill_area.height - combo_area.height
 )/2;
  gtk_cell_renderer_render(p-combo_renderer, window, widget,
  background_area, combo_area, flags);
 
  See the render_row(...) function in cell-renderer.c file.
  But the p-combo_renderer (of type GtkCellRendererCombo) will not show
 up.
 
  The treeview row should display:
   Node 1-0 text  [Combobox with values]
   Node 1-1 text [Combobox with values]
   Node 1-2 text [Combobox with values]
  ...
  What could be wrong with my code?
 
  Here is a complete example of this:
  http://www.futuredesktop.org/tmp/Test6.tar.gz
 
  Use the m.sh script to compile it:
  $ ./m.sh
 
  Then run:
  $ ./main
 
  You should see this:
  http://bildr.no/view/1197967
 


I've implemented a custom combo in a cell renderer for Libgda, see the code
at
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
and specifically the  gdaui_data_cell_renderer_combo_start_editing() method.

Hope it helps you,
regards

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


Re: [gnome-db] GDA as Gee.Collection Reched Milestone 1

2012-02-20 Thread Vivien Malerba
On 13 January 2012 17:53, Daniel Espinosa eso...@gmail.com wrote:



 2012/1/13 Vivien Malerba vmale...@gmail.com



 On 13 January 2012 00:51, Daniel Espinosa eso...@gmail.com wrote:



 Here is what I propose to you:

- remove the generated files from git


- add to git the reference of these files along with a test
script (sh, python, perl, ...) which can then compare (or other) the
generated files with the expected reference files to enable you to 
 detect
any problem.

 The advantage of having a script to detect problems is that it can be
 documented (in its header for example) and run by anybody who thinks there
 is a problem.


 for example copy Gda-5.0.gir to libgda/gir ? And then a script to check
 diffs?


 Yes, for example create a libgda/girtest to store the expected GIR file
 (managed using git), let the build mechanism create the GIR file in
 libgda/, and then have a script in libgda/girtest (also managed by git)
 which compares (or does other tests) the two GIR files after compilation
 (maybe executed when make check is run).


 This could be Ok if you always know the file format and what contents
 might be in. GIR format is undocumented and in GDA depends on API additions
 or minor improvements.

 One of the aditional goals of GObject Introspectio is API verification,
 I would like to try on GDA and get a first hit. I filed bug 667837 to
 notify API break in GDA-5.0.gir generated by GI master, the problem comes
 when check Vala extensions and fails to find a function on Gda.DataProxy.

 As explained on GI website, we could hold GIR versions for each release,
 not each time we compile, because the resulting GIR could include API
 breaks that must be fixed before release. To deal with bug 667837, I can
 make use on Vala of custom code or metadata, but on Python or JavaScript,
 witch depends directly on GIR, I can't do that.

 Another is to autogenerate GIR files but not install them. Instead we can
 send a patch to Vala or fix our code to make sure we will get not API break
 but API additions and improvements. When a new release is ready, we can
 check for API breaks by manually or include Unit Tests cases for the whole
 API in Python.


Ok, I see it's a bit more complicated than I had anticipated. Then I'll let
you do what you think is the best.

However please add some doc (even as a README.GIR file for example) to tell
how and when GIR files are generated, checked, updated, validated,
whatever, so that other developers can understand what's going on.

Thanks,

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


Re: Glib linking error: undefined reference to ...

2012-02-20 Thread Vivien Malerba
On 17 February 2012 00:20, Christian Arnold chrarn...@web.de wrote:

 Hi,

 I am not sure if this is the correct way of asking my question, but I
 nevertheless hope someone can help me... I just tried to solve the problem
 for 4 hours, and I am extremely frustrated right now... I have the
 following issue:

 I installed Ubuntu 11.10 and some libraries and packages afterwards. I
 then installed glib 2.30. Everything went fine, I got no errors when doing
 ./configure, make, or make install. However, when I try to compile a test
 file in C, I can compile without errors, but I get the following  errors:

 glibTest.c:24: undefined reference to `g_timer_new'
 glibTest.c:32: undefined reference to `g_random_double'
 glibTest.c:36: undefined reference to `g_timer_stop'
 glibTest.c:55: undefined reference to `g_str_hash'
 ...

 I compile with:
 gcc `pkg-config --cflags --libs glib-2.0`  -g3 -O2 -std=c99 -Wall
 -pedantic glibTest.c -o glibTest

 pkg-config --cflags --libs glib-2.0 gives me:
 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/**include
  -L/usr/local/lib -lglib-2.0

 This all worked on my old laptop with Ubuntu 10.04, and I have no idea
 what the issue is. I tried to install glib 2.28 and the newest 2.31
 version, with the same error messages. I am no real expert, so please try
 to help me and let me know as precisely as possible how I can address the
 issue, I would greatly appreciate it.


Could it be possible that you try to use the static version of glib and,
because you pass it 1st on the command line, the symbols you use are not
there in the final exe? Can you try the command like:
gcc -g3 -O2 -std=c99 -Wall -pedantic glibTest.c -o glibTest `pkg-config
--cflags --libs glib-2.0`

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


Re: Need control of filename entry area in gtkfilechooser

2012-01-13 Thread Vivien Malerba
On 13 January 2012 04:34, Ferdinand Ramirez ramirez.ferdin...@yahoo.comwrote:

 When I type in the filename into the filename entry area in gtkfilechooser
 dialog, I want to intercept the text that is entered, modify it and then
 display it in the filename area. How do I do this?

 For a regular text buffer, I know how to do this: I can do a
 gtk_text_view_get_buffer and then have a callback for insert-text. I can
 then modify the text that is entered and then insert it into the buffer,
 all from inside the callback.

 I want to be able to achieve the same thing for filename entry. Does
 anyone know how to do this?


I don't think the GtkFileChooser API allows you to do this. However maybe
you can connect to the event signal as the GtkFileChooser is a GtkWidget,
and do some things from there.

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


Re: maybe known, maybe not...

2012-01-08 Thread Vivien Malerba
On 8 January 2012 03:49, Gary Kline kl...@thought.org wrote:


 o am trying to have a run button fork off a new gvim and increase
 a global counter after the first gvim is closed.  my main gtk goes
 dark and nothing responds in this case.  i don't know if every
 distro of linux does this or if it [ this error indicator] only
 allpies to Ubuntu.


GLib has a whole collection of API to handle spawing processes, see
http://developer.gnome.org/glib/stable/glib-Spawning-Processes.html

Regards,

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


Re: Can't find the list of all tags

2011-12-10 Thread Vivien Malerba
On 10 December 2011 01:33, Igor Korot ikoro...@gmail.com wrote:

 Hi, ALL,
 I am looking at the documentation for the gtk_text_buffer_create_tag().at

 http://developer.gnome.org/gtk/2.24/GtkTextBuffer.html#gtk-text-buffer-create-tag
 .

 Unfortunately it does not mention where I can get a list of all
 predefined tag available.


IFAIK there is any list of predefined tags. You have to define your own
tags before you can use them.



 I am also looking at some code where I see this:


 g_snprintf(buf, sizeof(buf), UNDERLINE);
 tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table(
 text_buffer ), buf );
 if (!tag)
tag = gtk_text_buffer_create_tag( text_buffer, buf,
 underline-set, TRUE, underline, PANGO_UNDERLINE_SINGLE,  NULL );
 gtk_text_buffer_apply_tag (text_buffer, tag, start, end);

 This code will make the text underlined.

 I need the code to make it a strikethrough. I tried the following:

g_snprintf(buf, sizeof(buf), STRIKETHROUGH);
tag = gtk_text_tag_table_lookup(
 gtk_text_buffer_get_tag_table( text_buffer ),
 buf );
if (!tag)
tag = gtk_text_buffer_create_tag( text_buffer, buf,
  strikethrough-set, TRUE,
  strikethrough,
 PANGO_ATTR_STRIKETHROUGH,
  NULL );
gtk_text_buffer_apply_tag (text_buffer, tag, start, end);

 but it does not work.


From this code snipet it's difficult to tell as there is no information as
how the start and end iterators are defined; you need to put one iter
before the text to apply the tage to, and one iter after. Also, the
strikethrough property is meant to be a boolean, see
http://developer.gnome.org/gtk3/stable/GtkTextTag.html#GtkTextTag--strikethrough
.

Regards,

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


Re: GLIB for a webserver

2011-12-08 Thread Vivien Malerba
On 8 December 2011 14:13, Marcelo Elias Del Valle - SYSMAP SOLUTIONS -
Claro MA-SP - marcelo.va...@claro.com.br wrote:

 Hello,

I am planning to use glib to write a C application server. I just
 like the library philosophy a lot and that’s why it is my first choice.
However, after searching the web for a while, I have found some
 critics, which I list bellow:

 - On Apache ARP project, they said they created it instead of using glib
 because the lack of IPC functions like memory mapping.
 - In some forums, people were complaining about the fact glib aborts when
 memory allocation fails, which is bad for a 24/7 running web server.


If you write applications which don't leak memory, then you probably won't
have any problem. Also if your web server fails because it consumes too
much memory, this also probably means that either your HW is not strong
enough to support your web server or your web server is leaking memory, and
in this last case having it fail and restarting it is IMHO quite a good
idea (much better code than trying to handle failed memory allocations).



I would like to know the opinion of those more experienced with
 glib. Do you recommend me to use it for writing a web server?


Please have a look at the LibSoup library, I've used it before for a small
embedded web server (in Libgda's console's tool) and it worked quite well,
but it really depends on what you want to do.

Regards,

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


Re: http support

2011-12-02 Thread Vivien Malerba
2011/12/2 Marcelo Elias Del Valle - SYSMAP SOLUTIONS - Claro MA-SP - 
marcelo.va...@claro.com.br

  Hello,

 ** **

 I would like to use gio for networking, including the
 GThreadedSocketService class. However,  I would like my application to
 support HTTP.

 Is there any HTTP library built on top of gio that
 provides HTTP protocol support?





I use LibSoup (https://live.gnome.org/LibSoup), you can see if it suits
your needs.
Regards,
Vivien
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_spawn_async and Windows service

2011-11-06 Thread Vivien Malerba
On 6 November 2011 20:31, Tomáš Šoltys tomas.sol...@range-software.comwrote:

  Thanks for help, but this is not the case. If I disable service
 commands in my application, then the command line program gets executed
 without any problem.


This is a good starting point then to understand what fails. I'm sorry I
cant' help you more on this front.



 This also leads me to another question I have.
 Is it possible to execute the program in the background? Because as it is
 done currently a new window (command line window) will appear and program
 displays its output there.


If you don't want the program to create a new command line window when you
run it, you need to pass the  -mwindows compile flag to gcc when you
compile it.

Regards,

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

Re: g_spawn_async and Windows service

2011-11-05 Thread Vivien Malerba
On 4 November 2011 23:05, Tomáš Šoltys tomas.sol...@range-software.comwrote:

 Hi all,

 I have created a windows service from which I would like to execute a
 command line program.
 I am trying to use g_spawn_async function.

 For to me unknown reason this is not working. Can someone please explain
 me why and whether it is possible?

 This is the returned error: Failed to read from child pipe (EOF)


This reminds me of a similar problem I once had because I had forgotten to
distribute the  gspawn-win32-helper.exe program as well, so make sure that
program is also available along with your binary.

Hope this helps,

Regards,

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

Re: GLib with Flex and Bison

2011-10-03 Thread Vivien Malerba
On 3 October 2011 02:37, Craig craigbakal...@verizon.net wrote:

 Hi,

 I have spent the past two weeks studying Flex and Bison.  It is great
 stuff!  I am about to try to use GLib in a Bison file, mainly calling
 functions on the GList Object.  I have never tried this before.  Will it
 work?  Are there any threading issues?


You can also use the lemon parser generator (http://www.hwaci.com/sw/lemon/)
which I find better to understand and use than Lex and Bison (no need for
external programs to compile, easier to understand, supports several
simultaneous parsing,...). It's the parser used (and made for) SQLite.
Libgda uses it extensively as well.

Regards,

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


Re: Transparent widgets

2011-08-07 Thread Vivien Malerba
Hi!

I've experienced a bit myself with transparent widgets, and I came up with
what you can see at
http://git.gnome.org/browse/libgda/tree/tools/browser/common/widget-overlay.c.
Even though it may not fulfill your needs, it may give you some ideas.

Regards,

Vivien

On 7 August 2011 14:42, Keith Poole plat...@gmail.com wrote:

 Hi group,

 I've spent nearly two days struggling with this one now, and I'm all out of
 ideas.

 I'm looking for a way to have a transparent widget, specifically a
 GtkLayout or GtkFixed. At the moment the GtkLayout is drawing over my window
 and it's custom background.

 Here's the concept art which gives you an idea of what I'm trying to
 accomplish (GtkWindow isn't decorated, so no frame shown)
 [image: Concept.jpg]
 (Sorry about the quality, compressed to stay under 40kb board limit)

 Thanks in advance
 -Keith


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


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


Re: Is goocanvas best for scrapbook type app?

2011-07-23 Thread Vivien Malerba
On 23 July 2011 16:52, Fred van Zwieten fvzwie...@gmail.com wrote:

 Hello all,

 I am getting into vala development and want to make a scrapbook like app
 where one can put all kind of photo's, pictures, graphics and text blocks on
 a canvas. For each of these item's, one should be able to move them around,
 resize them, put one partly over the other, etc. (you get the picture, i
 hope). This will ultimately be a plugin for shotwell.

 Now, i have been looking around for the best way to build this and it seems
 to me goocanvas is the best widget to use for this kind of functionality
 from vala.


I don't know if there are any vala bindings for it, but you may also want to
have a look at Clutter:  http://www.clutter-project.org/

Regards,

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


Re: g_win32_get_package_installation_directory_of_module()

2011-07-11 Thread Vivien Malerba
On 10 July 2011 21:01, John Emmas john...@tiscali.co.uk wrote:

 If I write a program using gtk-win32 and I want it to discover its
 installation folder at run time, I can examine argv (if it's available).
  Where it's not available however, I can call
 g_win32_get_package_installation_directory_of_module() passing it a NULL
 parameter.  Are there any equivalent API calls available for the OS-X and
 Linux platforms?


There is not such thing for Linux. For MacOSX there is something possible
AFAIK if your application is within a bundle (.dmg file).

Having had the same problem with Libgda, I reused/created some code to help
discover the actual location of the Libgda library at runtime, see
http://git.gnome.org/browse/libgda/tree/libgda/binreloc. Under Linux all the
magic is provided by some code copied form the Autopackage project.

Regards,

Vivien
___
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 connect the gnome aplication(gtk+) to database

2011-02-19 Thread Vivien Malerba
On 19 February 2011 09:22, angel kingdom angelkingd...@gmail.com wrote:

 HI,
 i am working on a application(project Gutenberg ) which is written in gtk+
 and i want to connect this application with database server to store
 dictionary.i am having the Dictionary in xml format.
 So,please guide me or give me a link of how to do this work.
 I am using ubuntu 9.04
 And for database i am using the postgresql..


Depending on your needs, you can use the Libgda library (
http://www.gnome-db.org) which integrates well with Gtk+.

Regards,

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


Re: Application path

2011-01-18 Thread Vivien Malerba
On 18 January 2011 06:18, John Emmas john...@tiscali.co.uk wrote:

 Thanks guys.  In fact, I only need this for the purpose of calculating a
 path that's relative to the location of the installed program.  It's of less
 importance on Linux because apps tend to be installed using the same path on
 everyone's system so generally, one can make an intelligent guess.  However,
 under Windows that's not necessarily the case.  I eventually solved it using
 g_win32_get_package_installation_directory_of_module(NULL) - but it didn't
 occur to me to check what happens if the app got started from a shortcut.
  I'll check that later today.  I'm not entirely sure what to do under OS-X
 though.  From my limited knowledge of Macs I believe the situation is
 similar to Linux - i.e. the user gets no choice over where to install an
 app, so the path will typically be identical for most users.  Is that a
 reasonable assumption?


For Libgda, I use some code initially produced by AutoPackage to enable
binary relocation on Linux, Windows and MacOSX, see the code in
http://git.gnome.org/browse/libgda/tree/libgda/binreloc.

Regards,

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


Help needed with offscreen window

2010-11-24 Thread Vivien Malerba
Hi all!

I want to create a GtkCellRenderer which renders a GtkWidget (each row
of the data model sets a property of the widget and it should render
differently). I face the problem that I can't force GTK+ to redraw the
widget before I get the pixmap from a GtkOffscreenWidget (that pixmap
is used copied into the cell area).

Attached is a small example which tries to render a GtkButton with
different labels for each row of a small data model.

Thanks for any help,

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

Re: Masking in GtkEntry

2010-11-04 Thread Vivien Malerba
On 4 November 2010 09:42, Vishak V. Kurup vishak.ku...@nestgroup.net wrote:
 Hi,



 Has anyone ever tried masking in a GtkEntry. I want to mask my gtkentry
 input in format ”%3d.%3d.%3d” (IP address).

I have written such a widget for Libgda (GnomeDb):
* 
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-entry.[ch]
is the basic implementation which can be further customized, for
Libgda into numeric data entry widgets and time and date data entry
widgets (ie. with a mask)
* 
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-numeric-entry.[ch]
and 
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-formatted-entry.[ch]
which are the specializations.
* there is a test program:
http://git.gnome.org/browse/libgda/tree/testing/gdaui-test-widget-entry.c

Regards,

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


Re: multithreading gtk app

2010-06-30 Thread Vivien Malerba
On 30 June 2010 02:57, Mick bare...@tpg.com.au wrote:
 can anyone point me to an explanation (with examples) to help me
 understand running some dialogs in separate threads. (eg. help,
 preferences, etc)

The general recommendation is to avoid using any GTK+ object from
different threads (because it does not work on Windows and from my own
experience it becomes very difficult to debug), but rather to devote
one thread to all the GTK+ objects, create other threads to do
specific jobs and have those threads communicate (using the GLib's
features).

Regards,

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


Re: Anyone for CMake?

2010-06-28 Thread Vivien Malerba
From my own experience trying to have Libgda use CMake to compile,
CMake still lacks/badly supports some features which are available
using the autotools, such as:
* convenience libraries
* pkg-config support
For Libgda, this means I would have to reorganize much of my code,
which is a very complex task, not worth it considering that one can
cross compile for Windows if needed (or even natively compile using
mingw/msys). I also had some other troubles, notably the lack of
documentation, which made me stop trying to use it. Maybe I'll start
again in a future version of CMake.

However I understand the lack of support  for VisualX support as a
problem for potential contributors.

Regards,

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


Re: [gnome-db] Include Gir file with constant #x1b;[;31;1m

2010-03-01 Thread Vivien Malerba
On 1 March 2010 17:01, Daniel Espinosa eso...@gmail.com wrote:
 I'll test it as soon as possible, by using JavaScript and may be Vala.

 Very thanks.


Ok, thanks a lot.

BTW, you were working on Gobject introspection for Libgda-ui, do you
have something working? If so I can integrate it into the current
trunk and release it with the next 4.1.x version.

Regards,

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


Re: [gnome-db] Include Gir file with constant #x1b;[;31;1m

2010-02-27 Thread Vivien Malerba
On 25 February 2010 19:03, Piotr Pokora piotrek.pok...@gmail.com wrote:
 Daniel Espinosa pisze:
 Are there any important reason for this? Because 4.2 will be released
 shorty (I think).

 I am doing my best to have Libgda 4.0.7 included in upcoming Ubuntu
 Lucid (which is Long Term Supported release).
 To make this happen I requested Libgda updates in Debian unstable (which
  migrated to testing release already). If GIR support could be ported to
 4.0 branch and 4.0.8 could be released in reasonable short time, there
 is a chance many people could be happy with stable and easy available
 Libgda for long time.

GIR support has been added to the LIBGDA_4.0 branch, but I haven't
tested it at all (though it's the same as for the master branch and it
works fine), so some minimal testing should be done here.

I can make a 4.0.8 anythime you want. Tell me.

Vivien

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


Re: Connecting GTK application to a database

2010-02-23 Thread Vivien Malerba
On 23 February 2010 17:16, Tor Lillqvist t...@iki.fi wrote:
 Can somebody help me with connecting a gtk interface with a backend
 database, say, Posgres? How does one embed SQL queries in the C code.?


The Libgda library provides an uniform access to databases using a
GObject oriented API. See http://www.gnome-db.org.

Note that the stable version only contains non UI features and the
unstable (read: being worked on) features some GTK+ based UI widgets.

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


Re: Creating Buttons from PNG Images. (GTK+C)

2009-10-13 Thread Vivien Malerba
2009/10/12 K.B. balarkalp...@yahoo.com:

 Hello every one,

 Sorry if i am posting this question in wrong place.
 I am new to GTK just doing some examples manually and by using Glade...
 I just want to create Buttons like shown in below Image.

 Image: http://www.nabble.com/file/p25853819/Buttons.JPG Buttons.JPG

 These are created with 4 PNG Images.
 Normal, Pressed, Focus, Disabled.

I've never used images as button states, but maybe the GtkStyle
associated to a button can be tweaked to do the trick (there is a
bg_pixmap[] attribute).


 Using GTK under C. Does anyone knows how to do it?
 How we to add images to Button?

GtkButton objects inherit from GtkContainer (specifically GtkBin) so
you can add images to buttons using gtk_container_add().

Regards,

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


Re: GTK+ on windows

2009-10-13 Thread Vivien Malerba
2009/10/13 Dov Grobgeld dov.grobg...@gmail.com:
 I have created several cross-platform gtk programs, and while it took a
 while to get right the first time, my development is now so trustworthy that
 I can do all my development under Linux and then once it works, just
 generate a windows installer and I know that it will just work. I am using
 mingw for all my windows gtk work, and usually I'm doing the windows
 generation through cross compilation. My build environment is scons with a
 SConstruct file that has a couple of if's in the beginning to resolve the
 differences between the different environments.

 Trying to say that using mingw instead of MSVC makes the result less native
 is as absurd as saying that using the Intel compiler would make it less
 native. Of course there are people who for whatever reason prefer the Studio
 IDE, and I respect that. (Can you configure Studio to use gcc instead of
 microsoft like you can make it use the intel compiler?) In any case, as gtk
 is a pure c-program, there are no ABI differences between the visual
 compiler and gcc. So why can't you just use the standard gtk distribution

I'm making a library using a cross compilation environment and it
works fine, except when one tries to use that library I've compiled
using mingw from the visual studio IDE because then the whole
application ends up being linked to several msvcrt*.dll files which
can't share anything, and crashes if anything is shared (like for
example stdout).

So for libraries, the environment (and compiler) used to generate the
DLL is important for the person using that DLL and from what I know
Windows developpers most of the time don't use GCC.

Anyway that's my small Windows experience.

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


Re: csv (comma separated value) file

2009-08-11 Thread Vivien Malerba
2009/8/11 Damon Register damon.w.regis...@lmco.com

 Joshua Lock wrote:

 GSF (GNOME Structured File Library)[1], which Gnumeric uses, does CSV:

 http://library.gnome.org/devel/gsf/stable/gsf-Text.html

 Since I am interested in parsing csv data, I got interested in this
 thread.  I am not motivated enough to develop a library for a simple
 project so the two suggestions (gsf and gda) from this thread interest
 me more.http://libcsv.sourceforge.net/

  1.

 I looked at these two links and got the impression that this could
 generate a csv output but I didn't see anything obvious about reading
 csv data.  Is that the case or am I missing something.

 At first look, gda seems like it would be the most useful for csv
 in and out.  Is that a correct conclusion?   I am going to try to learn
 gda but so far I don't find any simple but complete examples that might
 help me learn to use gda.  Does anyone have a simple but complete example
 showing how to read a csv file?


Libgda enables import and export data from and to CVS files; for an example,
there is
http://git.gnome.org/cgit/libgda/tree/samples/Virtual/virtual-test.c, part
of the sources.

However if you only want to import CSV data Libgda may be overkill and there
is the direct LibCSV  which Libgda internally uses, at
http://libcsv.sourceforge.net/

Regards,

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


Re: Bringing a GtkWindow to the current desktop with libwnck

2009-07-05 Thread Vivien Malerba
2009/7/3 Jim George jimgeo...@gmail.com

 Hi all,
 I'm writing a program that needs to be single-instance. The program
 will only run on gnome desktop machines. I'm using dbus to ensure
 this, by having the program try a dbus rpc each time it starts. If
 there's a running instance, it responds to the rpc by calling
 gtk_window_present on the main window. However, if the user switches
 desktops and tries to run another instance, gtk_window_present will
 only cause the window to appear on the previous desktop, not the
 current one.

 I tried to get around this using libwnck. I call
 wnck_window_get(GDK_WINDOW_XID(main_window-window)), but the
 WnckWindow returned is always NULL. The X window ID seems to make
 sense (it's a large integer), so what am I doing wrong?


You could use Libunique http://live.gnome.org/LibUnique for that purpose.

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


Re: g_spawn_async in win32

2009-06-29 Thread Vivien Malerba
2009/6/29 r albl...@xs4all.nl

 Hi,

 I have a gtk program doing now and then a calculation taking a few secs.
 To prevent freezing my appl. I want to use for Linux g_thread.
 However, this is not supported for Windows in combination  with gtk.


No, what is apparently not supported on Win32 is manipulating GTK+ objects
from several threads at once. What you can do is have one thread for all the
UI (GTK+ objects) and one or more threads for the calculation task(s) and
use some thread safe communication mechanisms between the UI thread and the
worker thread(s).

Regards,

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


Re: Gtk+ time-consuming threads

2009-05-07 Thread Vivien Malerba
2009/5/6 patkhor indyz-fl...@hotmail.com


 Hi,

 I'm trying to add GUI for my application and I choose to do it with Gtk+.
 I've asked on this forum before about multithreading, but I still can't get
 it right. I found few examples on how to use gthread on the web, but none
 of
 them answers my question.

 My problem is:
 I provide the user with the OK button, when user click on that button, the
 program will create some number of threads (more than 10) and each threads
 will do time-consuming work in the background. I successfully compiled my
 program, but when I click on OK button, the main window freeze (display
 not
 responding message on Windows machine).

 One person on this forum suggested to me (thank you very much) that I
 should
 make the threads unjoinable because the main thread have to wait for all
 threads to finish their execution that's why the main window freeze. So I
 eliminate all g_thread_join() but the problem still occur.

 Could someone please give me little sample code that provide only one
 button. When that button is clicked some number of threads will do
 something
 time-consuming in the background (something simple like multiplying numbers
 1000 times in the for loop, just to give me an idea).


Here is a very simple example to get you started. It will be easy to add
thread joining, and it's missing some locking.

Vivien


ThreadButton.tbz
Description: application/bzip-compressed-tar
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Strange GHashTable behaviour

2009-04-21 Thread Vivien Malerba
2009/4/21 Luka Napotnik luka.napot...@gmail.com

 Hello,

 I'm experiencing strange GHashTable behaviours when looking up a value
 throught a string key. I pass the key as a stack-allocated string to the
 hash table. For most lookups it works flawlessly but sometimes I get an
 invalid pointer. It even looks normal but data can't be accessed at that
 address.

 I have about 50 unique UUID keys and I'm inserting them to the hash
 table one by one with an associated data pointer. AFAIK,
 g_hash_table_lookup() should return NULL when the element with the
 provided key was not found in the table.

 So, does anyone have an idea what is going on here? Please help.


Is the problem on the key or on the returned value of a
g_hash_table_lookup()?

Did you give any destroy functions to g_hash_table_new_full() and use
g_hash_table_insert() again with the same key?

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


Re: Designing a 'console' with GtkTextViewer

2009-03-07 Thread Vivien Malerba
2009/3/7 Dutta, Seemanta seema...@qualcomm.com


 Hi,
 I want to design a console based interface to my application. The console
 would enable the user to manually give commands to my application. Something
 akin to the python console that you get in RhythmBox.

 I am planning to use GtkTextViewer widget for this. My main requirement for
 the console is that It should not allow the user to 'scroll-back' and edit
 past commands, which would be very inconsistent. In other words it should
 behave just like a terminal command line, allowing line editing for the
 current line only. I am not thinking of readline support right now but that
 can be added later as an enhancement.

 My question: Is that possible in GtkTextViewer? I always thought that I can
 set the entire widget as editable or non editable. But if I set it as
 editable, then I don't want the user to be able to scroll up and fiddle with
 text that is present above.

 Can anyone please advise?


I had written something similar for Gnome-DB a while back, have a look at
it:
http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb-extra/gnome-db-sql-console.c?revision=1747view=markup

Basically I had to tag some parts of the text as read-only along with some
scrolling...

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


Re: how to add button inside the treview list

2008-12-16 Thread Vivien Malerba
AFAIK, you can't display a button in a treeview column (no GtkCellRenderer
exist for this). Also having buttons for each row would make the treeview
not as much useable as it is now because each button would consume
ressources (memory and X ressources), and it is not how GtkCellRenders are
designed (they mainly only paint contents).

You'll have to write your own GtkCellRenderer to make it display whatever
you want and maybe the best is that the cell renderer display a button when
it is being edited (have a look at the GtkCellRendererText which adopts this
approach).

Vivien

2008/12/16 prasadam kumar prasadamku...@gmail.com

 Hi,

 I am unable to find the way to add the button inside the treeview using GTK
 'C' bindings.
 I am able to insert pixbuf,togglebuttons,processbar inside the treeview,
 but
 according to my requirement i have to put Button inside the treeview. I
 have
 not found any API  related to button with treeview.

 My requirement is:
 1. I need three columns.
 2. First column should be string so i can display the strings, rest of two
 columns I want to display buttons.

 Please some one help out how to solve this and feel free to giving the
 suggestions.

 Thanks in advance.

 Regards
 PPK
 ___
 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: loading pixmaps from the C source

2008-10-22 Thread Vivien Malerba
2008/10/22 Henri Häkkinen [EMAIL PROTECTED]

 Hello,

 I am writing a simple GTK+ 2.0 application which uses the GNU build system.
 The application opens a status icon on the system tray area and the icon is
 loaded from a image file. By default, the icon gets installed to the usual
 location (/usr/local/$PACKAGE/pixmaps), but the user may choose to install
 the package to some other place by using --prefix etc. configure script
 options.

 What is the correct way of opening image files from the C source then? How
 do I know where the look for the installed data files?


I do this myself by getting the specified install path in the Makefile.am
file as #defines and using the path in the C code. For example see
http://svn.gnome.org/viewvc/libgnomedb/trunk/extra/Makefile.am?view=log

Also I've found that this method has its limit if the user actually installs
or copies the compiled version somewhere else, or if you want to compile for
Windows or Mac OS, in which case you can use a binreloc layer. For example
see http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb/binreloc/.

Regards,

Vivien




 --
 Henri Häkkinen
 ___
 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-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu [EMAIL PROTECTED]

 how to get the value from the selected row in gnome_db_raw_grid?
 so i can put it inside gtk_dialog


GdaDataModelIter *iter;
iter = gnome_db_data_widget_get_current_data (GNOME_DB_DATA_WIDGET
(raw_grid);
const GValue *value;
value = gda_data_model_iter_get_value_at (iter, your_column);

Cheers,

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


Re: [gnome-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu [EMAIL PROTECTED]

 gda_data_model_iter_get_value_at is in V4

 can i do g_printf(%s, value) ?


No, you can't because value is a pointer to a GValue structure, not a
string.




 i am always confuse with the datatype GValue.. how to make sure it is
 of type char or integer?


use G_VALUE_TYPE (value), for example:
if (G_VALUE_TYPE (value)  == G_TYPE_STRING)
g_print (%s\n, g_value_get_string (value));

You can also use gda_value_stringify(value) which will return a string to be
used for debug purposes.




 using try and error. i manage to print the value using

 list = GDA_PARAMETER_LIST (iter)-parameters;
 param = GDA_PARAMETER (g_slist_nth_data (list, 0));
 str = gda_parameter_get_value_str (param);

 i am not sure it is the best way. is there any other better way i can
 do it in V3?


It's the correct way. The returned string should take into account your
locale settings as well.




 thank you


You're welcome!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [gnome-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu [EMAIL PROTECTED]

  gda_value_stringify(value)

 assume that i know, the value return is string, then i can simply use
 this function so i can print
 (GValue to gchar) the string.  but there is no function to conver
 GValue to gint or gfloat..


Yes, there are
g_value_get_int()
g_value_get_float()...



 the only function i can think of is gda_value_numeric but it doesn't do
 that.

 so assume that i know, that i have a double datatypes inside my table
 column, how i can get
 the value and assign it in a gdouble variable ?


mydouble = g_value_get_double (value);




 for example, if gchar,

 i can simply
 gchar *str;
 str = gda_value_stringfy ();


The gda_value_stringify() works for GValue of any type.

Cheers,

Vivien
___
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 modify the GnomeDbDataWidgetInfo?

2008-09-19 Thread Vivien Malerba
2008/9/19 Daniel Espinosa [EMAIL PROTECTED]

 May be could be usefull to modify the code at GnomeDbDataWidgetInfo in
 order to add properties that allows to hide this objects, in order to share
 this functionality.


Yes, I'll note that on my TODO list.

Vivien
___
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 modify the GnomeDbDataWidgetInfo?

2008-09-17 Thread Vivien Malerba
2008/9/17 paragasu [EMAIL PROTECTED]:
 by default, gnome_db_form/gnome_db_grid widget create a set of control
 (GnomeDbDataWidgetInfo). To add or manipulate data.

 For my application, i only need the update button, i do not need the
 insert, add or
 the next record button. How to remove all button except the update button?

 Or how i can create my update button to do function exactly like the one used 
 in
 the GnomeDbDataWidgetInfo update button.

Hidding buttons is not supported by the GnomeDbDataWidgetInfo widget.
However, there are several things you can do:
1) copy the source of GnomeDbDataWidgetInfo (rename it to be one of
your widgets) and remove the unnecessary code, then pack together a
GnomeDbRawGrid/Form with your new widget
2) pack a GnomeDbRawGrid/Form with a button of your own for which the
callback function will call
gnome_db_data_widget_perform_action(rawform/grid,
GNOME_DB_ACTION_WRITE_MODIFIED_DATA)
3) use gnome_db_data_widget_set_write_mode(rawform/grid,
GNOME_DB_DATA_WIDGET_WRITE_ON_VALUE_ACTIVATED) for example, in which
case you don't need any button at all

In any case you'll have to create a GnomeDbRawForm/Grid widget first.

Hope this will help you,

Vivien

BTW: please use the Gnome-DB mailing list for questions related to
libgda/libgnomedb.
___
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 display photo in the GnomeDbGrid?

2008-08-26 Thread Vivien Malerba
2008/8/26 paragasu [EMAIL PROTECTED]:
 i am developing gtk application using libgnome-db and postgresql.
 i store photo as bytea inside one of the table column.

 how to display the photo using the gnomedbgrid?
 is it possible to do it?

 thank you

You can have a look at the gnome-db-demo program:
http://svn.gnome.org/viewvc/libgnomedb/trunk/extra/demos/grid_pict.c?view=log

Regards,

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


Re: GTK - reading data from database

2008-07-31 Thread Vivien Malerba
2008/7/31 Mathias Hasselmann [EMAIL PROTECTED]:
 Am Mittwoch, den 30.07.2008, 18:33 -0700 schrieb paragasu:
 i am writing a gtk application to interface with postgresql database.
 the database contain few hundred rows. how programmer usually do this,
 the load the entire database content to app or just load part of it?

 First of all I'd suggest to have a look at libgda[1]. This library
 abstracts database access and also provides widgets for database access.
 Maybe those guys already invented the wheel you need.

Actually there are 2 libraries in Gnome-DB:
* Libgda: depending almost only on GLib and LibXML which acts as an
abstraction layer between a database and your code (a bit like ODBC or
JDBC)
* Libgnomedb which uses Libgda and GTK+ and offers some data bound widgets.

About memory occupation, you can choose either to load all the results
of a SELECT into memory (which has the advantage of speed once loaded
but consumes more memory), or use a cursor to access your data (which
means faster initial loading and less memory consumption but slower
data access over time).

The code contains numerous examples and there is a good doc.

Regards,

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


Re: GTK - reading data from database

2008-07-31 Thread Vivien Malerba
2008/7/31 Mathias Hasselmann [EMAIL PROTECTED]:
 Am Donnerstag, den 31.07.2008, 02:33 -0700 schrieb paragasu:
 but it is quite tough because this is my first time writing gtk
 application (using c).

 Even more a reason to reuse existing code.

 i prefer debian linux for developing the application but the real
 environment the program will be run is windows XP. i am not confident
 enough to use libgnomedb because i afraid the dependencies i have go
 trough when i try to compile the application for windows.

 This fear is unjustified: Libgda only depends on glib and libxml2,
 libgnomedb only depends on libgda and GTK+. All other dependecy are
 optional: http://www.gnome-db.org/Dependencies

 since the software is relatively simple (i afraid not). Is anyone develop a 
 gtk
 database application using c? i did search but most of application i
 found so far either too complex(big) [...]

 I am aware of this problem. Guess why I suggest you to re-use existing,
 well-tested code, instead of reinventing the wheel? Setting up a build
 environment for libgda/libgnomedb that covers Windows XP will take
 significantly less time that writing __and testing__ all this DB/UI
 glue.


Also, as you are starting, I suggest you use the (still unstable but
reaching stability) 3.99.x version as it has a better API and works
better on Windows. If you have any problem, you can reach me directly
or through the Gnome-db mailing list.

Regards,

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


Re: save image and display image from postgresql

2008-07-23 Thread Vivien Malerba
2008/7/23 paragasu [EMAIL PROTECTED]:
 i am very new to gtk programming. I am sorry for this beginner
 questions, but after asking
 google i fail the get the right answer. I hope this mailing list will help me.

 anyone can please point me a way on how to save image to postgresql
 database and
 display the image again.

To save an image in Postgres, you can sither use a blob type, a binary
string, or convert your picture to an ASCII string (in base64 for
example) and use a normal string field. Loading it back is a matter of
doing the reverse.

As to display the image in GTK+, you can use
gtk_image_new_from_pixbuf() along with a GdkPixbufLoader. This is
what's done in Libgnomedb (for example in
http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb/plugins/common-pict.c?revision=1686view=markup).

Regards,

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


Re: OpenGL interface

2008-01-04 Thread Vivien Malerba
On Jan 3, 2008 8:02 PM, Peter Hildebrandt [EMAIL PROTECTED] wrote:

 Happy new year everyone,

 I'd like to use opengl in my gtk application.  I've come across GtkGLArea
 [1] and GtkGLExt [2].  The former appears to be undocumented, while the
 latter is according to the website no longer actively maintained.

 Which one should I use?  Or is there a different solution out there?

You can have a look at Clutter (http://clutter-project.org/) which is
being actively developped.

Regards,

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


Re: gtk version

2007-09-26 Thread Vivien Malerba
On 9/26/07, Amboo Srivastava [EMAIL PROTECTED] wrote:


 Hi all,

 I am a newbie to Linux/Solaris. I am running into a problem related to gtk
 version. I have 2 versions of gtk+ installed on my Solaris 10 machine. I
 have installed gtk 2.6 from blastwave.org but when I type in the command:
 pkg-config --modversion gtk+-2.0, I get gtk2.4.9 as the version installed.
 Is it possible by any means to know how many versions of gtk are installed
 and which one is currently being used? How do I remove the older version of
 gtk? Any help on this will be deeply appreciated.


pkg-config uses the PKG_CONFIG_PATH environment variable to look for
.pc files, and it also looks for default location(s). Make sure that
variable is set to point to the prefix of the GTK+ version you want to
use.

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


Objects creation from within multiple threads

2007-08-27 Thread Vivien Malerba
Hi!

I've got sereval threads from which I'm trying to create objects
(using g_object_new()) at the same time, and I get strange errors
(most of the time it works correctly though).

A quick gdb session seems to show that when a problem occurs, all the
threads creating objects are in g_type_class_ref() in gtype.c which is
called from g_object_new().

For example error messages are:
...invalidly modified type `XXX'
g_object_new_valist: object class `XXX' has no property named `YYY'

I cant' find any information about if GLib does not support creating
objects from different threads ate the same time. Can anyone help me?

Regards,

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


Re: Which widget to use for creating a list

2007-06-20 Thread Vivien Malerba
On 6/20/07, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,
 i m new to GTK+
 i am working on GTK+ with directfb on embedded platform.
 i want to have a list of say 4-5 items which can be selected by the
 direction keys..so that the selection moves to next one as u press the
 down key or moves up with the up key...


 I guess i need selectable text here..but i m not able to determine how to
 implement this in GTK..
 Plz help me out n suggest the widget structure.
 Thanks in advance.

I would use a GtkTreeView widget along with a GktListStore data model.

Regards,

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


Re: GtkTreeView: different renderes within one row?

2007-05-31 Thread Vivien Malerba
On 5/30/07, Felix Kater [EMAIL PROTECTED] wrote:
 hi,

 I am new to GtkTreeView:

 Are cell renderers bound to columns or can they change between rows of
 the same column?

AFAIK cell renderers are defined once for each column, and are the
same for all the rows, but you can have more than one cell renderer in
each column.


 I'd like to create a two column list with simple text display on the
 left but each row having a different renderer on the right (combo,
 spin, entry).


I suggest you then create a custom cell renderer which will adapt
itself to the display you want for each row, and use that cell
renderer for the column on the right.

Regards,

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


Re: Plotting graphs

2007-05-24 Thread Vivien Malerba
On 5/24/07, Bluezapper [EMAIL PROTECTED] wrote:
 Hi,

 Can someone refer me to an example  which plots a simple 2D graph using 
 gtkextra API.


 thanks,

 bluezapper.

A bit off topic, but there is also the GtkDatabox library out there (I
have not tested it though!)

Regards,

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


Re: Alternative GTK widgets

2007-05-14 Thread Vivien Malerba
On 5/12/07, Shoq [EMAIL PROTECTED] wrote:

 Pardon my noobness, but I am new to GTK.  I had assumed there would be a
 wealth of open source widgets that descend from the toolkit. I am starting
 to think this was a very poor assumption on my part.  I've not be able to
 find anything but a few aborted attempts at variations by other parties. Am
 I missing something? Is there are directory of other efforts to add value to
 the base classes?

What kind of widgets are you missing? Depending on you needs, there
are lots of widgets out there, but they are simply not integrated into
Gtk+.

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


Re: How add a button widget to a cellrenderer ?

2007-04-13 Thread Vivien Malerba
On 4/11/07, Carlos Savoretti [EMAIL PROTECTED] wrote:
 Hi!

 I just need to add a gtkbutton to a pre-existing gtkcellrenderer,
 (it is the treeview is already created).

 That button will make some stuff referred to the cell within it
 is placed, it is because I need to pack it in the same cell.

Although it should be possible to add a widget into a custom made cell
renderer, I don't think it's a good idea because you'll lose the
spirit of the cell renderer.

However it's possible to place a widget in a cell renderer when the
cell is activated or edited (for instance the GtkCellRendererTest
places a GtkEntry when edited to allow modifications of the text).
Anyway, you'll have to write your own cell renderer for that (see for
example the cell renderers of libgnomedb).

Cheers,

Vivien
___
gtk-app-devel-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkEntryCompletion on a GtkCellRendererText

2007-03-12 Thread Vivien Malerba
On 3/3/07, Philip Withnall [EMAIL PROTECTED] wrote:
 Hi all,

 I've got a table of database rows set up using a GtkTreeView with a
 GtkListStore backend, and GtkCellRendererTexts for the table cells. This
 is all working nicely.

 What I'd like to do is have auto-completion available when editing the
 text cells, with a GtkEntryCompletion, but I can't figure out how to add
 one. The most likely way would be to get a pointer to the
 GtkCellRendererText's GtkEntry, but I can't find a way to do that. I
 also can't find any gtk_cell_renderer_text_* methods for adding a
 GtkEntryCompletion, or an object equivalent to a GtkEntryCompletion for
 use on GtkCellRendererTexts.


If it's not too late, I'd suggest trying first to code your own cell
renderer based on the GtkCellRendererText (add a property to specify
the completion), and when it works, propose it as an evolution in
bugzilla.

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


Re: Catching the row deleted from a GtkTreeModel implementation

2007-02-09 Thread Vivien Malerba
On 2/9/07, Suma H.S [EMAIL PROTECTED] wrote:
 how r u deleting the row?
 It should be either through some key-press or mouse-click, in either case u
 must select the row before selecting.
 So...If it is through a key-press, catch the key-press signal and if it is
 through a mouse-click,
 catch mouse-click signal and access the selected row. Now do all the
 updations u want and then delete the row from the model.



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Fontana Nicola
 Sent: Friday, February 09, 2007 2:36 AM
 To: gtk-app-devel-list@gnome.org
 Subject: Catching the row deleted from a GtkTreeModel implementation


 I'm keeping some summary fields of a GtkListStore and I need to update them
 on
 every model change. The problem is while catching the row-deleted signal
 the row is yet deleted, so I can't access the row content to update my
 summary fields.

 How can I do it?

I would suggest a different approach: add your own column to the
GtkListStore which stores your information summary as a GObject (so
you know when that object is destroyed).

If you can't add a column to the GtkListStore, then I suggest creating
another GtkTreeModel implementation which proxies the GtkListStore
and adds a new column (in this case you'll have to write a method to
delete data so you'll know when it's deleted) - see the
GtkTreeModelFilter implementation for example.

Regards,

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


Re: black promt window

2007-02-05 Thread Vivien Malerba
On 2/4/07, Patrik Krizan [EMAIL PROTECTED] wrote:
 Hi,
 i'm newbie in gtk and i want develop applications on windows xp. i'm
 running gtk2.0, cygwin and eclipse. i compiled 'hello world' application
 (exact copied from tutorial) and it works fine. however, if i start it,
 i get a black promt window like this
 http://www.informatik.uni-frankfurt.de/~krizan/black_promt.jpg
 too. it is possible to avoid this black window?
 thanks
 patrik

From an old thread, I found that you should use Mingw gcc with the
-mwindows flag to avoid having the command window open.

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


Re: Load image from memory.

2007-01-02 Thread Vivien Malerba
On 1/2/07, Eirik Brandtzæg [EMAIL PROTECTED] wrote:
 I'm trying to include a image in my Free Pascal program under linux.
 First I loaded the image from a file using gtk_image_new_from_file, but I 
 want to have the picture inside the binary.


There is the GdkPixdata related API such as gdk_pixdata_to_csource().

Vivien
___
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 free GList

2006-09-12 Thread Vivien Malerba
On 9/12/06, shibu Alampatta [EMAIL PROTECTED] wrote:
 Hi all,

 Pls see the below code structure. how to free the glist at the indicated
 place?

 GList * glist=NULL;

 for(i=0;in;i++)   g_list_append(glist,a[i]);

 
 // some processing
 

 //here want to free the glist


g_list_free (glist);

Note that this function will not free the memory pointed by each node.
If you have allocated memory, then you must free it first or risk some
memory leak.

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


Re: Unsolved glib problem

2006-09-11 Thread Vivien Malerba
On 9/9/06, dagang001 [EMAIL PROTECTED] wrote:

 for ( i=0 ;i4 ;i++)
 {
 Person *fred = g_new(Person, 1);
 /**/
 fred-name = ming[i];
 fred-shoe_size = i+10;
 fred-age=60+i;
 list = g_list_append(list, fred);
 }


Did you set list=NULL before that code?

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


Re: Pango Warning

2006-09-11 Thread Vivien Malerba
On 9/11/06, David Nečas (Yeti) [EMAIL PROTECTED] wrote:
 On Mon, Sep 11, 2006 at 10:51:17AM +0530, shibu Alampatta wrote:
   I'm using a combo box, code is given below
 
  char a[15];
 
  strcpy(a,AAA);
  glist_append(glist,a);
 
  It reports
 
  Pango Warning**: Invalid UTF-8 string passed to pango_layout_set_text()

 The posted code does not print this warning (try yourself)[*].

 The problem is elsewhere where you pass a non-UTF-8 encoded
 text, or maybe some random rubbish, to a Gtk+ function as
 a string.

 Yeti


 [*] It contains two probable bugs however, one is not using
 the return value of g_list_append() likely leading to a
 memory leak, another is the use of strcpy() prone to buffer
 overflows.

Also if you do this in a function call, the 'a' variable will lose its
scope and using it outside of the function will lead to problems.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Database connection et al

2006-09-08 Thread Vivien Malerba
On 9/7/06, Andrea Zagli [EMAIL PROTECTED] wrote:
 Il giorno gio, 07/09/2006 alle 18.55 +0530, Sucheta Ghosh ha scritto:
  Is this possible to connect gtk+ with mysql database or any other
  database? If answer is yes then how is this possible?

 for example www.gnome-db.org

The website is out-dated, but a new version has come out recently,
check the download links.

Vivien
___
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 save/load GtkTreeStore into a file?

2006-09-04 Thread Vivien Malerba
On 8/29/06, chabayo [EMAIL PROTECTED] wrote:
 Hello all,...

 ...i try to load a GtkTreeStore from a file that i was saving with
 gtk_tree_store_foreach calling a function inheritting
 gtk_tree_model_get_string_from_iter (the 0:0,0:1,1:0:0,... thing)
 and gtk_tree_model_get .

 Now it would be seem easy to me to be done with
 gtk_tree_model_get_iter_from_string and gtk_tree_store_set.

 The Problem is, by meaning, there is no node to iterate for the factive
 virtual node referenced by the string.

 Anyone could tell me the preferable way to save/load GtkTreeStores ??

It's not the GtkTreeStore but the GtkTreeModel which you need to save
and/or load. This depends on the data you have; I personally use XML
files which are quite well adapted to represent trees.

Regards,

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


Re: Record/Playback GUI Operations

2006-08-25 Thread Vivien Malerba
On 8/25/06, Sai Laxmi K [EMAIL PROTECTED] wrote:
 Thanks Mr.Vivien,
That site was extremely useful. But I have one problem in configuring. I
 know this query is not relevant to this post, but I'm not able to find any
 other means to solve this. When I'm configuring Xnee with Cygwin, it's
 throwing two errors,


  ERROR 

 Could not locate the needed X11 extensions:

RECORD
XTest

 Make sure you have them installed before building Xnee


 Where can I find these two extensions and how can I include them in my
 Cygwin. Can you pl. help me.

These are the X server extensions, which you need to configure for
your X server running on Windows. I don't use windows so I can't help
you there, sorry. Maybe try to ask the cygwin guys...

Regards,

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


Re: Sockets in GTK+?

2006-08-21 Thread Vivien Malerba
On 8/20/06, n3ck [EMAIL PROTECTED] wrote:
 Hi every1!
 Im was delphi (win) coder for a while but now i use linux as OS.
 I really like to code so i choose GTK for build applications on linux.
 I have been searching for some tutorial, text or articule about how
 to build cliente/server apps using GTK but i could't find anything :(
 Somebody has some clue, url or something that helps me with this?
 thankz a lot.
 Best  Regards n3ck

I use the http://www.gnetlibrary.org/ library which works quite well
and is well integrated into the GLib main loop.

Regards,

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


Re: Sockets in GTK+?

2006-08-21 Thread Vivien Malerba
On 8/21/06, Chris Sparks [EMAIL PROTECTED] wrote:
 I went looking fo rGNet and what is odd is that it says this:

  It is written in C, object-oriented, and built upon GLib.

 C isn't object-oriented..


The C language does not object, however nothing prevents you from
having a Object oriented approach to programming, and the is exactly
what the GLib does with the GObject object (it supports single
inheritance, interfaces, properties, etc).

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


Re: GTK Wizard using Notebook

2006-03-22 Thread Vivien Malerba
On 3/22/06, 3saul [EMAIL PROTECTED] wrote:

 Hi,

 I'm new to programing, especially gtk. I'm wanting to create a gtk wizard
 (without a dependency on Gnome - I'm aware of the druid). I thought the best
 way might be to create a notebook and have forward and back buttons cycle
 through the tabs. My question iscan someone give me some pointers on how
 to best cycle through the tabs??


You can also have a look at the GtkAssistant widget part of the Ridley
project. See
http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkassistant.h?view=markup

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


Re: Containers for containers

2006-01-25 Thread Vivien Malerba
2006/1/25, Ephrem Boudonnet [EMAIL PROTECTED]:
 hi
 I'm searching a container which could contain other containers.
 For example, is that possible to add anywhere several layouts to a
 window, or to include a layout in another one, in order to use it as
 sub-windows I could drag and drop.
 Is there a way to make this?
 Thanx

Any container can contain GtkWidget widgets, and as a GtkContainer is
a GtkWidget, il can contain any other container (the number of
children widgets depends on its real nature). This allows to have
complex layouts.

Cheers,

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


Re: how can include just glib

2005-12-13 Thread Vivien Malerba
2005/12/13, Fernando Apesteguía [EMAIL PROTECTED]:
 Did you try to make this?

 #include glib.h

 And then link with

 -lglib-2.0 (link against your glib version)


You should use `pkg-config --cflags glib-2.0` to get the list of
include flags and `pkg-config --libs glib-2.0` to get the list of
liknong flags when compiling.

Cheers,

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


Re: Does such a widget exist?

2005-11-17 Thread Vivien Malerba
2005/11/16, Stefano Esposito [EMAIL PROTECTED]:
 Hi all,

 i need a widget that displays mobile/fixed points and fixed rectangles and 
 which is capable to catch mouse-click events. Does such a widget exist 
 somewhere in the world? :)


I think you can use libgnomecanvas for that job.

Regards,

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


Re: Does such a widget exist?

2005-11-17 Thread Vivien Malerba
2005/11/16, Stefano Esposito [EMAIL PROTECTED]:
 Hi all,

 i need a widget that displays mobile/fixed points and fixed rectangles and 
 which is capable to catch mouse-click events. Does such a widget exist 
 somewhere in the world? :)


I think you can use libgnomecanvas for that job.

Regards,

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


Re: Opening GUI with SSH

2005-10-20 Thread Vivien Malerba
2005/10/20, Suganya [EMAIL PROTECTED]:
 Hi all,

 I upgraded my gtk from 2.0 to 2.8.

 Now I could not open GUI windows of other machines using SSH.

 Expecting suggestions.


Did you try ssh -X ?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Wrapped text in GtkTreeView

2005-06-15 Thread Vivien Malerba
On 6/15/05, Slou [EMAIL PROTECTED] wrote:
 Vivien Malerba wrote:
 I have list of a very long lines which I want to be accessible to user
 with no penalty (additional clicking etc.).
 
 So the solution is obvious - wrapped text in TreeView, but I found no
 way to create such CellRenderer.
 
 All discussions on this subject I found are at least a year old. What is
 the current state of this problem?
 
 
  You can either:
  - add a line_wrap property to the GtkCellRendererText object, or
 
 hmm... seems there is no such property for GtkCellRendererText [1]

I meant modifying the GtkCellRendererText source code in the GTK+
libraty itself (and maybe proposing a patch for inclusion?)

 
  - create your own GtkCellRenderer object (see
  http://scentric.net/tutorial/treeview-tutorial.html)
 
 The problem when I try to create custom cell renderer is that I can't
 dynamically change it's height.
 

There is no reason about that since height calculation is done by the
virtual functions you need to write to create a GtkCellRenderer.

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


Re: Instalation of GTK+ 2.6 alongside GTK+ 2.4

2005-06-09 Thread Vivien Malerba
On 6/8/05, Derrick J Houy [EMAIL PROTECTED] wrote:
 I run on Fedrora Core 3 which has GTK+ 2.4.13 installed. I want to
 continue to build my apps against the standard packages included in FC3,
 but also need to fix some bugs which allow the apps to work with GTK+ 2.6.7.
 
 Can anyone help me with the best setup to easily allow building against
 the newer versions, without having to upgrade the current system version.
 

To do something similar, here is what I do:
- create a directory where to install the new GTK (/local/G_EXTRA for example)
- in gtk+'s sources, run ./configure --prefix=/local/G_EXTRA (with
some other arguments if you want)
- make; make install

Now you've got Gtk+ installed in /local/G_EXTRA, and need to set a few
environment variables if you want to use it (before running
./configure in your sources anyway):

LD_LIBRARY_PATH to /local/G_EXTRA/lib
PKG_CONFIG_PATH to /local/G_EXTRA/lib/pkgconfig
PATH to /local/G_EXTRA/bin
DEVHELP_SEARCH_PATH to /local/G_EXTRA/share/gtk-doc/html

and a few others for your own convenience. You can install other
programs and libraries as well (I installed the whole Gnome 2.10 this
way).

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


GtkFileChooserButton's mode

2005-05-17 Thread Vivien Malerba
Hi!

Does anybody know why the GtkFileChooserButton widget does not accept
the GTK_FILE_CHOOSER_ACTION_SAVE mode (or the
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER mode)?

Thanks,

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


Re: GList

2005-05-03 Thread Vivien Malerba
On 5/2/05,[EMAIL PROTECTED] wrote:
 i think that the result of next code must be 3.
 but i have 0
 if uncomment l=... it's work correctly
 
 #include glib.h
 
 int main()
 {
 GList* l=NULL;
 //l=g_list_alloc();
 
 g_list_append(l,GINT_TO_POINTER(1));
 g_list_append(l,GINT_TO_POINTER(1));
 g_list_append(l,GINT_TO_POINTER(1));
 
 printf(%i,g_list_length(l));
 }

use:
l = g_list_append(l,GINT_TO_POINTER(1));

instead of:
g_list_append(l,GINT_TO_POINTER(1));

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

Re: GtkTreeView SIGNALS

2005-05-03 Thread Vivien Malerba
On 5/3/05, John Coppens [EMAIL PROTECTED] wrote:
 On Tue, 3 May 2005 10:11:49 -0400
 André Pedralho [EMAIL PROTECTED] wrote:
 
  I'm trying to use the single click on a GtkTreeView. Is there a way
  for me? The row-activated signal is activated with a double click...
  I'm needind one that is launched with just one click!
 
 Check 'cursor_changed' - that's normally the one you want.
 

There is also as a last possibility the GtkWidget's event signal.

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


Re: GTK window and thread

2005-05-03 Thread Vivien Malerba
On 5/2/05, Frederic Beck [EMAIL PROTECTED] wrote:
 Hello
 
 Here's my problem : i have a daemon running in the background, and i
 want it to show popups after some events.
 
 I'm new in using GTK, so i took a look at the tutorial, and i managed to
 create the window and show it. The popup window is closed when pressing
 on a button.
 
 As i don't want this popup to be blocking for the daemon, i wanted to
 put it in a thread using pthread.
 
 After a few tries, i managed to make it work, which means, i can show
 multiple windows at the same time and close them independently.
 
 To do so, in the function which shows the popup window, i have the
 initialisation of the window, and then the following liness :
 
 gtk_main ();
 while (gtk_events_pending())
 gtk_main_iteration();
 
 and a quit handler is associated to the button and contains :
 
 gtk_main_quit ();
 
 I have 2 questions :
 
 1. When running it works, but i have lots of messages like :
 
 (unknown:20080): GLib-WARNING **: g_main_context_check() called
 recursively from within a source's check() or prepare() member.
 
 (unknown:20080): GLib-WARNING **: g_main_context_prepare() called
 recursively from within a source's check() or prepare() member.
 
 2. (more about pthread i guess) i don't want to add a join in my
 program, i just want the thread to show the window and stop when the
 button is clicked. That's why, after everything is done, i added a
 ptrhead_exit(NULL) call, but even after the window has been closed, i
 still have processes  :
 
 20287 pts/1Z  0:00  \_ [sh] defunct
 20292 pts/1Z  0:00  \_ [sh] defunct
 20296 pts/1Z  0:00  \_ [sh] defunct
 20302 pts/1Z  0:00  \_ [sh] defunct
 
 i have 4 such processes for each window opened. Am i doing something
 wrong with GTK or pthread ?
 

You can create a thread (using GLib threads handling functions) in
which _only_ the deamon works, and one thread for _all_ GTK related
stuff. You need to call g_thread_init() but you don't need to call
gtk_threads_init() since the GTK main loop remains in a single thread
and from GTK, you only have one thread. This way you have a real
separation of the daemon part and the GUI part.

You must make sure though that no GTK+ call is made from within any
GLib callback in the thread running the daemon: I use a GAsyncQueue to
make the two threads communicate: the daemon thread writes to the
queue when it has an event, and the GTK thread has an idle function
(see g_idle_add) which reads from that queue and updates the GUI.

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


Re: [Beginner] How to write at the end of a GtkTextBuffer ?

2005-04-24 Thread Vivien Malerba
On 4/23/05, Olivier Ramare [EMAIL PROTECTED] wrote:
 Dear all,
 
I have troubles understanding (and controlling) where
 to write on a GtkTextBuffer. Here are my variables :
 
SGinfosbuffer=gtk_text_buffer_new(NULL);
SGinfos=gtk_text_view_new_with_buffer(SGinfosbuffer);
SGscrolledinfos=gtk_scrolled_window_new(NULL,NULL);
gtk_container_add(GTK_CONTAINER(SGscrolledinfos),SGinfos);
 
 and I write in it via:
 
 void SG_print_infos(char *letexte)
 {
  gtk_text_buffer_insert_at_cursor (SGinfosbuffer,letexte,-1);
  while (gtk_events_pending()) gtk_main_iteration(); /* flush */
  gtk_widget_show_all(SGinfos);
 }
 
 All goes well until the text in  SGinfosbuffer gets out of the
 viewed area. Then some messages are repeated, and some times
 when I scroll the buffer down I discover the text has been
 inserted at uncanny places (almost reversed order sometimes).
 
 What I want :
-- the info written always at the end of the buffer
-- this end should be in the viewable area (scroll if needed).
 I can't quite get an inkling as to this last one either :-(
 

I wrote a SQL console widget which has the same usage as the one you
mention here. You can have a look at the code in the
http://cvs.gnome.org/viewcvs/libgnomedb/libgnomedb/gnome-db-sql-console.c?rev=1.2view=markup
file.

Cheers,

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


Callbacks from an idle function

2005-04-08 Thread Vivien Malerba
Hi!

I would appreciate having a bit of help concerning a strange problem.

In an application I'm writing (Mergeant), I have enabled
multi-threading (g_thread_init() and gtk_threads_init()), but I'm
using it with one thread only.

I have an idle function callback from which I create:
* one custom object which sends a signal about some auto-generated events
* a custom widget which is connected to this signal and updates its display

From the same idle function, I make the custom object emit the signals
and the custom widget is updated correctly. Everything is OK.

However, still from the same function, I then destroy the custom
widget, and the whole application locks. A backtrace from gdb attached
to the locked application gives:
(gdb) bt
#0  0x00ad37a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00d3913e in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2  0x00d35d9b in _L_mutex_lock_32 () from /lib/tls/libpthread.so.0
#3  0x in ?? ()

The strange thing is that if I don't create the custom widget, then
everything runs OK.

Any idea how to solve this problem?

Thanks a lot,

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


Re: Callbacks from an idle function

2005-04-08 Thread Vivien Malerba
On Apr 8, 2005 5:26 PM, Peter Bloomfield [EMAIL PROTECTED] wrote:
 On 04/08/2005 10:22:59 AM, Vivien Malerba wrote:
 [ snip ]
  However, still from the same function, I then destroy the custom
  widget, and the whole application locks. A backtrace from gdb attached
  to the locked application gives:
  (gdb) bt
  #0  0x00ad37a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  #1  0x00d3913e in __lll_mutex_lock_wait () from
  /lib/tls/libpthread.so.0
  #2  0x00d35d9b in _L_mutex_lock_32 () from /lib/tls/libpthread.so.0
  #3  0x in ?? ()
 
 Perhaps you're trying to use gdk_threads_enter recursively?  Instant
 lock...
 
 

I did not use gdk_threads_enter()/gdk_threads_leave() when I posted the message.

I fact I have managed to make it work somehow by adding
gdk_threads_enter() before the first line of code in my idle function
and gdk_threads_leave() at the end.

Strange considering I have obly one thread!

I'm still trying to see if there are some strange behaviours with that
situation...

Thanks,

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