GtkImage with animation: animation stops when all frames are shown

2007-06-01 Thread Alexander Semyonov
Hello. I create GtkImage with animation:

GdkPixbufSimpleAnim *anim = gdk_pixbuf_simple_anim_new (w, h, RATE);
gdk_pixbuf_simple_anim_add_frame (anim, pixbuf1);
gdk_pixbuf_simple_anim_add_frame (anim, pixbuf2);
gdk_pixbuf_simple_anim_add_frame (anim, pixbuf3);
...
GtkWidget *image = gtk_image_new_from_animation (GDK_PIXBUF_ANIMATION
(anim));

But when i display it animation stops when all animation frames are shown,
but i want to have a circular animation. It looks that I should use some
g_timeout_add (...) or anything else. Can someone help me with?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
Hello,

I have been googling for some form of virtual list boxes, but can't
seem to find any reference.

How people do with very large list boxes? I was hopping I could have
some form of just seting up the column headers and say I have 1
rows and let the widget ask me for the data when it needs it.

It seems a bit heavy to add 1 rows one at a time, as it seems I'm
forced to do even if I derive my own ListStore.

Any hints?


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


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Andreas Stricker
Nuno Lucas schrieb:
 How people do with very large list boxes? I was hopping I could have
 some form of just seting up the column headers and say I have 1
 rows and let the widget ask me for the data when it needs it.
 
 It seems a bit heavy to add 1 rows one at a time, as it seems I'm
 forced to do even if I derive my own ListStore.

You have to derive your own GtkTreeModel, if the predefined GtkListStore
or GtkTreeStore are not sufficient (They simply stores all data at once).

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


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Miroslav Rajcic
You can use gtk_tree_view_column_set_cell_data_func to register a callback
method to supply data for the tree view.

Regards,
  Miroslav

- Original Message - 
From: Nuno Lucas [EMAIL PROTECTED]
To: gtk-app-devel-list@gnome.org
Sent: Friday, June 01, 2007 2:53 PM
Subject: Virtual list boxes (using GtkTreeView or other)


 Hello,

 I have been googling for some form of virtual list boxes, but can't
 seem to find any reference.

 How people do with very large list boxes? I was hopping I could have
 some form of just seting up the column headers and say I have 1
 rows and let the widget ask me for the data when it needs it.

 It seems a bit heavy to add 1 rows one at a time, as it seems I'm
 forced to do even if I derive my own ListStore.

 Any hints?


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

 __ NOD32 2304 (20070601) Information __

 This message was checked by NOD32 antivirus system.
 http://www.eset.com

 

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


gdk_pixbuf_save question

2007-06-01 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Is there a way to add a creator tag when saving a jpeg image using
gdk_pixbuf_save.

For example I would like to put the name of my program in the jpeg image
so that I know what created that image. Even setting some if the EXIF
data would be ok. Is there any way to do that?

Thanks,

Kevin
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Remi - http://enigmail.mozdev.org

iD8DBQFGYCjO6w2kMH0L1dERAgrlAJ9wBGYDPaMe8YZAqyTN/O3ElK5L5QCeOBhM
brqp2dvimf7t3dGNeQsS6uc=
=J026
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gdk_pixbuf_save question

2007-06-01 Thread Dr. Michael J. Chudobiak
Kevin DeKorte wrote:
 Is there a way to add a creator tag when saving a jpeg image using
 gdk_pixbuf_save.
 
 For example I would like to put the name of my program in the jpeg image
 so that I know what created that image. Even setting some if the EXIF
 data would be ok. Is there any way to do that?

The gdk_pixbuf routines do not support saving exif data.

You would need to save your jpeg file, then use libexif, exiv2, or 
another library to write the exif data to the jpeg (i.e., a second file 
write). gThumb, for example, uses libexif.

- Mike

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


cross compiling and ld auto-import errors

2007-06-01 Thread Bethany Seeger
Hi, 

I'm cross compiling a linux application to work on Windows using
i586-mingw32msvc-gcc. 

The application is using Gtk and Gdk calls.  

I'm getting linking errors about glib that I don't know how to resolve.
Here's the compile time output. 

