Re: XML and treeviews

2008-07-26 Thread Daniel Espinosa
Why don't create a GtkCellRenderer derived object with the properties you
need?

At creation time you can get the 0:0 (the open tag row) GtkCellRenderer as
argument then you can hide it when 0:0 collapse using a GObject signal.


2008/7/25 Gabriele Greco [EMAIL PROTECTED]:

  Couldn't you just add another row in the TreeStore for the closing tag?
  If root is 0 and node is 0:0, then inserting a row after node
  with parent root would be 0:1.


 The problem doing it in this way is that I've to attach an handler to every
 collapse/expand event and I've to show/hide a line for each of those
 events,
 I can do it but I thought there was a cleaner solution like an attribute of
 the CellRenderer to change the indent level of a given column item.


 --
 Ing. Gabriele Greco, DARTS Engineering
 Tel: +39-0105761240 Fax: +39-0105760224
 s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (en trámite, pero para los cuates:
LIBRE)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Issue with vim and GtkFileChooser

2008-07-26 Thread Guido Berhoerster

Hello,
I'm trying to debug an issue with the GTK2 version of vim which
has bothered me for a long time. After the first invocation of
GtkFileChooser in vim, GTK's list of recently used files
(~/.recently-used.xbel) gets written on events such as every
single keypress, mouseclick or the mouse entering/leaving the
window. This bug occurs with vim (at least) 7.0 and 7.1 built
against GTK  2.10 (at least) on Linux. I assume that this is a
bug in GTK, from what I can see it uses GtkFileChooser as in the
reference manual and does not use GTK's recently used files list
functionality directly. However I saw that the recently used
files functionality was added to the GtkFileChooser in GTK 2.11.
I've spoken with Bram Moolenaar about this and he also believes
this to be a bug in GTK.
This is as far as I can get with my knowledge, could someone with
more insight on the inner workings of GTK comment on what might
be going on here? If needed the relevant parts of the GTK UI are
in
http://vim.svn.sourceforge.net/viewvc/vim/vim7/src/gui_gtk.c?view=markup

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


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Emmanuele Bassi
On Sat, 2008-07-26 at 13:45 +0200, Guido Berhoerster wrote:
 Hello,
 I'm trying to debug an issue with the GTK2 version of vim which
 has bothered me for a long time. After the first invocation of
 GtkFileChooser in vim, GTK's list of recently used files
 (~/.recently-used.xbel) gets written on events such as every
 single keypress, mouseclick or the mouse entering/leaving the
 window. This bug occurs with vim (at least) 7.0 and 7.1 built
 against GTK  2.10 (at least) on Linux. I assume that this is a
 bug in GTK,

no, it's not.

the list of recently used files is not written by the file selector
widget: it's entirely up to the application to do that, by calling the
GtkRecentManager API.

  from what I can see it uses GtkFileChooser as in the
 reference manual and does not use GTK's recently used files list
 functionality directly. However I saw that the recently used
 files functionality was added to the GtkFileChooser in GTK 2.11.

yes, but the FileChooser widget *reads* that file to generate the
recently used file list.

so, if you're seeing writes to that file you'll have to find the calls
to gtk_recent_manager_add_item() or gtk_recent_manager_add_full().

 This is as far as I can get with my knowledge, could someone with
 more insight on the inner workings of GTK comment on what might
 be going on here? If needed the relevant parts of the GTK UI are
 in
 http://vim.svn.sourceforge.net/viewvc/vim/vim7/src/gui_gtk.c?view=markup

I don't see any call to GtkRecentManager.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

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


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Guido Berhoerster
* Emmanuele Bassi [EMAIL PROTECTED] [2008-07-26 15:16]:
 the list of recently used files is not written by the file selector
 widget: it's entirely up to the application to do that, by calling the
 GtkRecentManager API.
 
   from what I can see it uses GtkFileChooser as in the
  reference manual and does not use GTK's recently used files list
  functionality directly. However I saw that the recently used
  files functionality was added to the GtkFileChooser in GTK 2.11.
 
 yes, but the FileChooser widget *reads* that file to generate the
 recently used file list.
 
 so, if you're seeing writes to that file you'll have to find the calls
 to gtk_recent_manager_add_item() or gtk_recent_manager_add_full().

