Re: recursive regex match?

2011-07-31 Thread Egon Andersen

Petr Tomasek wrote:


Hi!

I tried to make a recursive regexp using the g_regexp_* functions,
i.e. something like:

 regex = g_regex_new (^\\s*(?:(shift|ctrl|alt)-)*([a-z])\\s*$, 
G_REGEX_CASELESS|G_REGEX_OPTIMIZE, 0, NULL);

But when doing g_regex_match() together with g_match_info_fetch_all() I only 
get the
first occurence of the string matche by (...)*. In PCRE / php, for example, 
such a
regex is matched recursivelly (i.e. the number of matched substring is dependent on the 
matched string). Can something like this be done in glib or is this feature missing?




Try to have a look at g_match_info_next.

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


duplicate symbol: _g_bit_nth_lsf

2008-01-27 Thread Egon Andersen
Hi,

I've been spending some time to install Gtk+ on my new Mac.
(Mac OS X 10.5, intel-based)

Eventually it seems to have succeeded, but...
When I compile and link a program that uses gtk+/glib etc.
(I'm using glib-2.14.5)

I get the linker error:
--
ld: duplicate symbol: _g_bit_nth_lsf
--

I've been googling a little and I can see that several others has got 
the same problem. It seems to be some problem in gutils. According to 
the ChangeLog, it seems that this problem has been addressed earlier, 
but apparently I have it now again.
Any suggestions about what is the cure for this problem?

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


Problems building pango-1.18.0 on Mac

2008-01-26 Thread Egon Andersen
Hi,

I've recently got a Mac on which I try to install all the GTK+ stuff :-)
I've come a long way, but now I seem to be stuck with the building of 
pango-1.18.0

I'm trying to build with X11 support and have all X11 installed on the 
Mac (as far as I can tell - I'm still very new to Mac...)

In the directory where I have extracted the pango-1.18.0 I run
./configure --with-x --x-includes=/usr/X11/include 
--x-libraries=/usr/X11/lib

The configure succeeded well.

Now I run
make

Runs fine until the linking phase where it complains with:
---
Undefined symbols:
   _pangoft2_viewer, referenced from:
   -viewers in pango-view.o
   _pangocairo_viewer, referenced from:
   -viewers in pango-view.o
ld: symbol(s) not found
---

It seems to me to be something internally in the pango-package that 
can't be found when linking?

Can someone help me through this problem?

(pango-1.18.0 and other GTK+ related packages are downloaded from gtk.org)

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


Re: Problems building pango-1.18.0 on Mac

2008-01-26 Thread Egon Andersen
Michael Tuexen wrote:
cut/
 curl -O http://cairographics.org/releases/cairo-1.4.12.tar.gz;
 tar xvfz cairo-1.4.12.tar.gz;
 cd cairo-1.4.12;
 env PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig ./configure --disable-png  
 --enable-quartz;
 make -j 2;
 sudo make install;
 cd ..
 

I see you have used a never version of cairo than version refered to 
under the download section on gtk.org.

Are there any specific reason for using the two configure options:
--disable-png
--enable-quartz
I may like to have png support, so if --disable-png is optional, I'll 
probably want to have support for png.

I'll try and see if I succeed with this never cairo before I configure 
and compile pango.

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


Re: Problems building pango-1.18.0 on Mac

2008-01-26 Thread Egon Andersen
Michael Tuexen wrote:
cut/
 
 curl -O -u anonymous:@ ftp://ftp.gtk.org/pub/pango/1.18/pango-1.18.0.tar.gz 
 ;
 tar xvfz pango-1.18.0.tar.gz;
 cd pango-1.18.0;
 env PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig ./configure;
 make -j 2;
 sudo make install;
 cd ..
 

I tried as you described above.
The configure fails:
--
configure: error: *** Didn't find any of FreeType, X11, ATSUI, or Win32.
*** Must have at least one backend to build Pango.
--

If I try as earlier with:
./configure --with-x --x-includes=/usr/X11/include 
--x-libraries=/usr/X11/lib

The configure succeeded well, but the make fails with the same linker 
error as in the original posting.
---
Undefined symbols:
_pangoft2_viewer, referenced from:
-viewers in pango-view.o
_pangocairo_viewer, referenced from:
-viewers in pango-view.o
ld: symbol(s) not found
---

So I seem to be stuck at the same point still, because when I before 
tried with configure without the x-options, I got the exact same 
configure error as above. Therefore I added the x-options and got a tiny 
bit further.

Do I need to install something else on my Mac? I believe I've installed 
everything related to programming and X11 available on the discs that 
followed the Mac.

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


Re: Problems building pango-1.18.0 on Mac

2008-01-26 Thread Egon Andersen
Michael Tuexen wrote:
 Did you also do
 
 env PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig ./configure --disable-png  
 --enable-quartz;
 
 It is important to set the PKG_CONFIG_PATH...
 
 (BTW, I'm using the tcsh, if you use anther shell you might
 need a different way to set the environment variable...)
 

I've set the PKG_CONFIG_PATH in .bashrc (I use bash) before starting the 
x-terminal I use. The path is displayed when I type: env
And it was done before cairo configure and make.
I believe I've followed the description you gave, but apparently the 
machines are behaving differently :-(

When I use the x-options for configure for pango, I get through the 
configure phase, but the make is failing with the linker error described 
earlier.

I've tried to follow your description even though I don't think it is 
using X11, but quartz. For the moment I'm just interested in having the 
pango installed and I'll then look at the X11 details later, if I need 
it, just as I don't care for the png part right now.
Still it seems that I can't get passed the configure or make of pango :-(

(I have to stop for today, but will continue tomorrow, so any ideas to 
overcome the pango build problems are welcome.)

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


Re: Problems building pango-1.18.0 on Mac

2008-01-26 Thread Egon Andersen
Marius Schamschula wrote:
 Egon,
 
 What version of Mac OS X? PPC or intel?

Max OS X 10.5, Darwin 9.0.0, intel processor
 
 A couple of points:
 
 1) You may be running into the obsolete version of freetype that come 
 pre-installed in /usr/X11R6. I make sure that these headers are hidden 
 or removed.

Which headers should then be used?

 
 2) Why are you not using MacPorts or fink? I also have builds available 
 @ hmug.org:

Probably because I'm very new to Mac :-)
On macports.org I find MacPorts verson 1.6.0, but that doesn't tell 
anything about what it contains - does it contain gtk and all that 
stuff? Probably not, it is only 2 MB.

One other thing! The packages must be available for normal download, not 
requiring a small install program that in turn starts the download.
In other words - I must be able to download it on my Linux machine, put 
it on some media and installe from there on my Mac.

 
 http://www.hmug.org/pub/MacOS_X/X/Libraries/System/pango/
 
Looks interesting, but does not seem to be available for OS X 10.5 and 
intel or do I misunderstand the naming convention - believe osx5 is for 
OS X 10.5

I found gtk+2-2.12.5-1 on your site too, but still only for ppc

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


gtk_window_set_decorated(x, FALSE)

2005-12-20 Thread Egon Andersen

Hi,

I've just downloaded and installed the pre-build GTK+ for windows 
Gtk-win32-2.8.8-rc2 from http://gladewin32.sourceforge.net/


Now I experienced that I get a border on my window, eventhough I've set 
gtk_window_set_decorated(x, FALSE) for the window.


I also experienced that the transparent image that I had before, now got 
a black background.


In the previous 2.6.x that I used, the window had no border and the 
background was transparent as expected.


I've read the API document and I don't se that anything should have 
changed in this area from 2.6.x to 2.8.8


I've also searched the bug-tracker for bug-reports on 'decorated', but 
none seems to relate to this problem.


My program looks like this:

cite
   gtk_window_set_decorated(GTK_WINDOW (splash_screen), FALSE);

   /* Get the transparent image shape the window accordingly */
   visual = gdk_visual_get_system ();
   colormap = gdk_colormap_new(visual, TRUE);
   pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, colormap, mask, 
NULL, file);


   /* Shape the window according to image */
   gtk_widget_shape_combine_mask(splash_screen, mask, 0, 0);
   image = gtk_image_new_from_pixmap (pixmap, NULL);
   gtk_widget_show (image);
   gtk_container_add (GTK_CONTAINER (splash_screen), image);
