gtk_file_chooser_hangs (win32 libgdk-win32-2.0-0.dll)

2009-01-15 Thread arne . pagel
Hello,
i updated my mingw with the new All-in-one bundle on gtk download page.

Now i have the problem, that the gtk_file_chooser is not working anymore in
my application under win32.
I get just a sandglass-curser over it.
I get no warning or errormessage on the console.

When I am taking older dll's (libgdk-win32-2.0-0.dll and 
libgtk-win32-2.0-0.dll) 
from August 26, everything works fine.
With the new one from January 8 I have the problem.

An idea what could be the problem?

regards
  Arne
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Question about Callback

2009-01-15 Thread Rudolfo Pinewood

Hi,
thanks for your answer. I think I understand my code a bit better now...
I wonder whether it is best practice to use static functions for these 
callbacks - in my code it is actually a member function (because of 
having many different buttons whose states form a bitfield that is 
compressed to one int value. I did not find any example that does not 
use such static functions.


Greetings,
Christoph Hartwig

James Scott Jr schrieb:

You can also use:
- in the routine that creates the button, save a unique value.
 g_object_set_data(G_OBJECT(button), Unique-Key, some-value)

-in button callback routine, retrieve the unique value.
some-value-pointer = g_object_get_data(G_OBJECT(button), Unique-Key);

This in addition to any pre-allocated memory structure you passed in the
g_signal_connect(), or g_signal_connect_swapped().   The issue with
reuse of button callbacks is always how to determine which button! I do
two things;
1. pre-allocate a memory structure with the first value a fixed id of
some sort (or related to the button's function).  example

#def EXIT_BUTTON_FLAG 1
.
.
.
typedef struct _SomeButton {
 gint cb_id;
 ...
} SomeButton, *PSomeButton;
.
.
.
PSomeButton memButton = NULL;
.
memButton = g_new0(SomeButton, 1);
memButton-cb_id = EXIT_BUTTON_CBID;
.
g_signal_connect(G_OBJECT(button), toggled, 
  G_CALLBACK(fn_callback), memButton);

.
.

2. g_object_set_data() and g_object_get_data() as described earlier.
checking the cb_id of the userdata from g_signal... and also getting
this extra value helps your positively identify which button was
pressed.  


Either method will work, but sometimes both come in handy.

Hope that helps.  Also, here is a link to source code that may help
explain better.
http://mysite.verizon.net/ressgdw8/sitebuildercontent/sitebuilderfiles/gtkstatusicon-starter-program-0.1.0.tar.bz2

And don't forget to review 'gtk-demo', it has good examples.

James,


On Sun, 2009-01-11 at 12:42 +0100, Rudolfo Pinewood wrote:

Hi,
I have a question regarding Callback functions for Toggle buttons.

I have several togglebuttons, that are all registered to call one
specific function (ApplyFlags). In this function I actually don't know
which button was activated.

My attempt was giving each button/callback an additional parameter that
should be passed to my ApplyFlags function.

However I was not able to do so - MemberCaller1 seems to fit (regarding
the call one function with one parameter) but I did not manage to get
my parameter into that Callback in
g_signal_connect_swapped(G_OBJECT(button), toggled, 
G_CALLBACK(callback.getThunk()), callback.getEnvironment()).


How could this be done?
Thanks in advance
Christoph Hartwig
___
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: qt vs gtk

2009-01-15 Thread jvetterli
Some of my thoughts on the matter:

On Wed, Jan 14, 2009 at 10:10:42AM -0600, Thomas Stover wrote:
 ...
 -QT (last time I checked) is not even C++. It's C++ and a custom macro 
 language. building ouch. debugging ouch. C++ paradigm ouch.

The Qt macros aren't very intrusive.

Once you have your makefiles figured out, it's not building is not 
terribly painful, for either one.  Figuring out the makefiles means 
automating moc for Qt, and glib-genmarshal for Gtk.

I agree 100% that debugging with gdb is much easier for C than C++.

I find that deriving classes in C++ is alot easier than going through 
the GObject type system.

 -HUGE: glib and gtk are separate. glib can be used on it's own. so one 
 mental model to work with for gui and non-gui events.

Qt4 has been split into different modules -- QtCore (think glib), QtGui 
(think Gtk), QtXml, etc.

 -When you start getting into it, there is just no contest. I love GTK. I 
 have no doubt that if I started to read about qt, that I would 
 constantly be saying, oh you can't do that, and you mean you have to 
 that. Long live GTK!

When it comes to documentation, Qt really outshines Gtk.  I have never 
had to dive through code to figure something out in Qt.  I always have a 
copy of the Gtk source code untarred and ready, though.

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


Re: Question about Callback

2009-01-15 Thread Rudolfo Pinewood

Hi,
thanks again for your help.
1) I did change my function to a static one
2) I updated my g_signal_connect_swapped to use G_CALLBACK(staticfunc) + 
param parent (which I use to get the other buttons)
3) I noticed that the pointers were in wrong order (parent was the first 
one instead of second) - changed to g_signal_connect instead and order 
is right.
I now can use my function as desired. I only have to integrate some 
other fields, but I think I'll get that ready with the knowledge I 
received here.