$ grep gtk_recent vim71/src/*.c | wc -l
0

There is no use of GtkRecentManager in the vim source.

Yet using strace on vim reveals this

[...]
open(/home/gber/.recently-used.xbel.WBHYEU, O_RDWR|O_CREAT|O_EXCL, 0666) = 15
fcntl(15, F_GETFL)  = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(15, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fcbd288f000
lseek(15, 0, SEEK_CUR)  = 0
write(15, ?xml version=\1.0\ encoding=\UT..., 218) = 218
close(15)   = 0
munmap(0x7fcbd288f000, 4096)= 0
rename(/home/gber/.recently-used.xbel.WBHYEU, 
/home/gber/.recently-used.xbel) = 0
stat(/home/gber/.recently-used.xbel, {st_mode=S_IFREG|0644, st_size=218, 
...}) = 0
[...]

on every keypress, mouseclick etc.

  This is as far as I can get with my knowledge, could someone with
  more insight on the inner workings of GTK comment on what might
  be going on here? If needed the relevant parts of the GTK UI are
  in
  http://vim.svn.sourceforge.net/viewvc/vim/vim7/src/gui_gtk.c?view=markup
 
 I don't see any call to GtkRecentManager.

Me neither, so what is happening here?

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


Re: Finalize a working application

2008-07-26 Thread Oli
Since i discovered everything and the automake steps now just work
everything should be fine, but ...

I discovered a problem using GtkRecentChooserMenu inside a
GtkToolbar while applying a custom filter on it.

The creation of the recent files stuff:
app-manager = gtk_recent_manager_get_default ();

GtkRecentFilter *filter = gtk_recent_filter_new ();
gtk_recent_filter_add_application (filter, qinfo);

GtkWidget *recent = gtk_recent_chooser_menu_new_for_manager (app-manager);
gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER (recent),
TRUE); /* this seems not to work at all */
gtk_recent_chooser_set_show_private (GTK_RECENT_CHOOSER (recent), TRUE);
gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (recent), 10);
gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (recent), filter);

GtkWidget *button = GTK_WIDGET (gtk_builder_get_object (app-builder,
open_toolbar_item));
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button), recent);

And this way I create a new recent file bookmark:
gtk_recent_manager_add_item (app-manager, file); /* file is a filename from 
GtkFileChooserDialog */

If i apply the filter, the menu has no enty, if not the last recent files are 
shown, but I only
want the files to be shown I opened with my program.

Greets, b52.


On Sat, 19 Jul 2008 21:41:54 -0400
Paul Davis [EMAIL PROTECTED] wrote:

 
 On Fri, 2008-07-18 at 02:56 +0200, Oli wrote:
  Hey guys,
  
  I've written a tiny ascii art viewer in C using GTK+.
  Everything works fine, but I've got a problem.
  I don't now how to finalize my app.
  
  How should I create an installscript?
  Where should I place gtkbuilder files and the icon of my app?
  How to obtain the directory where it got installed to load the files?
  
  I hope someone can help me.
 
 before anyone could even dream of helping you, you would have to say, at
 the very least, what operating system platform your target is aimed at. 
 even if 90+% of the world's computer users are on windows, this
 statistic is of limited help when it comes to guessing what a GTK ascii
 art viewer might be aimed at.
 
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


invisible mouse cursor

2008-07-26 Thread Lukasz Gromotowicz
Hi all,
I am looking for a way to make the mouse cursor invisible for the whole
application. I can create the cursor with
gdk_cursor_new_from_pixmap()
and set it to any window using
gdk_window_set_cursor()

However my application has dozens of windows. They are being created in the
button-clicked event of other windows. Is it possible to set the default
cursor for all windows, or I have to do gdk_windows_set_cursor() in the
constructor of each window separately?

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


not movable gtk_message_dialog

2008-07-26 Thread Lukasz Gromotowicz
Hi all,

I need to create the message dialog with buttons, but the problem I have is
that it is very easy to move it so that it almost dissappear from the
screen. I do not have a keyboard connected, I am using only touch screen.
Sometimes I move it simply by accident.

Is is possible to make the windows not movable?

I know I can disable decoration with
gtk_window_set_decorated((GtkWindow*)dialog, false); but then it does not
look good.

Here is the way I create it:
gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
This will clear both LOGs. Are you sure
you want to do this?);

Can anybody help me? Is it possible at all?

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


Re: map-event, unmap-event on a custom widget

2008-07-26 Thread Tristan Van Berkom
On Sun, Jul 20, 2008 at 12:27 PM, Alexander Jones [EMAIL PROTECTED] wrote:
 I've got a GtkBox-derived widget (RBHeader, for anyone interested) and
 it currently animates 25 times per second. Obviously, I want to
 disable this timeout when it's not visible so I can keep the CPU from
 waking up needlessly.

g_object_connect (header, map-event, G_CALLBACK
 (rb_header_map_callback), NULL);
g_object_connect (header, unmap-event, G_CALLBACK
 (rb_header_map_callback), NULL);