/cite

Is it only me that has experienced this problem?
Or have I missed something in my code that has now been working without 
problems for 2-3 years now.


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


Re: gtk_window_set_decorated(x, FALSE)

2005-12-20 Thread Egon Andersen

Tor Lillqvist wrote:

Egon Andersen writes:
  I've just downloaded and installed the pre-build GTK+ for windows 
  Gtk-win32-2.8.8-rc2 from http://gladewin32.sourceforge.net/


Try GTK+ 2.8.9 from ftp.gtk.org. I don't know what 2.8.8-rc2 is. Ask
the gladewin32 people about that.

  I've read the API document and I don't se that anything should have 
  changed in this area from 2.6.x to 2.8.8


Read the ChangeLog.

2005-11-27  Tor Lillqvist  [EMAIL PROTECTED]

Once again rework Win32 window decoration code. Doesn't break
#104514. The dialogs in gtk-demo now have the same decorations and
behaviour as on X11. Tried to fix #322516 but it seems very hard
to make the trivial sample program there behave as expected.


Where do I find the ChangeLog?
Do you have a url for the ChangeLog you refer to?

I've only been able to find the reference to #322516 in the GTK+ 2.8.8 
release announcement
(I would have thought that I could have found #322516 in the bug-tracker 
by searching for decorated or decoration, but apparently not...)


And it seems that #322516 is closed by WONTFIX, so I don't see why it 
should be any better to use GTK+ 2.8.9 instead of GTK+ 2.8.8 in relation 
to this problem?


BTW The reason I use the pre-build from 
http://gladewin32.sourceforge.net/ is that it is a all in one package 
and simple to install for others.


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


Unforgiving GtkEntry

2005-05-04 Thread Egon Andersen
Hi,
I've discovered a problem that I can't really determine if it is a bug 
or intended.

I have a entry in which I insert some text using gtk_entry_set_text().
Unfortunately it happened that it was not completely UTF-8 - one of the 
characters in the middle was not UTF-8.

Okay, I get a warning - that is absolutely fair. No doubt, an invalid 
string was given to the GtkEntry.

I tried afterwards in the GUI to delete the text and enter a new text 
and read the text using gtk_entry_get_text().
I printed the text and discovered that the invalid characters were 
present in the read text!
This may be correct seen from the point of view that I was only able to 
delete the characters I could actually see displayed in the entry, but 
on the other hand, the gtk_entry_get_text() should return an UTF-8 
string I would expect.

I also tried to overwrite the invalid text with a new shorter, but 
correct UTF-8 text string using gtk_entry_set_text().
When I read the text using gtk_entry_get_text() I still got some invalid 
characters back from the previous erroneous text.
I this in any way correct behaviour?

So the situation is quite locked after entering an invalid string, is 
that intended?

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


Re: Multiple lines in statusbar

2005-04-29 Thread Egon Andersen
Andrew E. Makeev wrote:
Egon Andersen wrote:
Hi,
I've sometime multiple lines of text in the statusbar.
Normally I achieve this by just inserting \n in the text-string.
This works fine on Linux, but recently I saw that on Windows I only 
get a single line and the line-break are shown as the square fallback 
character.
(I can't tell if it has ever been more than a 'one-liner' on windows.)

I find this behaviour a little strange as the same way of making 
multiple lines works for e.g. labels on both Linux and Windows.

Linux is using just '\n' (LF = 0xA) character for end of line, but MS 
Windows - '\r\n' (CR + LF = 0xD + 0xA) characters.
Guess, STL lib defines that in std::eol when you are using std::cout, 
std::cerr output streams.
Well, I'm using C, not C++ ;-)
I know that there are differences between Unix/Linux and Windows on how 
newline is defined, but \n is exactly saying newline, not how it is 
implemented on the particular platform.

According to the C-standard (ISO-C99):
cite
\n (newline) Moves the active position to the initial position of the 
next line.
/cite

And in fact if you open a file in text-mode on Windows, \n is converted 
to CR+LF - that is one of the ideas behind using \n and text-mode.

So I can't really see why \n should not be correct when I write a 
string to the statusbar, just as well as it works correct when it is a 
label.

And it is a disaster for portability, if \n should be \r\n on 
Windows and even something else on Mac.

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


Re: Multiple lines in statusbar

2005-04-29 Thread Egon Andersen
[EMAIL PROTECTED] wrote:
And in fact if you open a file in text-mode on Windows, \n is converted
to CR+LF - that is one of the ideas behind using \n and text-mode.
So I can't really see why \n should not be correct when I write a
string to the statusbar, just as well as it works correct when it is a
label.
And it is a disaster for portability, if \n should be \r\n on
Windows and even something else on Mac.

Did you test it, just to sort out if the issue is the \n not automatically
being translated into \r\n or not.
I've just tried to insert \r\n - now I see two squares (fallback 
characters).
So it seems that statusbar on Windows has some problems handling both 
\r and \n!

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


Multiple lines in statusbar