i586-mingw32msvc-gcc   demo.o dthread.o callbacks.o interface.o
hsv2rgb.o polar.o rebin.o scope.o seismograph.o sgram.o spin.o
vbargraph.o
waterfall.o  /usr/local/win32gtk2.4/Runtime/lib/iconv.dll 
/usr/local/win32gtk2.4/Runtime/lib/intl.dll 
/usr/local/win32gtk2.4/Runtime/lib/libatk-1.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgdk-win32-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgdk_pixbuf-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libglib-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgmodule-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgobject-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgthread-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libgtk-win32-2.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libpango-1.0-0.dll 
/usr/local/win32gtk2.4/Runtime/lib/libpangowin32-1.0-0.dll -lm -o demo
polar.o:polar.c:(.text+0x2a5): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
polar.o:polar.c:(.text+0x2e1): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
polar.o:polar.c:(.text+0x913): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
polar.o:polar.c:(.text+0x95d): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
polar.o:polar.c:(.text+0x19a0): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
polar.o:polar.c:(.text+0x19dc): variable
'_g_thread_functions_for_glib_use' can't be auto-imported. Please read
the documentation for ld's --enable-auto-import for details.
Info: resolving _g_threads_got_initialized by linking to
__imp__g_threads_got_initialized (auto-import)
Info: resolving _g_thread_functions_for_glib_use by linking to
__imp__g_thread_functions_for_glib_use (auto-import)
collect2: ld returned 1 exit status
make: *** [demo] Error 1

From what I've read, I need to force (external) constants to be
variables, but I'm not sure how I can do that when the errors are coming
from the glib library, underneath Gtk/Gdk.  (or declare them explicitly
with __declspec(dllimport)).  

I'm relatively new to cross-compiling, so I'm a little baffled as to
where to go with this. 

Any advice you can offer would be greatly appreciated. 

Thanks,
Bethany

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


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
On 6/1/07, Andreas Stricker [EMAIL PROTECTED] wrote:
 Nuno Lucas schrieb:
  How people do with very large list boxes? I was hopping I could have
  some form of just seting up the column headers and say I have 1
  rows and let the widget ask me for the data when it needs it.
 
  It seems a bit heavy to add 1 rows one at a time, as it seems I'm
  forced to do even if I derive my own ListStore.

 You have to derive your own GtkTreeModel, if the predefined GtkListStore
 or GtkTreeStore are not sufficient (They simply stores all data at once).

I may be missing something, but I don't see a way to set the number of
virtual rows.

From what I see in the documentation, the only way to grow is by
appending a single row at a time (which I guess then emits the
row-changed signal and updates the scrollbar).

What seems to be missing is a way to say I already have 10k, 100k or
even 1M rows of data ready (at least I will cache that data myself).

Even if I implement my own GtkTreeModel, I don't see a way of escaping
this limitation. At least on the documentation.


Regards,
~Nuno Lucas

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


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Yeti
On Fri, Jun 01, 2007 at 03:47:36PM +0100, Nuno Lucas wrote:
 
  You have to derive your own GtkTreeModel, if the predefined GtkListStore
  or GtkTreeStore are not sufficient (They simply stores all data at once).
 
 I may be missing something, but I don't see a way to set the number of
 virtual rows.

See http://gwyddion.net/documentation/head/libgwydgets/GwyNullStore.php
for a simple purely virtual store.  This is a cheap hack,
but it demonstrates the point IMO.

 From what I see in the documentation, the only way to grow is by
 appending a single row at a time (which I guess then emits the
 row-changed signal and updates the scrollbar).

You are mixing two things here:
- if the model grows is must emit the row-inserted signal,
  because if it does not do this, the tree views showing it
  break
- however, if no one is watching, namely when the model is
  created, it can be instantaneously created with a million
  of rows

There are more troubles with huge tree views, namely the
tree view needs to know the sizes of the columns and rows --
even those not currently visible as they still affect what
is visible.  So you will probably end up using all the
confusing fixed size modes, and avoiding work in cell data
functions for invisible cells.

However, for a milion of rows scrolling through the tree
manually is no longer useful anyway, i.e. the user interface
ceases to be suitable for the task.  You may want to use
a multilevel or search+paging base interface instead --
essentially something that avoids the signle list with
a million of rows by design.

Yeti

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


Re: Virtual list boxes (using GtkTreeView or other)

2007-06-01 Thread Nuno Lucas
On 6/1/07, David Nečas (Yeti) [EMAIL PROTECTED] wrote:
 On Fri, Jun 01, 2007 at 03:47:36PM +0100, Nuno Lucas wrote:
  
   You have to derive your own GtkTreeModel, if the predefined GtkListStore
   or GtkTreeStore are not sufficient (They simply stores all data at once).
 
  I may be missing something, but I don't see a way to set the number of
  virtual rows.

 See http://gwyddion.net/documentation/head/libgwydgets/GwyNullStore.php
 for a simple purely virtual store.  This is a cheap hack,
 but it demonstrates the point IMO.