Many thanks!
Christoph Hartwig

James Scott Jr schrieb:

Rudolfo,

In your case where you have multiple buttons operating on the same
logical data field, using a single callback function is very practical.

The same can be said for a callback that performs a single logical
function, all windows/object should attempt to reuse that callback if
they need that functions.  


Example; being a pair of callback I wrote that is called when a window
is hidden or shown.  All my dialogs/windows that need that service reuse
those single callbacks. To handle the fact that each window instance
saves its visibility value in a different variable/address, I pass into
the g_signal_connect(..., b_visible) the address of that variable when
creating each window.

void cb_main_interface_show (GtkWidget * widget, gboolean *pb_visible)
{
  g_return_if_fail (pb_visible != NULL);
  *pb_visible = TRUE;
}
void cb_main_interface_hide (GtkWidget * widget, gboolean *pb_visible)
{
  g_return_if_fail (pb_visible != NULL);
  *pb_visible = FALSE;
}

To me this helps organize the code and makes it easier to maintain.  The
cost of this reuse is fairly low, and the g_object_[set|get]_data()
along with user-data cb_id flags, normally handles it well.  Of course
all this reuse can be impacted by the to many global/static variables --
which limits the re-entrancy or reuse  of any program.

My two.

James,


On Tue, 2009-01-13 at 20:40 +0100, Rudolfo Pinewood wrote:

Hi,
thanks for your answer. I think I understand my code a bit better now...
I wonder whether it is best practice to use static functions for these 
callbacks - in my code it is actually a member function (because of 
having many different buttons whose states form a bitfield that is 
compressed to one int value. I did not find any example that does not 
use such static functions.


Greetings,
Christoph Hartwig

James Scott Jr schrieb:

You can also use:
- in the routine that creates the button, save a unique value.
 g_object_set_data(G_OBJECT(button), Unique-Key, some-value)

-in button callback routine, retrieve the unique value.
some-value-pointer = g_object_get_data(G_OBJECT(button), Unique-Key);

This in addition to any pre-allocated memory structure you passed in the
g_signal_connect(), or g_signal_connect_swapped().   The issue with
reuse of button callbacks is always how to determine which button! I do
two things;
1. pre-allocate a memory structure with the first value a fixed id of
some sort (or related to the button's function).  example

#def EXIT_BUTTON_FLAG 1
.
.
.
typedef struct _SomeButton {
 gint cb_id;
 ...
} SomeButton, *PSomeButton;
.
.
.
PSomeButton memButton = NULL;
.
memButton = g_new0(SomeButton, 1);
memButton-cb_id = EXIT_BUTTON_CBID;
.
g_signal_connect(G_OBJECT(button), toggled, 
  G_CALLBACK(fn_callback), memButton);

.
.

2. g_object_set_data() and g_object_get_data() as described earlier.
checking the cb_id of the userdata from g_signal... and also getting
this extra value helps your positively identify which button was
pressed.  


Either method will work, but sometimes both come in handy.

Hope that helps.  Also, here is a link to source code that may help
explain better.
http://mysite.verizon.net/ressgdw8/sitebuildercontent/sitebuilderfiles/gtkstatusicon-starter-program-0.1.0.tar.bz2

And don't forget to review 'gtk-demo', it has good examples.

James,


On Sun, 2009-01-11 at 12:42 +0100, Rudolfo Pinewood wrote:

Hi,
I have a question regarding Callback functions for Toggle buttons.

I have several togglebuttons, that are all registered to call one
specific function (ApplyFlags). In this function I actually don't know
which button was activated.

My attempt was giving each button/callback an additional parameter that
should be passed to my ApplyFlags function.

However I was not able to do so - MemberCaller1 seems to fit (regarding
the call one function with one parameter) but I did not manage to get
my parameter into that Callback in
g_signal_connect_swapped(G_OBJECT(button), toggled, 
G_CALLBACK(callback.getThunk()), callback.getEnvironment()).


How could this be done?
Thanks in advance
Christoph Hartwig
___
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: qt vs gtk

2009-01-15 Thread Michael Torrie
jvette...@users.sourceforge.net wrote:
 I find that deriving classes in C++ is alot easier than going through 
 the GObject type system.

Yes this is true, in C.  GTKmm makes things rather nice if you work in
C++.  In fact I kind of like how GTKmm works without a preprocessor,
with type-safe callbacks.  I wish Qt folks would compare Qt against
GTKmm rather than just GTK+, as they are looking at things from a C++
point of view anyway.

 When it comes to documentation, Qt really outshines Gtk.  I have never 
 had to dive through code to figure something out in Qt.  I always have a 
 copy of the Gtk source code untarred and ready, though.

GTK is always in need of people willing to flesh out the documentation.
 It is nice that one can refer to the source code in any open source
project.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


some erros

2009-01-15 Thread frederico schardong
Hi,

anybody can help me to resolve this?



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

gtk_file_filter_set_name(filtro,bmp);

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

gtk_file_chooser_add_filter(*chooser, *filtro);

gtk_widget_show(chooser);

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

filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));

g_print (filename);
  }

gtk_widget_destroy (chooser);


how I can add filter to my chooser??

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


Re: some erros

2009-01-15 Thread Allin Cottrell
On Thu, 15 Jan 2009, frederico schardong wrote:

 anybody can help me to resolve this?

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

 gtk_file_filter_set_name(filtro,bmp);

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

 gtk_file_chooser_add_filter(*chooser, *filtro);

 gtk_widget_show(chooser);

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

 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));

 g_print (filename);
   }

 gtk_widget_destroy (chooser);

 how I can add filter to my chooser??

By using gtk_file_chooser_set_filter().

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


Re: some erros

2009-01-15 Thread James Scott Jr
Frederico,

From your code listing part of your problem could be this syntax error:

gtk_file_chooser_add_filter(*chooser, *filtro);

it should read;

gtk_file_chooser_add_filter(chooser, filtro);

James,


On Thu, 2009-01-15 at 22:58 -0200, frederico schardong wrote:
 Hi,
 
 anybody can help me to resolve this?
 
 
 
 GtkFileFilter *filtro;
 GtkWidget *chooser;
 //GtkFileChooser *chooser;
 
 gtk_file_filter_set_name(filtro,bmp);
 
 chooser = gtk_file_chooser_dialog_new (Open File,
   parent_window,
   GTK_FILE_CHOOSER_ACTION_OPEN,
   GTK_STOCK_CANCEL,
 GTK_RESPONSE_CANCEL,
   GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
   NULL);
 
 gtk_file_chooser_add_filter(*chooser, *filtro);
 
 gtk_widget_show(chooser);
 
 if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT)
   {
 char *filename;
 
 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
 
 g_print (filename);
   }
 
 gtk_widget_destroy (chooser);
 
 
 how I can add filter to my chooser??
 
 thanks
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list