2005-04-28 Thread Egon Andersen
Hi,
I've sometime multiple lines of text in the statusbar.
Normally I achieve this by just inserting \n in the text-string.
This works fine on Linux, but recently I saw that on Windows I only get 
a single line and the line-break are shown as the square fallback character.
(I can't tell if it has ever been more than a 'one-liner' on windows.)

I find this behaviour a little strange as the same way of making 
multiple lines works for e.g. labels on both Linux and Windows.

Should this be regarded as a feature or a bug?
On Linux: gtk+-2.4.x (latest FC3 update)
On Windows: gtk+-2.6.7 (latest from http://gladewin32.sourceforge.net/)
Best regards
Egon Andersen
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Scrool to top / buttom using Home / End

2005-03-08 Thread Egon Andersen
Hi,
I've experience annoying differences between how Home / End works on 
Linux and MS Windows.
When I have a scrooled window I can go to buttom by pressing End and go 
to top by pressing Home - when I am using Linux that is!
But on Windows it either have no effect to press Home / End or it jumps 
between first and last tab in a notebook (an ancestor).

I this behaviour related to the windows-manager Gnome vs. MS Windows or 
differences in GTK+?
And can I do anything to have the Linux-behaviour on MS Windows too.

Linux: Using GTK+-2.4
MS Windows: Using GTK+-2.6
Best regards
Egon Andersen
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Setting tooltips on GtkComboBox

2005-02-21 Thread Egon Andersen
Hi,
I've tried to set tooltips on a GtkComboBox, but apparently this doesn't 
work.
I've like another who asked on this list long ago tried to do it 
directly on the gtkcombobox and also tried on the child (gtkbin), but 
none of this seems to work. At least I don't get any tooltips :-(

Is this missing in the GtkComboBox or how do I make it work?
I'm using gtk-win32-2.6.2-rc1 from http://gladewin32.sourceforge.net/
Best regards
Egon Andersen
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Setting tooltips on GtkComboBox

2005-02-21 Thread Egon Andersen
Egon Andersen wrote:
Hi,
I've tried to set tooltips on a GtkComboBox, but apparently this doesn't 
work.
I've like another who asked on this list long ago tried to do it 
directly on the gtkcombobox and also tried on the child (gtkbin), but 
none of this seems to work. At least I don't get any tooltips :-(

Is this missing in the GtkComboBox or how do I make it work?

Problem solved!
Putting the GtkComboBox inside an GtkEventBox solved the problem.
Best regards
Egon Andersen
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: blinking widgets...

2005-02-04 Thread Egon Andersen
Ben Johnson wrote:
Hi.
I can configure my Debian unstable gnome apps ring visibly when the
system bell rings.  I like that.  Also, I noticed that Windows XP will
do something similar when a modal dialogue is active and you try to
click on some other piece of the application to get your attention.  I
like the Windows blinky thing a lot.  it's very effective and intuitive,
imho.
I want to do something similar in my app.  I'm going to end up with a
page full of options the user will need to choose from.  Some options,
once chosen, will require the selection of some other options.  I think,
instead of showing an error message in a little annoying dialogue that
no one will ever read and requires someone to press OK, I'll make a way
to blink the possible options.
I'm thinking, to do this, I'll make an object...  an object call
BlinkWidgetsGroup or something like that.  To use it, you instantiate it
then add, one at a time, any widget that you want to have blink.  Then
you can optionally set things like the duration of a blink, the color(s)
to use, maybe some sort of blink style (like focus-on-off, or...
background-light-dark, and so on).  Then call the blink function.
hrm.  and maybe you can have it destroy itself when it's done blinking
too.
What do you think?  useful?  Does something like that exist?  Is there a
better, easier, more flexible, (or whatever) way to do it?  worthwhile?
- Ben
I'll look forward to a solution of this kind.
I've made a simple and dirty solution for something like that and my 
customers are pleased.
(Some people on this list would probably vomit, as my solution does not 
go well with themes.)

So I'm positive.
Best regards
Egon Andersen
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problems printing 64-bit integers i glib 2.4.8

2004-12-14 Thread Egon Andersen
Owen Taylor wrote:
On Tue, 2004-12-14 at 15:28 +0100, Egon Andersen wrote:
Hi,
I've experienced problems with g_strdup_printf() in glib 2.4.8 when I 
try to print 64-bit integers on Windows.

I have the following line in my code:
intmax_t se_nr; /* ISO-C99 */
...
se_nr = ... /* e.g. 12345678 */
...
string = g_strdup_printf(%08PRIdMAXadmin, se_nr);
^^^
   What's that? 

That is a macro defined in ISO-C99 in inttypes.h which expands to 
whatever is the format used for the max integer type defined. And is 
matching intmax_t which is the max integer type defined.
On Windows this is 64-bit integers.

If you use gint64 and G_GINT64_FORMAT does it work?
No - same result :-(
Both macros (PRIdMAX and G_GINT64_FORMAT) expands to the same I64i on 
Windows.

A little additional info! A standard snprintf() is working as expected!
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Problems printing 64-bit integers i glib 2.4.8

2004-12-13 Thread Egon Andersen
Hi,
I've experienced problems with g_strdup_printf() in glib 2.4.8 when I 
try to print 64-bit integers on Windows.

I have the following line in my code:
intmax_t se_nr; /* ISO-C99 */
...
se_nr = ... /* e.g. 12345678 */
...
string = g_strdup_printf(%08PRIdMAXadmin, se_nr);
string is assigend NULL and the error from perror(NULL) says:
Invalid argument
This has been working correct in previous releases, so what has happened 
in the new release?
I this an error in glib 2.4.8 or maybe in the prebuild package?

Additional info:
I use the prebuild Gtk+/Win32 Runtime Environment Installer 2.4.14-rc1
from http://gladewin32.sourceforge.net/
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Egon Andersen
Jan-Marek Glogowski wrote:
Hi Egon
This is a hack, but I it should work:
static void combo_toggle_func( GtkToggleButton
*togglebutton, gpointer user_data )
{
// Do your menu stuff
}
static void scan_children( GtkWidget *w,  gpointer data )
{
if( GTK_IS_TOGGLE_BUTTON( w ) ) {
g_print( Found Button!\n );
g_signal_connect( w, toggled,
G_CALLBACK( combo_toggle_func ), NULL );
}
}
gtk_container_forall( GTK_CONTAINER( my_combo ), scan_children, NULL );
I have also attached a patch to add a popup event (diff against v2.5.5).
Maybe you can try it and report results to the list, so it could be
included in the 2.6 release.
HTH
Jan-Marek
Thanks Jan-Marek,
I've experimented with the above 'hack'.
Unfortunately no toggle_button is found during the child-scan.
Actually the scan found only one widget in the gtkcomboboxentry, which 
to me seems quite strange as I would have expected at least two.
(Checke by setting another print-statement in the scan_children())

I haven't been able to determine which widget it actually detected, as I 
hevent found any good way of getting the type extracted from the widget 
in a human readable way.

Do you have any clue on what is going on here?
Best regards
Egon Andersen
(Also things like the GTK_IS_TOGGLE_BUTTON() macro is not found in the 
documents - okay, it is defined in the header-file, but it is missing in 
the GTK+ Reference Manual for GtkToggleButton)
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Egon Andersen
Jan-Marek Glogowski wrote:
Just checked the source for 2.4.13 and 2.5.5. Both use a
GtkToggleButton...
Check the following scan function - should print a list of found object
types:
static void scan_children( GtkWidget *w,  gpointer data )
{
g_print( %s\n, G_OBJECT_TYPE_NAME( w ) );
}
For me it finds:
GtkToggleButton
GtkEntry
Unfortunately I only get GtkEntry :-(
I've checked that the first argument to gtk_container_forall() is a 
GtkComboBoxEntry
And according to printout from the callback it has only one child which 
in an GtkEntry.

According to the documentation on my machine it should be 2.4.13 I have 
on my FC3 - this is really strange!

The test you ran was that on a 2.4.13 or 2.5.5 or both?
About GTK_IS_... macro:
There are six std macros defined by every Gtk+ class. They are used for:
2* type checks (GTK_IS_...[_CLASS])
2* obj casts (GTK_...[_CLASS]), e.g. GTK_BIN( my_combo )-child
1* the type system internal type (GTK_TYPE_...)
1* get the objs class (GTK_..._GET_CLASS)
Thanks for the explanation.
E.g. if you look into the code, you will find a lot of
g_return_if_fail( GTK_IS_...( combo ) );
For more information read the Gtk+ tutorial and
http://www.le-hacker.org/papers/gobject/
I think these six macros should also be in the reference manual.
I expect to be able to find any (public) available function/macro in the 
reference manual.

And be sure you use gtk_container_forall not gtk_container_foreach!
I checked in the reference manual before use - and know the difference! 
But thanks for pointing it out.

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


Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Egon Andersen
Jan-Marek Glogowski wrote:
Hi
I added a patch for a popup event to my first reply. I wanted to file a
bug report, but didn't really come up with a good case.
There was a similar request a few days ago: Accessing GtkComboBoxEntry's
toggle button.
The patch is very simple - just two gtk_signal_emit, a return value to
cancel popup and the signal definition ~20 lines of code.
In my case it is a list of elements taken from a database. The list can 
be changed while the application is running.
At the time I click on the combobox it is determined if the list in the 
db has changed and update the combobox list if required.

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


Transparent event snooper

2004-11-20 Thread Egon Andersen
Hi,
I've tried to make my GtkComboBoxEntry() work as I wanted, but without 
success.

Therefor I would like to make a 'transparent event snooper', so that I 
can see what is going on without interfearing with the widgets below.

I've tried to make a GtkEventBox() to which I add the GtkComboBoxEntry()
To be able to see all events before the child I've also set 
gtk_event_box_set_above_child(eventbox, TRUE)

Now I expect that I can receive all relevant events by the use of
g_signal_connect(eventbox, event, callback_func ...)
In the callback function I print the events using event-type
And the callback function always returns true
Now my problem is that this eventbox doesn't act as I expected - or more 
correct - the arrow-button in the GtkComboBoxEntry disappears.

Why do this happen?
It seems like the GtkComboBoxEntry doesn't receive some events??
But I thought I made my snooping transparent...
And how do I make a 'transparent event snooper' ?
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Remove all text elements from GtkComboBox

2004-11-19 Thread Egon Andersen
Hi,
I've started migrating from GtkCombo to GtkComboBox.
My old GtkCombo contains only text, so I use gtk_combo_box_new_text()
At some point I have to 're-build' the text in the combobox which is 
done by first removing all existing text 'entries' and insert all the 
new text 'entries'.
I haven't stored information about how many text elements I have appended.
I've planed to use gtk_combo_box_remove_text(), but I can't see how I 
can know when I have removed all text 'entries'.
(I the old GtkCombo, I just ran through the glist.)

Anyone able to help me on this one - it is probably simple when you know 
how to do it...

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


Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-19 Thread Egon Andersen
Hi,
During my migration from GtkCombo() I experienced that I miss a signal 
when the 'arrow' at the right of the GtkComboBoxEntry() is pressed.
I can't seem to find the relevant signal.
When GtkCombo() was used I used set-focus-child, but that doesn't do 
the trick any more.
I've searched and experimented with a number of possible (and 
impossible) signals without luck.

Best regards
Egon Andersen
(This is used to trigger the re-build I was mentioning in an earlier 
post today on this list.)
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Setting tooltips delay?

2004-11-08 Thread Egon Andersen
Hi,
I was looking for a way to decrease the tooltips delay.
I found gtk_tooltips_set_delay(), but it is deprecated and according to 
the documentation the delay is set in seconds!!!

Are there another better/correct way to decrease the delay?
I would probably like to decrease it by 50% or so.
Best regards
Egon Andersen
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Changing background color of text in statusbar

2004-10-01 Thread Egon Andersen
Hi,
I've been trying to change the background colour for the text dispalyed 
in a statusbar, but I don't get it as I want it!

I simply want the background of the text to be red, but it seems to be 
quite difficult - or I've just missed something. (Probably the later :-)

I've tried a lot of things including use of 'private' variables in the 
GtkStatusbar structure!

The following sample code gives me a red frame and a little red square 
to the right in the statusbar - not quite what I want!


Sample code:
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_INSENSITIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_INSENSITIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_INSENSITIVE, red);

if(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget != 
NULL)
  {

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_NORMAL, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_ACTIVE, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_PRELIGHT, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_SELECTED, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_INSENSITIVE, red);
  }

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


Re: Changing background color of text in statusbar

2004-10-01 Thread Egon Andersen
Viraj Chatterjee wrote:
Put your gtk_label in an eventbox and then change the background of the 
eventbox.
Look at:

3.1.
How do I change the color of a widget?
in the Common queries at the GTK+ web site.
Do you mean www.gtk.org FAQ chapter 6.1 ?
I don't see anything called 'Common queries'...
-vc
I can't just put the label in an eventbox. The label is a part of the 
GtkStatusbar.
So I can't see how I can put it in an eventbox - unless I should put the 
entire GtkStatusbar in an eventbox?

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


Changing background color of text in statusbar

2004-10-01 Thread Egon Andersen
Hi,
I've been trying to change the background colour for the text dispalyed 
in a statusbar, but I don't get it as I want it!

I simply want the background of the text to be red, but it seems to be 
quite difficult - or I've just missed something. (Probably the later :-)

I've tried a lot of things including use of 'private' variables in the 
GtkStatusbar structure!

The following sample code gives me a red frame and a little red square 
to the right in the statusbar - not quite what I want!


Sample code:
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(active_statusbar, GTK_STATE_INSENSITIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-frame, 
GTK_STATE_INSENSITIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_NORMAL, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_ACTIVE, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_PRELIGHT, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_SELECTED, red);
   gtk_widget_modify_bg(GTK_STATUSBAR(active_statusbar)-label, 
GTK_STATE_INSENSITIVE, red);

if(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget != 
NULL)
  {

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_NORMAL, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_ACTIVE, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_PRELIGHT, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_SELECTED, red);

gtk_widget_modify_bg(GTK_LABEL(GTK_STATUSBAR(active_statusbar)-label)-mnemonic_widget, 
GTK_STATE_INSENSITIVE, red);
  }