I think you mean to be using g_signal_connect(), see the api docs for
http://library.gnome.org/devel/gobject/stable/gobject-The-Base-Object-Type.html#g-object-connect.

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


[no subject]

2008-07-26 Thread mehdi dadkhah
hello
I am a graphic programmer in Linux system
Please help me : How can i create a new ghraphic area(for example a srceen 
saver) in GTK with setting color and resolution by different values(for example 
: color:16 bit, resolution: 1024*768) and change screen area to maximize or 
restore to default size?
please send me whitch commands are used in this problem by an example.
thnaks
sincerely your's
M.Dadkhah



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


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Emmanuele Bassi
On Sat, 2008-07-26 at 16:34 +0200, Guido Berhoerster wrote:


  so, if you're seeing writes to that file you'll have to find the calls
  to gtk_recent_manager_add_item() or gtk_recent_manager_add_full().
 
 $ grep gtk_recent vim71/src/*.c | wc -l
 0
 
 There is no use of GtkRecentManager in the vim source.
 
 Yet using strace on vim reveals this
 
 [...]
 open(/home/gber/.recently-used.xbel.WBHYEU, O_RDWR|O_CREAT|O_EXCL, 0666) = 
 15
 fcntl(15, F_GETFL)  = 0x8002 (flags O_RDWR|O_LARGEFILE)
 fstat(15, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7fcbd288f000
 lseek(15, 0, SEEK_CUR)  = 0
 write(15, ?xml version=\1.0\ encoding=\UT..., 218) = 218
 close(15)   = 0
 munmap(0x7fcbd288f000, 4096)= 0
 rename(/home/gber/.recently-used.xbel.WBHYEU, 
 /home/gber/.recently-used.xbel) = 0
 stat(/home/gber/.recently-used.xbel, {st_mode=S_IFREG|0644, st_size=218, 
 ...}) = 0
 [...]
 
 on every keypress, mouseclick etc.

I have no idea. the FileChooser only job is to read the file to get the
contents; I would expect to see a lot of read() operations.

the only time when a gtk+ application writes to the recently used files
storage and it's not calling the GtkRecentManager API directly is when
the gtk+ main loop level reaches 0 - which is to say after the first
gtk_main() call in the whole application returns (this is needed to
ensure that the file is not left in an inconsistent state); all other
writes are definitely explicit. I seriously doubt that vim spins the
main loop and the stops it at every key press - it would be quite
insane.

I wrote both the RecentManager and the FileChooser recently used files
list support, so I'm at loss here as much as you.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

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


Using PCL with Gtk+

2008-07-26 Thread Nicolas George
Hi.

I would like to know if anyone here has experience using the Portable
Coroutine Library with Gtk+?

I find the idea to use it very attractive, as it has both the advantages of
threaded code (the flow of the program is direct, without having to save the
state in structures passed around to signal handlers and callbacks) and
non-threaded code (I can avoid all locking issues, and it is always safe to
call Gtk+ functions (and OpenGL functions too).

Unfortunately, PCL does not seem to be widely used, and I fear there may be
some annoying bugs in it. Therefore any information would be helpful.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re:

2008-07-26 Thread Lieven van der Heide
Hi,

This is outside the scope of GTK. GTK is just a widget toolkit. For
what you seem to want, I'd suggest you to use SDL (libsdl.org).

Greest,

Lieven.

On 7/26/08, mehdi dadkhah [EMAIL PROTECTED] wrote:
 hello
  I am a graphic programmer in Linux system
  Please help me : How can i create a new ghraphic area(for example a srceen 
 saver) in GTK with setting color and resolution by different values(for 
 example : color:16 bit, resolution: 1024*768) and change screen area to 
 maximize or restore to default size?
  please send me whitch commands are used in this problem by an example.
  thnaks
  sincerely your's
  M.Dadkhah




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

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


resize-end event

2008-07-26 Thread Jay L. T. Cornwall

Hi,

I rely on configure-event to detect changes in the size of a widget. 
With solid resizing a stream of configure-events is produced, as the 
widget continuously changes size, while with rectangle resizing a 
single event is produced when the new size is chosen.


I need a second event (or combination of events) to signal the end of a 
resize, e.g. when the mouse is released in solid resizing mode. Is 
there a reliable way to construct this?


--
Jay L. T. Cornwall
http://www.jcornwall.me.uk/
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Guido Berhoerster
* Emmanuele Bassi [EMAIL PROTECTED] [2008-07-26 17:56]:
 I have no idea. the FileChooser only job is to read the file to get the
 contents; I would expect to see a lot of read() operations.

Yes, it gets only written, after the dialog is closed.

 the only time when a gtk+ application writes to the recently used files
 storage and it's not calling the GtkRecentManager API directly is when
 the gtk+ main loop level reaches 0 - which is to say after the first
 gtk_main() call in the whole application returns (this is needed to
 ensure that the file is not left in an inconsistent state); all other
 writes are definitely explicit. I seriously doubt that vim spins the
 main loop and the stops it at every key press - it would be quite
 insane.

Thanks for the explanation, I'm not sure if I got it right, in
the eventhandlers there is often code like:
[...]
if (gtk_main_level()  0)
gtk_main_quit();
[...]
If gtk_main_level() returns 1 and gtk_main_quit() is called, does
that mean that the recently used files list gets written?

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


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Milosz Derezynski
That does indeed mean it; it's what Emmanuele supposed and it turns out to
be right.
It's rather strange for a gtk+ app to do this, is there some kind of other
non-glib-based main loop running?

2008/7/26 Guido Berhoerster [EMAIL PROTECTED]

 * Emmanuele Bassi [EMAIL PROTECTED] [2008-07-26 17:56]:
  I have no idea. the FileChooser only job is to read the file to get the
  contents; I would expect to see a lot of read() operations.

 Yes, it gets only written, after the dialog is closed.

  the only time when a gtk+ application writes to the recently used files
  storage and it's not calling the GtkRecentManager API directly is when
  the gtk+ main loop level reaches 0 - which is to say after the first
  gtk_main() call in the whole application returns (this is needed to
  ensure that the file is not left in an inconsistent state); all other
  writes are definitely explicit. I seriously doubt that vim spins the
  main loop and the stops it at every key press - it would be quite
  insane.

 Thanks for the explanation, I'm not sure if I got it right, in
 the eventhandlers there is often code like:
 [...]
if (gtk_main_level()  0)
gtk_main_quit();
 [...]
 If gtk_main_level() returns 1 and gtk_main_quit() is called, does
 that mean that the recently used files list gets written?

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




-- 

Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Issue with vim and GtkFileChooser

2008-07-26 Thread Milosz Derezynski
Oh yeah, 1:0 for Occam ;)

2008/7/27 Milosz Derezynski [EMAIL PROTECTED]

 That does indeed mean it; it's what Emmanuele supposed and it turns out to
 be right.
 It's rather strange for a gtk+ app to do this, is there some kind of other
 non-glib-based main loop running?

 2008/7/26 Guido Berhoerster [EMAIL PROTECTED]

 * Emmanuele Bassi [EMAIL PROTECTED] [2008-07-26 17:56]:
  I have no idea. the FileChooser only job is to read the file to get the
  contents; I would expect to see a lot of read() operations.

 Yes, it gets only written, after the dialog is closed.

  the only time when a gtk+ application writes to the recently used files
  storage and it's not calling the GtkRecentManager API directly is when
  the gtk+ main loop level reaches 0 - which is to say after the first
  gtk_main() call in the whole application returns (this is needed to
  ensure that the file is not left in an inconsistent state); all other
  writes are definitely explicit. I seriously doubt that vim spins the
  main loop and the stops it at every key press - it would be quite
  insane.

 Thanks for the explanation, I'm not sure if I got it right, in
 the eventhandlers there is often code like:
 [...]
if (gtk_main_level()  0)
gtk_main_quit();
 [...]
 If gtk_main_level() returns 1 and gtk_main_quit() is called, does
 that mean that the recently used files list gets written?

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




 --
 
 Please note that according to the German law on data retention,
 information on every electronic information exchange with me is
 retained for a period of six months.
 [Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
 jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]




-- 

Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Encoding problem in Gtk2::Ex::PodViewer

2008-07-26 Thread Ben Staude
Hi all,

using the PodViewer widget to display help, I have an encoding problem: I 
cannot get the widget to correctly display utf8 text.

I load the pod from a file which is in utf-8, but it is displayed as 
iso-8859-1. I also loaded the file into perl first and used 
$podviewer-load_string($string) but it didn't help.

If I display the string (loaded from the pod file) in a regular TextBuffer / 
TextView, it's correctly displayed; also if I use it as label text or 
similar.

### Sample script

use Gtk2 -init;
use Gtk2::Ex::PodViewer;

my $viewer = Gtk2::Ex::PodViewer-new;

# find mypod.pod attached, hope it's still utf8 after mailing it
$viewer-load('mypod.pod');

$viewer-show;
my $window = Gtk2::Window-new;
$window-add($viewer);
$window-show;
Gtk2-main;

### 

Any ideas?

Thanks 
Ben
=pod

=head1 Hello World!

The world is a better place since there's utf8. We no longer have problems with 
the euro sign (€) or german umlauts like ae (ä), ue (ü) and so on.

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