Thanks! That is exactly the kind of sample I needed to look at!

  From what I see in the documentation, the only way to grow is by
  appending a single row at a time (which I guess then emits the
  row-changed signal and updates the scrollbar).

 You are mixing two things here:
 - if the model grows is must emit the row-inserted signal,
   because if it does not do this, the tree views showing it
   break
 - however, if no one is watching, namely when the model is
   created, it can be instantaneously created with a million
   of rows

I see. Now I understand. I only need to implement my own store
and make sure I only call gtk_tree_set_model() after I set the
number of rows I want.

 There are more troubles with huge tree views, namely the
 tree view needs to know the sizes of the columns and rows --
 even those not currently visible as they still affect what
 is visible.  So you will probably end up using all the
 confusing fixed size modes, and avoiding work in cell data
 functions for invisible cells.

I am aware of this kind of problems and am expecting them.

 However, for a milion of rows scrolling through the tree
 manually is no longer useful anyway, i.e. the user interface
 ceases to be suitable for the task.  You may want to use
 a multilevel or search+paging base interface instead --
 essentially something that avoids the signle list with
 a million of rows by design.

I agree, but that's what the boss wants ;-)

On the other hand, as I'm using a generic tree view to show a list, I
could use that property to show a next and previous page controls (as
owner drawn root columns) and restrict the ouput to some row limit.

 Yeti

Thank you, you were most helpful.

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


Re: cross compiling and ld auto-import errors

2007-06-01 Thread Bethany Seeger
Never mind, I solved it.  There were a few g_mutex_lock/unlock calls in
the code and that seemed to be the problem. I replaced them with
gdk_threads_enter() and gdk_threads_leave() (after ensuring that
g_threads_init() and gdk_threads_init() were both called) and the linker
was much happier. 

-Bethany

On Fri, 2007-06-01 at 10:43 -0400, Bethany Seeger wrote:
 Hi, 
 
 I'm cross compiling a linux application to work on Windows using
 i586-mingw32msvc-gcc. 
 
 The application is using Gtk and Gdk calls.  
 
 I'm getting linking errors about glib that I don't know how to resolve.
 Here's the compile time output. 
 
 i586-mingw32msvc-gcc   demo.o dthread.o callbacks.o interface.o
 hsv2rgb.o polar.o rebin.o scope.o seismograph.o sgram.o spin.o
 vbargraph.o
 waterfall.o  /usr/local/win32gtk2.4/Runtime/lib/iconv.dll 
 /usr/local/win32gtk2.4/Runtime/lib/intl.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libatk-1.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgdk-win32-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgdk_pixbuf-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libglib-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgmodule-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgobject-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgthread-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libgtk-win32-2.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libpango-1.0-0.dll 
 /usr/local/win32gtk2.4/Runtime/lib/libpangowin32-1.0-0.dll -lm -o demo
 polar.o:polar.c:(.text+0x2a5): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 polar.o:polar.c:(.text+0x2e1): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 polar.o:polar.c:(.text+0x913): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 polar.o:polar.c:(.text+0x95d): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 polar.o:polar.c:(.text+0x19a0): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 polar.o:polar.c:(.text+0x19dc): variable
 '_g_thread_functions_for_glib_use' can't be auto-imported. Please read
 the documentation for ld's --enable-auto-import for details.
 Info: resolving _g_threads_got_initialized by linking to
 __imp__g_threads_got_initialized (auto-import)
 Info: resolving _g_thread_functions_for_glib_use by linking to
 __imp__g_thread_functions_for_glib_use (auto-import)
 collect2: ld returned 1 exit status
 make: *** [demo] Error 1
 
 From what I've read, I need to force (external) constants to be
 variables, but I'm not sure how I can do that when the errors are coming
 from the glib library, underneath Gtk/Gdk.  (or declare them explicitly
 with __declspec(dllimport)).  
 
 I'm relatively new to cross-compiling, so I'm a little baffled as to
 where to go with this. 
 
 Any advice you can offer would be greatly appreciated. 
 
 Thanks,
 Bethany
 
 ___
 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: Clear A Pixmap

2007-06-01 Thread nahuel9728