Best regards
Egon Andersen
___
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


Gdk-WARNING: BitBlt failed

2004-04-15 Thread Egon Andersen
Hi,

I've seen this warning on MS Windows XP:
Gdk-WARNING **: gdkdrawable-win32.c1568: BitBlt failed: Handlen er ikke 
gyldig.

(The last 4 words translated to english: The handle is not valid.)

This seems to happen when Windows XP goes into 'Screen-lock'.
There are probably 100 or more occurences of this error message.
The same application compiled on/for Linux do not cause this 
error-message, when Linux goes into 'Screen-lock'.

Do anyone know what causes this problem and knows about a cure?
(There is no timer signals in the application, but perhaps there are 
some internally in Gtk+/Gdk.)

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


Re: Hex numbers

2004-02-25 Thread Egon Andersen
Tom Froysland wrote:
What should I use to get or show hex numbers.

How about GtkEntry() combined with gtk_entry_set/get_text(), sprintf() 
and strtoi()
sprintf() could also be g_strdup_printf()

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


Re: GtkEntry right aligned/justified (and Solution)

2004-02-23 Thread Egon Andersen
Steffen Gutmann wrote:
O.K. I submitted a report to bugzilla, id 135177 
(http://bugzilla.gnome.org/show_bug.cgi?id=135177).

Thanks again for your help,

   Steffen

Mariano Surez-Alvarez wrote:

They surely are reading... but filing a request for enhancement bug in
bugzilla, http://bugzilla.gnome.org/, is usually the recommended course
of action.
I think you will find that it is already covered in a more general way by:
http://bugzilla.gnome.org/show_bug.cgi?id=59799
/Egon
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkEntry right aligned/justified (and Solution)

2004-02-23 Thread Egon Andersen
Steffen Gutmann wrote:
Hi Egon!

Egon Andersen wrote:

Steffen Gutmann wrote:

O.K. I submitted a report to bugzilla, id 135177 
(http://bugzilla.gnome.org/show_bug.cgi?id=135177).


I think you will find that it is already covered in a more general way 
by:
http://bugzilla.gnome.org/show_bug.cgi?id=59799


Oh, I didn't see that.  Maybe I should have searched the bug database 
first.  I read id 59799 and it seems they cover the same aspect as I 
did, but then I read this:

--- Additional Comments From [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] 2003-03-30 03:17 --

I think this just shows the old knowledge - don't change things that
are working :-)
I did of course forget that the cursor do not need to be at the end of
the text. Back in november/december this was all clear to me, but
there has been so much going on since.
Hopefully someone can complete the implementation, as I know I won't
get time for this in the near future :-(
---

So, it seems their implementation isn't complete yet...

Well, yours isn't complete either ;-)
What is missing in 59799 is commented by Owen Taylor, something like the 
g_return_if_fail and then the description of the functions should be 
improved.
The solution in 59799 give the possibility to have any alignment, not 
just right, left and center as your proposal.
Furthermore there must be made test-instructions.

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


Re: GtkEntry right aligned/justified (and Solution)

2004-02-23 Thread Egon Andersen
Steffen Gutmann wrote:
Hi Egon!

Egon Andersen wrote:

So, it seems their implementation isn't complete yet...

Well, yours isn't complete either ;-)


I think, they were talking about scrolling and that the solution in 
59799 didn't cover it correctly.  I checked the scrolling in my version 
and seems to be ok.
There is nothing wrong with the scrolling in the solution in 59799.
We just had some discussions about how the code could be written, but 
the results are the same.
There was a little about clamp, where I had a short brain-damage, as at 
the time where Owen Taylor commented on it, it was almost 6 months since 
I looked at this. (And now it is another year.)

Have you tried to set RTL and used your solution?
You have default LEFT, which I believe will not be what was expected 
when RTL.

59799 respects the RTL and an adjustment equal to 0.0 is the default.
An adjustment of 1.0 will do the opposite, which in LTR means right 
adjusted, but in RTL means left adjusted.

What is missing in 59799 is commented by Owen Taylor, something like 
the g_return_if_fail and then the description of the functions should 
be improved.


Yes, I agree.  Actually, the whole gtkentry.c could benefit from some 
more comments...

Couldn't agree more ...

The solution in 59799 give the possibility to have any alignment, not 
just right, left and center as your proposal. 


This is something I want to discuss.  In principle I see no problem in 
making GtkEntry having any alignment (in [0;1]) and the solution would 
be straight-forward (given what I have now).  But is there any need in 
having an entry aligned other then left, center, or right?  For, a label 
I see that one might want to have it aligned with a value of 0.1 (so 
mainly left but also using little space on the left if available), but 
for a GtkEntry?  Would that make sense?  Editing a GtkEntry with an 
alignment of 0.1 might be a strange thing.  I only see left, center and 
right useful like in an text editor: most time you have text left 
aligned, for numbers you might choose right aligned, and for something 
pretty, you center it.

Well, my experience it that whenever something is restricted, someone 
would like to do something that was not possible due to the restrictions.

Furthermore there must be made test-instructions. 


How about, if the entry example covers this?  A new choice-type field 
could be added to the example where the user can select the justification.

I believe a test instruction is a little more than just an example.

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


g_spawn_command_line_async and MinGW

2004-02-12 Thread Egon Andersen
Hi,

I've used g_spawn_command_line_async with success on Linux RH7.3 and 
have tried to make it work on MSWindows too.
I've noticed the special 'syntax' to be used when a command-line is used 
on windows and tried a lot of different things, but I always end up with 
an GError:
domain: 543 (g-exec-error-quark)
code: 19 (G_SPAWN_ERROR_FAILED -- I think?)
message: Failed to execute helper program

actual program line is:
result = 
g_spawn_command_line_async('C:\\Programmer\\mozilla.org\\Mozilla\\mozilla.exe', 
error);

I'm wondering if this is related to MinGW do not have fork()?

Any other idea about how to launch a heavy application from within my 
application on MSWindows?
Maybe g_thread_create() and execl(), but that I can't make working on 
Linux RH7.3 -- I get Real-time signal 1 after a while; the 'child' 
starts and the 'parent' dies. This was not what I wanted ;-)

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


Re: g_filename_to/from_utf8()

2004-02-03 Thread Egon Andersen
Owen Taylor wrote:
On Mon, 2004-02-02 at 17:24, Egon Andersen wrote:


On RH9:
locale gives
LANG=en_DK.UTF-8
LC_CTYPE=en_DK.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE=en_DK.UTF-8
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES=en_DK.UTF-8
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=
and env gives G_BROKEN_FILENAMES=1

So it seems that my locales should be okay, but not the G_BROKEN_FILENAMES


This combination gives you UTF-8 for the filename encoding. Please retry
your tests.
The main problem (atleast causing the problem on RH9) showed to be a 
call to setlocale() that was not restored correctly.
To make it work on RH7 (and others) I've had to make some assumtions 
that if G_BROKEN_FILENAMES is not set, try g_locale_to/from_utf8() and 
if that failes, try ISO-8859-1.
Now it is working on all platforms I have, eventhough I don't like to 
make the assumptions.

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


g_filename_to/from_utf8()

2004-02-02 Thread Egon Andersen
Hi,

I've had some problems with g_filename_to/from_utf8().

On a Linux RH7.3 g_filename_from_utf8() returns an utf8 string i.e. not 
converted. RH7.3 do not use utf8 as its native file name representation.

On a Linux RH9 g_filename_from_utf8() returns an iso-8859-1 string 
(atleast it looks like iso-8859-1) i.e. converted. RH9 uses utf8 as its 
native file name representation.

In both cases the file names looks wrong in a shell and in Nautilus.

On Windows XP g_filename_from_utf8() returns an iso-8859-1(or CP1252?) 
string (or whatever is native on Windows XP ;-) i.e. converted.

(Fortunately g_filename_to_utf8 reverses the string in all three cases.)

Anyone experienced something like this?
What do I do wrong, if I do anything wrong?
Are there any way to determine the 'native file name representation', so 
that I could you one of the other convertion functions instead?

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


Re: g_filename_to/from_utf8()

2004-02-02 Thread Egon Andersen
Sven Neumann wrote:
Hi,

Egon Andersen [EMAIL PROTECTED] writes:


I've had some problems with g_filename_to/from_utf8().


The encoding of the returned string depends on the encoding of
your locale but only if you have the environment variable
G_BROKEN_FILENAMES set.
Okay, this gave me some info about why the platforms behaves like they do.
It seems strange that G_BROKEN_FILENAMES is not set on RH7.3, but it is 
set to 1 on RH9... and apparently it should have been the opposite!
Do this really mean that I can't rely on the default setup on neither 
RH7.3 nor RH9 or other Linux distros?
(I haven't done any manual changes around G_BROKEN_FILENAMES.)
I thought (hoped?) the idea was to make it easier to make portable 
applications ;-)

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


Re: g_filename_to/from_utf8()

2004-02-02 Thread Egon Andersen
Owen Taylor wrote:
On Mon, 2004-02-02 at 15:25, Egon Andersen wrote:

Sven Neumann wrote:

Egon Andersen [EMAIL PROTECTED] writes:


I've had some problems with g_filename_to/from_utf8().
The encoding of the returned string depends on the encoding of
your locale but only if you have the environment variable
G_BROKEN_FILENAMES set.
Okay, this gave me some info about why the platforms behaves like they do.
It seems strange that G_BROKEN_FILENAMES is not set on RH7.3, but it is 
set to 1 on RH9... and apparently it should have been the opposite!
Do this really mean that I can't rely on the default setup on neither 
RH7.3 nor RH9 or other Linux distros?
(I haven't done any manual changes around G_BROKEN_FILENAMES.)
I thought (hoped?) the idea was to make it easier to make portable 
applications ;-)


If G_BROKEN_FILENAMES is set, then the encoding if
g_filename_to/from_utf8 is the encoding of your locale. The default
locales on RH9 are UTF-8 locales, but you apparently have a different
setting.
On RH7:
locale gives
LANG=en_GB
LC_CTYPE=en_GB
LC_NUMERIC=en_GB
LC_TIME=en_GB
LC_COLLATE=en_GB
LC_MONETARY=en_GB
LC_MESSAGES=en_GB
LC_PAPER=en_GB
LC_NAME=en_GB
LC_ADDRESS=en_GB
LC_TELEPHONE=en_GB
LC_MEASUREMENT=en_GB
LC_IDENTIFICATION=en_GB
LC_ALL=
and env gives no G_BROKEN_FILENAMES

On RH9:
locale gives
LANG=en_DK.UTF-8
LC_CTYPE=en_DK.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE=en_DK.UTF-8
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES=en_DK.UTF-8
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=
and env gives G_BROKEN_FILENAMES=1

So it seems that my locales should be okay, but not the G_BROKEN_FILENAMES

Are there anything else than the locale/language setup that could cause 
G_BROKEN_FILENAMES to be erroneous?

(And actually the machine with RH9 is installed with a minimum of 
changes of default settings, simply as one of its purposes is to have a 
'clean' reference to test programs on.)

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


g_filename_to/from_utf8()

2004-02-01 Thread Egon Andersen
Hi,

I've had some problems with g_filename_to/from_utf8().

On a Linux RH7.3 g_filename_from_utf8() returns an utf8 string i.e. not 
converted. RH7.3 do not use utf8 as its native file name representation.

On a Linux RH9 g_filename_from_utf8() returns an iso-8859-1 string 
(atleast it looks like iso-8859-1) i.e. converted. RH9 uses utf8 as its 
native file name representation.

In both cases the file names looks wrong in a shell and in Nautilus.

On Windows XP g_filename_from_utf8() returns an iso-8859-1(or CP1252?) 
string (or whatever is native on Windows XP i.e. converted.

(Fortunately g_filename_to_utf8 reverses the string in all three cases.)

Anyone experienced something like this?
What do I do wrong, if I do anything wrong?
Are there any way to determine the 'native file name representation', so 
that I could you one of the other convertion functions instead?

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


Re: Rotate label 90 degrees

2004-01-05 Thread Egon Andersen
NGP Languages wrote:
Happy New Year to ALL!

 Egon Andersen wrote:

Hi,

I'll like to insert a label that is rotated 90 degrees i.e. the label 
text is vertical and not horizontal.
How can I do this?



Because the text in a widget cann't be rotated,
you will have to create a pixmap picture that you can add to the label.
(I think this is the only way it can be done, isn't it?)
The text in my labels are not static (but semi static), so I'll need to 
be able to generate these within my application.
I have some loose idea about how this could be done, but I'm still 
looking for how to do it using gtk, gdk and their friends.

My loose idea is:
1) make the label with horizontal text (gtk_label_new())
2) grab it as a pixmap (but how?)
3) rotate the pixmap (but how?)
4) insert rotated pixmap (probably using gtk_image_new_from_pixmap())
Is this feasible and how do I solve 2) and 3)?

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


