Newbie in over head -- Marshallers

2003-03-28 Thread Dennie, Brooke
Hello,

I need to add a signal to the GtkWidget so that the callback functions will
take two pointers instead of one. i.e.
foo(GtkWidget *widget, gpointer clientdata, gpointer
datastruct){}

I realize that I need to use gtk_object_class_user_signal_new(), however, I
don't understand how to define a new marshaller for this. The FAQ simply
says "If you want your new signal to have more than the classical gpointer
parameter, you'll have to play with GTK+ marshallers." I'm guessing that I
need to use GtkCallbackMarshal() to define a function, but I can't seem to
find any documentation on what the marshaller functions actually need to do.

Note: I don't have access to the gtk src code on the machine I'm using yet,
so I can't look there for an example

Can anyone help me?

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


Signals - newbie

2003-04-06 Thread Dennie, Brooke
Hello,

I'm afraid that I'm a bit confused regarding
gtk_object_class_user_signal_new. Has it been deprecated? I noticed that it
is documented in 1.2's API (with no mention of future deprecation), but that
there is little mention of it in the 2.0 API reference short of a brief
paragraph in the signals section. Also, running cat * | grep
gtk_object_class_user_signal_new in the gtk directory is returning nothing.

I would really rather avoid rewriting all of the widgets to support the
signals that I need them to, not only because of time issues, but also
because it seems like a very very bad idea. Is there some other way to that
I'm (quite likely) missing?

Thanks for any help

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


pango and xfonts

2003-10-22 Thread Dennie, Brooke
Hi,

I'm currently working on a library of wrapper functions that converts code written in 
OLIT into gtk. I've run into a problem with fonts that hopefully someone here can help 
with.

I have a case where I'll be passed an XFontStruct* and need to be able to apply that 
to any number of widget types. It would be easiest for me if I could create a 
PangoFontDescription from the XFontStuct*, but I can't seem to find any series of 
methods in Pango that would achieve this (short of manually pulling whatever relevant 
properties I can from the XFontStruct*, setting them in a new description and hoping 
for the best). Are there any bettter ways? I'm still relatively new to gtk (and all 
GUI progamming for that matter), so if I've missed something blatant, feel free to 
point and laugh :)

Thanks for any ideas

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


Slow Rendering?

2003-11-19 Thread Dennie, Brooke
Hi to all,

I have an application that works perfectly, but rendering is
extremely slow (bringing up the application takes over 8
seconds, a popup window takes a little over 4). While I
realize that it isn't necessarily a guarantee that this is the
problem, stepping through the application with gdb shows that
the bulk of this (4-5 seconds) occurs when I try to show the
top widgets. However, if I take out all changes to the
background colors and fonts, the time drops to 3 seconds to
bring up the applicaton and < 1 second for popup windows. I
don't know if changing these via the rc file is faster, but
that option isn't available to me anyway since I won't know
what colors or fonts to use until run-time. Any ideas on
what's going on? I can supply some code if necessary.

Thanks for any help!

Brooke

PS - I'm working on a sparc ultra 5 that runs Solaris 8, BUT
the application is running from a window where I've ssh'd to a
linux terminal that runs redhat 9 with a 2.4.20-18.9 kernel

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


RE: Slow Rendering?

2003-11-20 Thread Dennie, Brooke
Hi again,

> -Original Message-
> From: Sven Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 20, 2003 6:04 AM
> To: Dennie, Brooke
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Slow Rendering?
> 
> 
> Hi,
> 
> "Dennie, Brooke" <[EMAIL PROTECTED]> writes:
> 
> > I have an application that works perfectly, but rendering is
> > extremely slow (bringing up the application takes over 8
> > seconds, a popup window takes a little over 4). While I
> > realize that it isn't necessarily a guarantee that this is the
> > problem, stepping through the application with gdb shows that
> > the bulk of this (4-5 seconds) occurs when I try to show the
> > top widgets. However, if I take out all changes to the
> > background colors and fonts, the time drops to 3 seconds to
> > bring up the applicaton and < 1 second for popup windows. I
> > don't know if changing these via the rc file is faster, but
> > that option isn't available to me anyway since I won't know
> > what colors or fonts to use until run-time. Any ideas on
> > what's going on? I can supply some code if necessary.
> > 
> > Thanks for any help!
> > 
> > Brooke
> > 
> > PS - I'm working on a sparc ultra 5 that runs Solaris 8, BUT
> > the application is running from a window where I've ssh'd to a
> > linux terminal that runs redhat 9 with a 2.4.20-18.9 kernel
> 
> It would help if you mentioned the version of GTK+ you are using and
> perhaps which Pango backend is in use.
> 
> 

Oops! Of course! Sorry. GTK+ is version 2.2.1. I'm not 
entirely sure what you mean by backend (sorry, I'm still
pretty new to this), but I think it's pangoxft. Running
pkg-config --list-all didn't show anything of interest,
but pkg-config --modversion xft found a version 2 so I'm
guessing that's what it's using?