Thaxs Yeti for the answer but Sorry I'm not able to do it. I explain a little
bit what im doing and i would like to do:
main(){
mem_map=gtk_drawing_area_new();
gtk_signal_connect (GTK_OBJECT (mem_map), expose_event,(GtkSignalFunc)
expose_event, NULL);
gtk_signal_connect
(GTK_OBJECT(mem_map),configure_event,(GtkSignalFunc)configure_event,
NULL);
gtk_signal_connect (GTK_OBJECT (mem_map),
button_press_event,(GtkSignalFunc) button_press_event, NULL);
/*A button to erase all the drawed and paint things*/
boton = gtk_button_new_with_label (Clear and paint);
gtk_signal_connect_object (GTK_OBJECT (boton), clicked,GTK_SIGNAL_FUNC
(clear_and_paint),GTK_OBJECT (main_window));
show
}

void expose_event(){
gdk_draw_pixmap
}

void clear_and_pain(GtkWidget *widget, GdkEventExpose *event){
/*HERE I WANNA CLEAN ALL MY DRAWED AREA*/
   gtk_widget_queue_draw_area(GTK_WIDGET(mem_map),0,0,910,440);
/*This up should clean all the area??? */
 
/*And later draw things.*/
draw_brush();
}
Any idea anyone??? Has done somthing similar

David Nečas (Yeti)-2 wrote:
 
 On Thu, May 31, 2007 at 03:35:07PM -0700, nahuel9728 wrote:
 I explain my thing... I have a pixmap, a drawing area. 
 There are events that draw on it. But i have a button that must clear,
 erase
 all the painted on the drawing area.
 Any idea how to make it happen
 
 Make the drawing area repaint (e.g. with gtk_widget_queue_draw())
 and just do not draw anything there in the expose-event
 handler this time.
 
 Yeti
 
 --
 http://gwyddion.net/
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 

-- 
View this message in context: 
http://www.nabble.com/Clear-A-Pixmap-tf3849301.html#a10922708
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.

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

Window resizing

2007-06-01 Thread John Coppens
Hi all...

I need a hand. In a program I have a small toolbar separate from the main
window. The toolbar is a GtkToolbar inside a GtkWindow. The problem is
that I cannot seem to make the GtkWindow resize to adjust to the toolbar
size (I want to switch vertical/horizontal). Also, I need to adjust to
other glyph sizes.

I tried to obtain the toolbar's size, but get the actual size, not the
one I need to show the toolbar completely.

It seems as if the toolbar doesn't have any influence on the window's
size...

Can anybody help?

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


Re: Window resizing

2007-06-01 Thread John Coppens
On Fri, 1 Jun 2007 22:13:47 -0300
John Coppens [EMAIL PROTECTED] wrote:

 Hi all...
 
 I need a hand. In a program I have a small toolbar separate from the
 main window. The toolbar is a GtkToolbar inside a GtkWindow. The
 problem is that I cannot seem to make the GtkWindow resize to adjust to
 the toolbar size (I want to switch vertical/horizontal). Also, I need
 to adjust to other glyph sizes.
 
 I tried to obtain the toolbar's size, but get the actual size, not the
 one I need to show the toolbar completely.
 
 It seems as if the toolbar doesn't have any influence on the window's
 size...

Quite accidently, solved! If the 'arrow' is enabled, no size requests
seem to go the window, because the 'arrow' on the toolbar would take care
of shifts anyway. 

Sorry for the noise...

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


gtk+ about dialog doesn't close

2007-06-01 Thread John Zoidberg
Hi,

I have a problem with the gtk about dialog: When I click on the Close button
it doesn't close.
There seems to be no event connected to the close button clicked signal.
And I can't add one either in Glade (v2 as well as v3).

What am I supposed to add to the code so that it works?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk+ about dialog doesn't close

2007-06-01 Thread Samuel Cormier-Iijima
Since GtkAboutDialog is a subclass of GtkDialog, it is intended to be used
as a modal dialog. Hence, you would do something like:

gtk_dialog_run(about_dialog);

gtk_widget_hide(about_dialog);

Also, see
http://developer.gnome.org/doc/API/2.0/gtk/GtkAboutDialog.html#gtk-show-about-dialog

Samuel

On 6/2/07, John Zoidberg [EMAIL PROTECTED] wrote:

 Hi,

 I have a problem with the gtk about dialog: When I click on the Close
 button
 it doesn't close.
 There seems to be no event connected to the close button clicked signal.
 And I can't add one either in Glade (v2 as well as v3).

 What am I supposed to add to the code so that it works?
 ___
 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