Rotate label 90 degrees

2004-01-04 Thread Egon Andersen
Hi,

I'll like to insert a label that is rotated 90 degrees i.e. the label 
text is vertical and not horizontal.
How can I do this?

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


Setting fixed-width font

2003-09-26 Thread Egon Andersen, Talura
Hi,

I have a widget (actually a GtkLabel, but it may be changed later) for 
which I want use fixed-width font.

Is there a simple way to achieve this?

(I've looked in the FAQ and mail-archive. But it only described a 
solution using a resource file, which I don't want to use in this case.)

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


Setting fixed-width font

2003-09-26 Thread Egon Andersen
Hi,

I have a widget (actually a GtkLabel, but it may be changed later) for 
which I want use fixed-width font.

Is there a simple way to achieve this?

(I've looked in the FAQ and mail-archive. But it only described a 
solution using a resource file, which I don't want to use in this case.)

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


Forcing window updates

2003-03-31 Thread Egon Andersen
Hi,

I've got a problem in an application, that some of my widgets in a
notebook-page are not shown before I click on a button in the same
notebook-page.
It looks to me as if the gtk-engine somehow has 'forgotten' to show the
widgets until 'something' happens in the window/notebook-page.

I've tried to use gdk_window_process_all_updates() and hoped that it
could somehow force redraw of the window/notebook-page, but without any
luck.

These widgets are created during a phase where I have frozen the display
using gtk_widget_freeze_child_notify() and later it is thawed by
gtk_widget_thaw_child_notify(), so I would expect that widgets are drawn
after the thaw??

Do anyone have an idea about what could be wrong or perhaps have an idea
about how I can force the update?

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


Re: Forcing window updates

2003-03-31 Thread Egon Andersen
On Tue, 2003-04-01 at 07:03, Owen Taylor wrote:
 On Mon, 2003-03-31 at 16:30, Egon Andersen wrote:
  Hi,
  
  I've got a problem in an application, that some of my widgets in a
  notebook-page are not shown before I click on a button in the same
  notebook-page.
  It looks to me as if the gtk-engine somehow has 'forgotten' to show the
  widgets until 'something' happens in the window/notebook-page.
  
  I've tried to use gdk_window_process_all_updates() and hoped that it
  could somehow force redraw of the window/notebook-page, but without any
  luck.
 
 You have somehow broken GTK+ updates in GTK+ are supposed to 
 just work, so there is no function to call make updates work.
 
 If you can create a small standalone test, it would be worth filing a
 bug.


It is a quite hairy combination of notebooks, tables and containers, so
it will probably take a looong time to cut it down and still have the
problem. Unfortunately this will not go to my highest priority list. 

 
  These widgets are created during a phase where I have frozen the display
  using gtk_widget_freeze_child_notify() and later it is thawed by
  gtk_widget_thaw_child_notify(), so I would expect that widgets are drawn
  after the thaw??
 
 I don't think those functions do what you think they do... unless you
 are implementing a container widget, there should be no reason to
 call them (though I wouldn't expect them to have much effect one way
 or the other.. notification of child properties is basically there for
 GUI builders.) Removing these calls would be the first step to take.
 
Well, removing these calls didn't solve the problem at all.
Actually, these freeze/thaw are making the update both faster and
smoother. The intension is to prevent a lot of table-resizing during the
population of the tables with widgets of different sizes.
If there are better ways/more correct ways to do this, I'll be pleased
to hear about this.
So in my application freeze/thaw do have effect, but does not seem to
have any relation to the problem in question.
Actually the button I mentioned that I clicked to (as an unintended
bi-effect) make the contents visible, do also freeze/thaw.

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


Windows shows a terminal even when I use WinMain()

2003-03-15 Thread Egon Andersen
Hi,

System info: WindowsXP, MinGW, GTK2+

I've ported an application from Linux to Windows.
When I start the application I get both the application and a
windows-terminal.
I've used the construction given earlier on this list, using the
WinMain().

Do anyone have a clue about what I may have done wrong?



Another thing not related to this at all.
I have a check_button in a notebook tab label.
This works perfect on Linux, but on Windows I can see the check button,
but I cannot set/unset it.
Is this a known problem and do anyone have an idea about how to make is
work in Windows too?

Best regards
Egon Andersen

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


Drag and drop files

2003-01-06 Thread Egon Andersen
Hi,

Using GTK2+.

I have thought of making drag and drop of files from/to an application I 
make,
to/from e.g. Netscape Messenger to make/get an e-mail attachment.
I've looked at gtk_drag_xxx, but I haven't been able to find out how I can
drag/drop files.
Do anyone have experience with this? I would be glad to get a pointer in 
the
right direction and of course a code-example would be great.


Best regards
Egon Andersen

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


Re: Compiled, linked, but get error related to nonuse of -fnative-struct !!!

2002-12-21 Thread Egon Andersen
On 2002-12-19 20:23 John Miskinis wrote:

Wow folks, I think I've almost got a GTK+ example app built
on Win98SE, under mingw/msys!

GCC is telling me that the -fnative-struct switch is not
recognized!  I was able to build without it, but get an
error dialog, stating that GtkWindow is not the right size,
and probably caused by the lack of the -fnative-struct switch.

It appears the GCC is 3.2 (mingw-special-XXX) (some number)

Q: How do I get to the point where the -fnative-struct switch works?

In gcc 3.x, use:
-mms-bitfields

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



gtk_text_view / gtk_text_buffer

2002-11-30 Thread Egon Andersen, Talura
Hi,

(Using GTK2+)

I'm trying to insert a (fixed) multi-line text into a gtk_text_view 
using gtk_text_buffer_insert()

My problem is that only the first line is displayed.
When I click in the gtk_text_view field the field expands and I can see 
all my inserted text lines.

How can I force all lines to be displayed in my gtk_text_view field?
(I.e. without having to click in the window of cause :-)

Best regards
Egon Andersen

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


right-justify text in entry

2002-11-02 Thread Egon Andersen
Hi,

(GTK+-2.0)
I'm trying to make text (numbers) right-justified in a GtkEntry, but I 
haven't been able to do it right.
The best I've got until now is to use:
gtk_widget_set_direction (entry, GTK_TEXT_DIR_RTL);
but that is not a good solution, as it is setting the direction the text 
is entered, which is not quite the same as text justification, and gives 
a 'strange' cursor behaviour.

Do anyone have a solution or a hint?
I'm willing to make my own widget type, if someone can point me in the 
right direction to solve the problem.

Best regards
Egon

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


How do I expose a specific widget and all it parents?

2002-09-12 Thread Egon Andersen, Talura

Hi,

I don't know if the correct word is 'expose' or something else, but I'll 
try to explain my problem.

I have a notebook with several pages and I want to be able to from the 
application to show/expose any specific page I want.

I have notebooks that are nested and I imagine this may complicate things.

I also have scrollable windows and want a specific entry to be visible - 
just another complication I imagine.

Do anyone have hints or ideas?


Traditionally the user just click on the notebook tab and gets the 
selected page and scroll until the specific entry is visible, but I want 
to be able to select the page from the application and make the entry 
visible.

(The reason is that a post validation of entry data has shown that the 
entry data is invalid and the user has to correct it.)

Best regards
Egon Andersen


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



Re: How do I expose a specific widget and all it parents?

2002-09-12 Thread Egon Andersen, Talura

Cupitt, John wrote:
 Egon Andersen, Talura wrote:
   I have a notebook with several pages and I want to be able to from the
   application to show/expose any specific page I want.
 
 I think you need gtk_notebook_set_page()

I thought of this function, but then I need to make it top-down. I can 
in no way just say that I want to see the page (and its parents) 
containing a specific widget?
I can probably use the gtk_widget_get_parent/gtk_widget_get_ancestor to 
find the parent notebook(s), so I try that even though it seems a little 
clumsy.

BTW When I used gtk_widget_get_ancestor(notebook1, GTK_TYPE_NOTEBOOK), I 
got the pointer equal to 'notebook1', not the parent notebook as I had 
expected. Is this the intended behaviour of gtk_widget_get_ancestor() or 
is it a simple bug? (It is easy to work around in a consistent way, so 
it is no big deal.)

 
   I also have scrollable windows and want a specific entry to be visible -
   just another complication I imagine.
 
 It depends on what sort of thing you're displaying. Widgets like clist, 
 for example, have methods which will scroll to make a specific row visible.
 
 If it's not a clever widget, then you just set the adjustment on the 
 scrolled window to the position of the child.

It is 'any widget', so it can not be expected to be a clever widget :-)
But how do I get the position of the widget, so that I can set the 
adjustment?

Basicly what I have access to is the widget pointer. So I have to 
determine the position of the widget relative to the scrolled window 
somehow...??

Best regards
Egon Andersen

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



Re: How do I expose a specific widget and all it parents?

2002-09-12 Thread Egon Andersen, Talura

Cupitt, John wrote:
 Egon Andersen, Talura wrote:
 
  I have a notebook with several pages and I want to be able to from the
  application to show/expose any specific page I want.

I think you need gtk_notebook_set_page()

I thought of this function, but then I need to make it top-down. I can 
in no way just say that I want to see the page (and its parents) 
containing a specific widget?
 
 
 Hiya,
 
 Sure, just it depends on what info you're tracking. For example, if you 
 know the widget that each notebook page is showing, you can do
 
   gint page = gtk_notebook_page_num( nb, my_page_widget );
 
   gtk_notebook_set_page( nb, page );
 
 (or have I misunderstood?)

Basicly I just know the widget pointer, so it requires some processing 
to find the correct parent notebooks and setting the page... but that 
part is close to working. The code you show is just a small but 
important part of this :-)

 
 
 To get one out, do
 
   gtk_widget_get_ancestor( widget-parent, GTK_TYPE_WHATEVER )
 

