GtkFileChooser bug on Win32 ?

2004-09-09 Thread Miroslav Rajcic
I am having following problems with GtkChooserDialog on Windows (Win2k,
Visual C++ 6.0, latest GTK 2.4.9 from http://gladewin32.sourceforge.net/,but
also on earlier GTK versions including Tor's builds).

Whe I open the dialog, console window pops with following warnings:

Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed
Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed
Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed

Everything keeps working ok, but the debug console poping is embarasing,
particulary in release mode.
Problem might be that one of the virtual drives on my PC (ramdisk) does not
have icon associated with the drive (being listed in chooser dialog without
an icon).

I believe this is bug. I hope someone can verify and fix this issue.

Thanks,
   Miroslav Rajcic


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


Execution of signal handlers

2004-09-09 Thread Grossert Alexander EXT
OS: Solaris 9
gtk: version 1.2

I have written a GUI using 2 message windows to show the progress of the program. Most 
of the functions connected to a signal from a button contain
some sleep() calls between the message outputs. But when pressing a button for a short 
period nothing happens and then suddenly all messages are printed out together.

It seems to me the main application window is updated only after the function called 
by the corresponding signal has finished execution.

Can anyone tell me how to force an update of the application window while executing 
the called function?

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


Submenu inside popup menu problems

2004-09-09 Thread Miroslav Rajcic
I've created popup menu with its submenu using code like below. Submenu is
displayed ok, but the problem is no
handler functions are called when submenu item gets clicked (all other popup
menu items work ok).

Can anyone spot the error ?

Thanks,
  Miroslav Rajcic


GtkWidget *menu, *submenu;
 GtkWidget *menu_item, *move_item;
 int button, event_time;

 menu = gtk_menu_new ();

 //add menu items
 menu_item = gtk_menu_item_new_with_label("Insert Node\tIns");
 g_signal_connect(GTK_OBJECT (menu_item), "activate", G_CALLBACK
(on_menu_insert_node), NULL);
 gtk_menu_append(menu, menu_item);
 gtk_widget_show (menu_item);  // Show the widget

 move_item = gtk_menu_item_new_with_label("Move Node");
 gtk_menu_append(menu, move_item);
 gtk_widget_show (move_item);  // Show the widget

 submenu = gtk_menu_new ();

 menu_item = gtk_menu_item_new_with_label("Up\tShift+Up");
 gtk_menu_append(submenu, menu_item);
 g_signal_connect(GTK_OBJECT (menu_item), "activate", G_CALLBACK
(on_menu_move_up), NULL);
 gtk_widget_show (menu_item);  // Show the widget

 gtk_menu_item_set_submenu (GTK_MENU_ITEM (move_item), submenu);

 gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button,
event_time);


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


Re: Execution of signal handlers

2004-09-09 Thread Tim Müller
On Thursday 09 September 2004 08:58, Grossert Alexander EXT wrote:

> OS: Solaris 9, gtk: version 1.2
>
> I have written a GUI using 2 message windows to show the progress of the
> program. Most of the functions connected to a signal from a button contain
> some sleep() calls between the message outputs. But when pressing a button
> for a short period nothing happens and then suddenly all messages are
> printed out together.
>
> It seems to me the main application window is updated only after the
> function called by the corresponding signal has finished execution.
>
> Can anyone tell me how to force an update of the application window while
> executing the called function?

 http://www.gtk.org/faq/#AEN602

In Gtk-1.2 it would probably be something like:

  while (gtk_events_pending())
gtk_main_iteration();


If you want a certain function to be called in X seconds, use 
gtk_timeout_add() and return FALSE in the timeout callback 
function, so that it only gets run once.

Cheers 
-Tim

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


Re: MDI (not winMDI) frameworks ... again

2004-09-09 Thread Tim
Brion Vibber wrote:
Tim wrote:
In the meantime, developers are left hanging with putting out apps 
that have just way too many windows. I've used Gimp on my OSX box and 
it totally sucks having to first clicking the window to get focus 
before being able to click the item. If the app ran on a MDI 
framework, this would not be necessary.

Incidentally, you can make Apple's quartzwm behave in a more sensible 
manner. At a terminal:

  defaults write com.apple.x11 wm_click_through -bool true