Brooke


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


RE: Slow Rendering?

2003-11-20 Thread Dennie, Brooke
Hi,

> -Original Message-
> From: Sven Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 20, 2003 10:30 AM
> To: Dennie, Brooke
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Slow Rendering?
> 
> 
> Hi,
> 
> Sven Neumann <[EMAIL PROTECTED]> writes:
> 
> > Unless you set GDK_ENABLE_XFT to 0 explicitely, you are using the
> > PangoXft backend then. Font configuration is done using fontconfig.
> > Please check the fontconfig user documentation at
> > 
> >  http://pdx.freedesktop.org/~fontconfig/fontconfig-user.html
> 
> Sorry, I confused your answer with another thread where a user was
> asking for information about font configuration.
> 

Oh good, I was beginning to wonder if I'd suddenly lost my
mind...

> The answer to your question about speed issues on remote displays is
> that you could try to use X11 core fonts by setting the environment
> variable GDK_ENABLE_XFT to 0. This would disable antialiased fonts
> which are likely causing your speed issues. Does your X-Server
> implement the RENDER extension?
> 

Hrmm. Setting the variable didn't seem to make much of a 
difference. The application now takes ~12s, but popups sped 
up to ~3s

RENDER isn't implemented as far as I know since I get to see
the "extension RENDER missing" error every time I run my 
program :D

Any other ideas? Thanks again!

Brooke

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


RE: Slow Rendering?

2003-11-21 Thread Dennie, Brooke
Hi