Approximately how I did it.

 
  I also have scrollable windows and want a specific entry to be 
visible -
  just another complication I imagine.

It depends on what sort of thing you're displaying. Widgets like 
clist, for example, have methods which will scroll to make a specific 
row visible.

If it's not a clever widget, then you just set the adjustment on the 
scrolled window to the position of the child.

It is 'any widget', so it can not be expected to be a clever widget :-)
But how do I get the position of the widget, so that I can set the 
adjustment?
 
 
 What are you using inside the scrolled window to layout your widgets? 
 You might be able to just read child-allocation.x/y, or you might need 
 to poke about inside the layout widget.
 

Mostly a mix of vboxes and hboxes added some frames and sometimes tables.
So it seems to be quite a job and still I'm totally confused about how 
to get the adjustment of anything at all.
E.g. how do I get the adjustment of an entry inside a vbox?

Best regards
Egon Andersen

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



Re: win32/gcc : how to avoid need of -fnative-struct

2002-09-08 Thread Egon Andersen, Talura

Thierry CARRARD wrote:
 when compiling a win32 app using gcc and win32 gtk DLLs,
 
 you can suppress the ?fnative-struct option (which isn?t available any 
 more on gcc3.x)
 
 if you replace the contant of gtk/gtkbox.h by this (for version 2.0.6) :
 