Cool! I saw that Code Tek had a hack for this but having a lower level 
hack is for sure the way to go.

Regarding MDI, I still see many apps that are being developed that don't 
have MDI support and they really need it. A good example is BBEdit on 
Mac. I don't use this app because it's just too hard to manage the 
multiple sources I have open at one time to do my coding. Thankfully 
X-Code now supports languages that I hack in like JavaScript.

Hopefully we can see such MDI frameworks coming to the GTK core level or 
even on OSX some day.

Thanks for the info.
Tim
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Submenu inside popup menu problems

2004-09-09 Thread John Gill




I recently encountered what I thought was flaky
behaviour with gtk menus, but in the end it turned out to be a feature.

What I found was that I was bringint the original menu up with the
right mouse button and then selecting a sub-menu entry with the left
button.    Now it appears that whatever button is passed into the call
to gtk_menu_popup() has to be the same one that is used to select an
entry from a submenu.   Any other button just dismisses the menu.   

This behaviour can be quite useful once you know it works that way
(although for some reason you can use any button to select items from
the top-level menu).

Anyway, I changed my code to pass in 0 as the button and now I can use
any mouse button to select from subitems.

I'm guessing you are running into the same issue.

John


Miroslav Rajcic wrote:

  
  
  Submenu inside popup menu problems

  I've created popup menu with its submenu using code
like below. Submenu is
  
  displayed ok, but the problem is no
  
  handler functions are called when submenu item gets
