Re: New to gnome-print, but stumbled on something I find odd



Hi Aaron,

what you are seeing is not a bug but just the result of missing
documentation:

gnome_print_config_get_double (config, GNOME_PRINT_KEY_PAPER_WIDTH, 
&physicalWidth );

sound like a useful tool but are not what you should be using. The
application is interested in the output of

gnome_print_config_get_page_size.

If you want to use GNOME_PRINT_KEY_PAPER_WIDTH you should be calling
gnome_print_config_get_length
which will give you both the value and the unit. These lengths may not
be stored in the unit you expect but the unit available at the time.

To explain what is happening: the  value with key
GNOME_PRINT_KEY_PAPER_WIDTH may in fact contain a string such as 8in or
8cm. When you are asking for a double you get 8 independent from the
unit. When the user changes the preferred unit that does not change the
values stored since if the user changes back you want the exact value
the user entered not just some approximation.

Good luck

Andreas



On Tue, 2003-12-09 at 09:53, Aaron Ballman wrote:
> I'm fairly new to the gnome-print libraries, but I ran into something 
> that just strikes me as incorrect.
> 
> I am using the gnome print dialog to display some UI for the user to 
> setup how they want things printed.  All is well and fine, but when I 
> go to query the GnomePrintConfig object I get back, I get some wonky 
> results.  More specifically, when I call 
> gnome_print_config_get_double( config, GNOME_PRINT_KEY_PAPER_WIDTH, 
> &physicalWidth );, most of the time I get back information in Points. 
> But, I have found that sometimes I get the information back in 
> Inches.  Here are the steps that I most often see this issue:
> 
> Open the dialog, hit Print button (which then dumps the results) and 
> I see the info in points.
> Open the dialog, change the paper tab's setting from Centimeters to 
> inches, hit Print button and see info in points.
> Open the dialog, change the paper tab's setting from A4 paper to US 
> Letter (Inches is still listed as the information type), hit print 
> button and see info in Inches.
> Open the dialog, hit print button (still set at US Letter and 
> Inches), and see info in Points.
> 
> This just strikes me as really weird.  I hesitate to call it a bug 
> due to my newness in working with Gnome-Print, but I'm certainly 
> confused.  Can someone confirm or deny (or explain) what I'm seeing?
> 
> FYI: system info is Gentoo Linux, 2.4.20 kernel.  Using libgnomeprint-2.2.1
> 
> Thanks!
> 
> ~Aaron
-- 
Andreas J. Guelzow <aguelzow taliesin ca>
Taliesin

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]