Or use -mms-bitfields

/Egon

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



Transparent background in window?

2002-09-04 Thread Egon Andersen, Talura

Hi,

Is it possible to make the background in a window transparent?
The reason that I ask is that I have made a splash screen with an image 
that is not rectangular (transparent background) and I would like the 
window to appear as having the same shape as the image.
I've been looking at gtk_style family, but I haven't found the solution.

Any hints?

Best regards
Egon Andersen

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



problem with check_button in notebook tab

2002-08-26 Thread Egon Andersen, Talura

Hi,

[gtk2+]
I've inserted a check_button in some notebook tabs, which works fine in
my linux environment, but when I ported the code to windows, the
check_button could not be set/unset and the connected tooltips didn't
appear either.
I don't have problems with check_buttons or tooltips in other places
than in the notebook tab.
Do someone know why there is this strange difference between the linux
and windows versions?
And do anyone have an idea about how I can get the functionality in
windows.

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



How do I remove a widget from a table?

2002-08-12 Thread Egon Andersen, Talura

Hi,

I would like to remove one or more widgets from a table.
The widget has been attached earlier by gtk_table_attach().
When I try to destroy the widget I get a segmentation fault (which I to
some degree can understand), but how do I remove the widget the 'right
way' ?

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



Text always selected in entry

2002-07-31 Thread Egon Andersen, Talura

Hi,

GTK2:
It seems that the default text in an entry is always selected when
entering the field. How do I prevent that from happening. I've tried
gtk_editable_select_region with start and end set to 0, but this does
not help.
Do someone have an idea about how I get past this problem?

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



glade-1.2 -2.0

2002-07-30 Thread Egon Andersen, Talura

Hi,

I've made some UI's with glade-1.2 and has now upgraded to glade-2.0,
but I can't import my old projects. Are there any 'upgrade' facilities
available, so that I don't have to start again from scratch?

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



Right justification of text in GtkEntry

2002-07-25 Thread Egon Andersen, Talura

Hi,

How do I make text (actually digits) right justified when the digits are
typed in the entry box?

I would like to se my numbers typed as:
[   123.45]
rather than
[123.45   ]

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