> -Original Message-
> From: Tony Denault [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 20, 2003 10:20 PM
> To: Dennie, Brooke
> Cc: 'Sven Neumann'; '[EMAIL PROTECTED]'
> Subject: RE: Slow Rendering?



> My initial test using pango caused the timer function to
> take >270 ms (over 1000x slower). After picking up the 
> maillist thread, I
> decide to experiment using different font as I though PANGO might
> be rendering everything and sending images to the X11 client windows.
> Here is a table of different fonts using Pango;
> 
> Font   Pango PangoGDK_ENABLE_XFT=0   size
> --
> San 8  270   250 7x15
> Serif 10   360   362 8x19
> miscFixed  9   6.8   6.7 6x14
> miscFixed 10   6.9   6.8 9x15
> console8x166.9   6.8 8x16
> Courier 10 372   372 9x18
> Fixed  6.8   6.9 9x15
> LucidaTyperwriter 9361   361 8x17
> 
> Also note the Pango time varies widely, for example the
> 360 ms can jump about upto 700ms. I wrote the 'best' time
> for the table.
> 

That's interesting. I hadn't thought of that actually. Some of
my problem could be in the type of font. I'm never given an
xfd, but rather I'm handed an XFontStruct. What I've been 
doing is just creating an empty font description, then 
calling XGetFontProperty on the XFontStruct and pulling all of
the values I need for the font description out of it and
filling those in.


> GDK_ENABLE_XFT=0 help a little (sometimes).
> For me picking a better font will help. 6.8 ms is OK, but I would
> like better -> This is still 25x slower that gdk_font_load().
> 

Not really an option due to the nature of the project...


> My GTK app runs on a linux box running Fedora Core release 
> 0.94 (Severn).
> I am displaying on a XP computer running X-Win32 X11 server.
> 
> Running the app directly on the linux console improves things somewhat
> (ie: 6.8ms -> 4.8ms).
> 

Also not an option...


> Tony
> 
> /-
> --\
> | Tony Denault | Email: 
> [EMAIL PROTECTED] |
> | Institute for Astronomy  |  Phone: 
> (808) 932-2378 |
> | 640 North Aohoku Place   |Fax: 
> (808) 933-0737 |
> | Hilo, Hawaii 96720   |  
>   |
> \-
> --/
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Slow Rendering?

2003-11-21 Thread Dennie, Brooke
Hi,

> -Original Message-
> From: Sven Neumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 21, 2003 6:14 AM
> To: Dennie, Brooke
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Slow Rendering?
> 
> 
> Hi,
> 
> "Dennie, Brooke" <[EMAIL PROTECTED]> writes:
> 
> > Hrmm. Setting the variable didn't seem to make much of a 
> > difference. The application now takes ~12s, but popups sped 
> > up to ~3s
> > 
> > RENDER isn't implemented as far as I know since I get to see
> > the "extension RENDER missing" error every time I run my 
> > program :D
> > 
> > Any other ideas? Thanks again!
> 
> Two more things that can cause long startup times are (a) not using
> fc-cache and 

Can't say that I'm familiar with that. Looks like I need to
do some research...

> (b) having extended input devices configured but not
> connected.
> 
> 

Thanks again for all your help! Hopefully one of these will
work out

Brooke

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


RE: Slow Rendering?

2003-11-21 Thread Dennie, Brooke
Hi,

> -Original Message-
> From: Brett Granger [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 21, 2003 9:47 AM
> To: Dennie, Brooke
> Cc: 'Sven Neumann'; '[EMAIL PROTECTED]'
> Subject: Re: Slow Rendering?
> 
> 
> 
> A quick grep of the source code (gdk/x11/gdkpango-x11.c) 
> shows that the 
> environment variable you really want is GDK_USE_XFT, not 
> GDK_ENABLE_XFT. 
>   I don't know whether that will make any difference to what you're 
> seeing, but it can't hurt to try.
> 
> --Brett
> 
> 

Well, that definitely made a difference. Unfortunately, it
wasn't for the better :) Thanks for the correction,
though.

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


Strange font display

2004-02-02 Thread Dennie, Brooke
Hi all,

I'm not sure if this is a gtk, gnome, or messed up system in 
general problem, but any pointers at all would be greatly
appreciated!

I'm working with getting the chars of an iso8859-1 font to display
in any of the text widgets. I've gotten all of them working by
using g_convert, EXCEPT for one. For some reason the 0xa0
character (an alpha in this font) appears as a blank space. Is 
there something special about this particular value? I had 
initially thought that it was related to the "hole" that you
generally see in fonts from 0x7f-0xa0, but all of the others in
this range are displaying without a problem. Any ideas?

Thanks!

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


Why don't all chars display?

2004-02-09 Thread Dennie, Brooke
Hi everyone,

I've been working on getting an iso8859-1 font to display all of
its chars in an entry widget. For some reason I can't get 0xa0 to
display. Here's the code that I'm using:
-
char buff[2], *buff2;
GtkWidget *entry;
PangoFontDescription *pfd;

.

buff[0] = (char)0xa0;
buff[1] = '\0';

gtk_widget_modify_font(entry, pfd);

buff2 = g_convert(buff, -1, "UTF-8", "ISO8859-1", NULL, NULL,
NULL);
gtk_entry_set_text(GTK_ENTRY(entry), buff2);

.

-

It shows up as just a blank space (it should be a greek alpha). 
When I run this with any other value besides 0xa0, it works just
as I had expected. What am I doing wrong?

Thanks!

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


RE: Why don't all chars display?

2004-02-09 Thread Dennie, Brooke

Hmm. That's interesting. This font claims to be ISO8859-1 and 0xa0 
is definitely not a nbsp. I ran xfd on it and it displays as an
alpha there...


> -Original Message-
> From: Mark Leisher [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 09, 2004 2:08 PM
> To: '[EMAIL PROTECTED]'
> Subject: Re: Why don't all chars display?
> 
> 
> Dennie, Brooke wrote:
> > I've been working on getting an iso8859-1 font to display all of
> > its chars in an entry widget. For some reason I can't get 0xa0 to
> > display. Here's the code that I'm using:
> 
> In the ISO8859-1 character set 0xA0 is a non-breaking space, 
> not a Greek Alpha.
> -- 
> --
> -
> Mark Leisher
> Computing Research LabThe fury with which 
> untenable beliefs
> New Mexico State University   are defended is 
> inversely proportional
> Box 30001, Dept. 3CRL to their defensibility.
> Las Cruces, NM  88003   -- Richard Dawkins
> ___
> 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: Why don't all chars display?

2004-02-09 Thread Dennie, Brooke
I don't believe it is. It's called Key Courrier, but I wasn't able
to find a copy of it in any public area. 

I've previously only used it in OpenLook (under the same OS I'm
currently using) and never had any issues with it there, so your
assumption about pango could very well be right. I'll have to take
a look at the pango src and see if I can find something there.

Thanks!

Brooke

> -Original Message-
> From: Mark Leisher [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 09, 2004 4:08 PM
> To: '[EMAIL PROTECTED]'
> Subject: Re: Why don't all chars display?
> 
> 
> Dennie, Brooke wrote:
> > Hmm. That's interesting. This font claims to be ISO8859-1 and 0xa0 
> > is definitely not a nbsp. I ran xfd on it and it displays as an
> > alpha there...
> > 
> 
> This is just a guess because I haven't seen the code, but 
> Pango may be 
> handling known spaces in a special way.
> 
> Is this a freely available font that we might look at?
> -- 
> --
> -
> Mark Leisher
> Computing Research LabThe fury with which 
> untenable beliefs
> New Mexico State University   are defended is 
> inversely proportional
> Box 30001, Dept. 3CRL to their defensibility.
> Las Cruces, NM  88003   -- Richard Dawkins
> ___
> 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


Colormap issues

2004-02-24 Thread Dennie, Brooke
Hi everyone,

I'm a little confused as to how the following code can produce the
output:

succeeded... 15736992 256

gdk_color_parse("green", &color);
if(gdk_colormap_alloc_color(colormap, &color, FALSE, TRUE))
  printf("succeeded... %d %d\n", color.pixel, colormap->size);


The pixel value is obviously causing a few problems later on when
I try to query the color. I had been under the impression that
the printf statement wouldn't be executed unless the pixel value
had been filled in. Is this not the case?

Thanks for any info!

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