clicked (all other popup
  
  menu items work ok).
  
  Can anyone spot the error ?
  
  Thanks,
  
    Miroslav Rajcic
  
  
  GtkWidget *menu, *submenu;
  
   GtkWidget *menu_item, *move_item;
  
   int button, event_time;
  
   menu = gtk_menu_new ();
  
   //add menu items
  
   menu_item = gtk_menu_item_new_with_label("Insert
Node\tIns");
  
   g_signal_connect(GTK_OBJECT (menu_item), "activate",
G_CALLBACK
  
  (on_menu_insert_node), NULL);
  
   gtk_menu_append(menu, menu_item);
  
   gtk_widget_show (menu_item);  // Show the widget
  
   move_item = gtk_menu_item_new_with_label("Move
Node");
  
   gtk_menu_append(menu, move_item);
  
   gtk_widget_show (move_item);  // Show the widget
  
   submenu = gtk_menu_new ();
  
   menu_item = gtk_menu_item_new_with_label("Up   
\tShift+Up");
  
   gtk_menu_append(submenu, menu_item);
  
   g_signal_connect(GTK_OBJECT (menu_item), "activate",
G_CALLBACK
  
  (on_menu_move_up), NULL);
  
   gtk_widget_show (menu_item);  // Show the widget
  
   gtk_menu_item_set_submenu (GTK_MENU_ITEM
(move_item), submenu);
  
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL,
NULL, button,
  
  event_time);
  
  
  ___
  
  gtk-list mailing list
  
  [EMAIL PROTECTED]
  
  http://mail.gnome.org/mailman/listinfo/gtk-list
  



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


Re: MDI (not winMDI) frameworks ... again

2004-09-09 Thread Michael L Torrie
On Thu, 2004-09-09 at 07:37, Tim wrote:
> Cool! I saw that Code Tek had a hack for this but having a lower level 
> hack is for sure the way to go.
> 
> Regarding MDI, I still see many apps that are being developed that don't 
> have MDI support and they really need it. A good example is BBEdit on 
> Mac. I don't use this app because it's just too hard to manage the 
> multiple sources I have open at one time to do my coding. Thankfully 
> X-Code now supports languages that I hack in like JavaScript.
> 
> Hopefully we can see such MDI frameworks coming to the GTK core level or 
> even on OSX some day.

OS X will never have an MDI system because it just doesn't need it
(besides it would violate Apple's HIG).  Having many application windows
open can be a big usability problem.  OS X solves this by making
Command-tab switch between applications and Command-` switches between
windows in the current app.  This makes it quite usable.  On linux,
however, alt-tab just switches between windows.  This can be a problem. 
It would be a difficult problem (because of how X works) to do similar
in-app switching on linux.  On the other hand, most people I know run
apps like the Gimp in it's own virtual desktop.

Anyway.  Food for thought.

Michael


> 
> Thanks for the info.
> 
> Tim
> ___
> gtk-list mailing list
> [EMAIL PROTECTED]
> http://mail.gnome.org/mailman/listinfo/gtk-list
-- 
Michael L Torrie <[EMAIL PROTECTED]>

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


GTK+/Win32 MS Sans Serif font => warning

2004-09-09 Thread Egon Andersen
Hi,
I'm using GTK+ on Win32.
I changed the font on my WinXP system to MS Sans Serif.
After this I get the following warning:
WARNING**: Couldn't load font "MS Sans Serif 8" falling back to "Sans 8"
I tried to make some investigation and found the the "MS Sans Serif" is 
not a TrueType font, it has the filename extension '.fon'

I could imagine that GTK+ doesn't support this fonttype, but I haven't 
come across documentation saying so.

Could someone enlighten me about this cosmetic 'problem'.
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


g_print memory leak according to mtrace v2.3.2

2004-09-09 Thread Kurt Newman
I'm using Glib v2.4.2.  To re-create my suspicion, do the following:

1) create a file with the following (simple stuff)

/* ghelloworld.c */
#include 
#include 

int main(void) {
   mtrace();
   g_print("Hello World\n");
   /* printf("Hello World\n"); */
   muntrace();
   return(0);
}

2) build it

> gcc -o ghelloworld ghelloworld.c `pkg-config --cflags glib-2.0`
`pkg-config --libs glib-2.0`
> export MALLOC_TRACE='mtrace.log'
> ./ghelloworld

(outputs a mtrace.log to the cwd)

> mtrace ghelloworld mtrace.log

Memory not freed:
-
   Address Size Caller
0x0804a378 0x20  at 0x4004f0d7
0x0804a3a0 0x14  at 0x4004f15f
0x0804a3b8 0x1e  at 0x4004f0d7
0x0804a3f8 0x34  at 0x4004f0d7
0x0804a4300x400  at 0x4004f0d7
0x0804a838  0xc  at 0x4004f15f
0x0804a848 0x34  at 0x4004f0d7
0x0804a880 0x14  at 0x4004f0d7
0x0804a8980x400  at 0x4004f0d7
0x0804aca0 0x34  at 0x4004f0d7
0x0804acd80x400  at 0x4004f0d7

3) Commenting out the g_print() and uncommenting out printf(),
rebuilding, and then running ghelloworld over again yield no memory
leaks (according to mtrace).

Am I using g_print incorrectly?  More specifically, am I misusing or not
initializing something?



signature.asc
Description: This is a digitally signed message part
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_print memory leak according to mtrace v2.3.2

2004-09-09 Thread Michael L Torrie
On Thu, 2004-09-09 at 09:58, Kurt Newman wrote:
> I'm using Glib v2.4.2.  To re-create my suspicion, do the following:
> 
> 1) create a file with the following (simple stuff)
> 
> /* ghelloworld.c */
> #include 
> #include 
> 
> int main(void) {
>mtrace();
>g_print("Hello World\n");
>/* printf("Hello World\n"); */

What about running g_print in a loop?  Note that many g_ functions have
static overhead that often show up as a memory leak but they really
don't have leaks.  IE they may claim some memory, but it is freed when
the program quits and is not allocated every time the function is 
called.

>muntrace();
>return(0);
> }
> 
> 2) build it
> 
> > gcc -o ghelloworld ghelloworld.c `pkg-config --cflags glib-2.0`
> `pkg-config --libs glib-2.0`
> > export MALLOC_TRACE='mtrace.log'
> > ./ghelloworld
> 
> (outputs a mtrace.log to the cwd)
> 
> > mtrace ghelloworld mtrace.log
> 
> Memory not freed:
> -
>Address Size Caller
> 0x0804a378 0x20  at 0x4004f0d7
> 0x0804a3a0 0x14  at 0x4004f15f
> 0x0804a3b8 0x1e  at 0x4004f0d7
> 0x0804a3f8 0x34  at 0x4004f0d7
> 0x0804a4300x400  at 0x4004f0d7
> 0x0804a838  0xc  at 0x4004f15f
> 0x0804a848 0x34  at 0x4004f0d7
> 0x0804a880 0x14  at 0x4004f0d7
> 0x0804a8980x400  at 0x4004f0d7
> 0x0804aca0 0x34  at 0x4004f0d7
> 0x0804acd80x400  at 0x4004f0d7
> 
> 3) Commenting out the g_print() and uncommenting out printf(),
> rebuilding, and then running ghelloworld over again yield no memory
> leaks (according to mtrace).
> 
> Am I using g_print incorrectly?  More specifically, am I misusing or not
> initializing something?
> 
> 
> __
> ___
> gtk-list mailing list
> [EMAIL PROTECTED]
> http://mail.gnome.org/mailman/listinfo/gtk-list
-- 
Michael L Torrie <[EMAIL PROTECTED]>

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


glib-2.0

2004-09-09 Thread tapeyim simo
Hi all,
 
I am new to the list
I have a problem with glib-2.2.1 being reported by gtk+ as seen in my installation
While pkg-config reports glib-2.3
 
So gtk+ exist ./configure with an error
 
How can I get around that?
 
The error message of gtk+-2.3.0:
*** 'pkg-config --modversion glib-2.0'  returned 2.3.0, but GLIB (2.2.1) was found!
If package config was correct, then it is best to remove the old version of GLIB.
You may also be ale to fix the error by modifying your LD_LIBRARY_PATH environment variable, or editing /etc/ld.so.conf ***
 
Thanks in advance
 
Ernest__Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


glib2 questions about source

2004-09-09 Thread Guochun Shi
Hi,

I have a couple of questions about source in glib2:

1. when a source is created using g_source_new() and attached to a main context, do I 
need call g_source_ref() explicitly or it is taken care of within g_source_new()
and g_source_attach()?

2. What functions should I call when I am done with the source? It looks I should call 
g_source_remove() or g_source_destroy to remove the source from its main context 
first, then call g_source_unref() to free the memory, am I right?


thanks
-Guochun

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


Re: MDI (not winMDI) frameworks ... again

2004-09-09 Thread Brion Vibber
Tim wrote:
Regarding MDI, I still see many apps that are being developed that don't 
have MDI support and they really need it. A good example is BBEdit on 
Mac. I don't use this app because it's just too hard to manage the 
multiple sources I have open at one time to do my coding.
You might try out the BBEdit 8.0 demo just to take a look at how they're 
now doing it: you can combine multiple open documents into one window, 
with a drawer containing the list of files in that window to pick from.

Compared to tabs in gedit et al I find it pretty awkward for two or 
three files (the drawer's so big!) but pretty nice for a hundred files, 
where I can actually see thirty or so filenames at a time even on my 
little PowerBook screen... Tabs along the top in gedit become impossible 
to navigate after just a handful of open files, and document menus don't 
have scroll bars.

-- brion vibber (brion @ pobox.com)


signature.asc
Description: OpenPGP digital signature
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: g_print memory leak according to mtrace v2.3.2

2004-09-09 Thread Kurt Newman
> What about running g_print in a loop?  Note that many g_ functions have
> static overhead that often show up as a memory leak but they really
> don't have leaks.  IE they may claim some memory, but it is freed when
> the program quits and is not allocated every time the function is 
> called.

When I do another g_print() test within a loop, the output mtrace
logging increases in size (I'm not sure if this indicates more memory
leaks or just memory tracing).  I'm not really experienced enough to dump
this to stdout with some sort of debugging tool to see what portions of
"the leak" are in certain areas of memory (e.g. stack or wherever).

With that said, I believe mtrace is supposed to latch itself onto hooks
within libc's malloc, realloc, and free functions.  Thus, static
memory shouldn't even be an issue.



signature.asc
Description: This is a digitally signed message part
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK+/Win32 MS Sans Serif font => warning

2004-09-09 Thread Francois Terrot [Dev]
Hi
I read this on the The Gimp Windows FAQ  
(http://www2.arnes.si/~sopjsimo/gimp/faq.html)
" I installed Gimp 2.0 on Windows 9x/ME or NT 4, and I'm getting a lot 
of messages saying ** (gimp-2.0.exe:4294830849): WARNING **: Couldn't 
load font "MS Sans Serif 8" falling back to "Sans 8". What should I do?
-You have two options:
  * Go to Control Panel->Display properties->Apperance tab, and set all 
fonts to Tahoma (or any other TrueType font).
  * Uninstall GTK+ 2.2.4, then re-install it without the GTK-Wimp 
component."

Regards
Francois Terrot
Egon Andersen wrote:
Hi,
I'm using GTK+ on Win32.
I changed the font on my WinXP system to MS Sans Serif.
After this I get the following warning:
WARNING**: Couldn't load font "MS Sans Serif 8" falling back to "Sans 8"
I tried to make some investigation and found the the "MS Sans Serif" 
is not a TrueType font, it has the filename extension '.fon'

I could imagine that GTK+ doesn't support this fonttype, but I haven't 
come across documentation saying so.

Could someone enlighten me about this cosmetic 'problem'.
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

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


Re: g_print memory leak according to mtrace v2.3.2

2004-09-09 Thread David Necas (Yeti)
On Thu, Sep 09, 2004 at 01:57:33PM -0500, Kurt Newman wrote:
> 
> When I do another g_print() test within a loop, the output mtrace
> logging increases in size (I'm not sure if this indicates more memory
> leaks or just memory tracing).  I'm not really experienced enough to dump
> this to stdout with some sort of debugging tool to see what portions of
> "the leak" are in certain areas of memory (e.g. stack or wherever).

I'd recommend valgrind.  It can show nice stack traces, but
in this simple case a summary is enough, so just run

valgrind --tool=memcheck --leak-check=yes ./ghelloworld

for both single "Hello world!" and a loop and you'll see:
- valgrind thinks all memory is `still reachable' at the end,
  that's good
- the amount of `leaked' but reachable memory is the same in
  both cases, that's good too

So unless you have serious suspicion there's really a memory
leak, this could placate you.

You can see all the gory details with just a few more
valgrind options...

> With that said, I believe mtrace is supposed to latch itself onto hooks
> within libc's malloc, realloc, and free functions.  Thus, static
> memory shouldn't even be an issue.

Static was used in the `allocated once in program lifetime'
sense.

Yeti


--
Do not use tab characters. Their effect is not predictable.
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK+/Win32 MS Sans Serif font => warning

2004-09-09 Thread Roger Leigh
Egon Andersen <[EMAIL PROTECTED]> writes:

> I'm using GTK+ on Win32.

Which version?

Which toolchain and supporting libraries?  Cygwin?  MinGW? Other?

> I changed the font on my WinXP system to MS Sans Serif.
> After this I get the following warning:
>
> WARNING**: Couldn't load font "MS Sans Serif 8" falling back to "Sans 8"

I used to get this problem using the dropline packages for MinGW, but
no amount of Pango tweaking fixed it.  I "solved" the problem by
building my own libraries from source for Cygwin.  Nowadays Cygwin
comes with GTK+, so you could try that, or try the latest version
available.

(Thankfully, I no longer need to build under Windows!)


-- 
Roger Leigh

Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: MDI (not winMDI) frameworks ... again

2004-09-09 Thread Tim
Brion Vibber wrote:
Tim wrote:
Regarding MDI, I still see many apps that are being developed that 
don't have MDI support and they really need it. A good example is 
BBEdit on Mac. I don't use this app because it's just too hard to 
manage the multiple sources I have open at one time to do my coding.

You might try out the BBEdit 8.0 demo just to take a look at how 
they're now doing it: you can combine multiple open documents into one 
window, with a drawer containing the list of files in that window to 
pick from.
I guess those bbedit guy's actually listened to the nasty gram that I 
sent them over a year ago mentioning that I don't use their product 
because it does not include this feature. Maybe time to take another look.

You are right though, the drawer is pretty useless unless you are 
looking at multiple files. I prefer the drawer style that NoteTaker has 
for their outliner app where they post multiple data structures in the 
drawer. This makes it more worth while wasting window space.

I still do prefer X-Code's implementation though and I'll probably stick 
with it for my mac hacking (which has stopped to a standstill down since 
my hard drive crashed on my iBook :(
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list