gtk_print confusion

2009-02-12 Thread Dan McMahill

Hello,

I recently added printing support to a program I've written and I'm 
using gtkPrint for it.  My hardcopy output is fairly simple.  It is a 
single page with a header across the top, a footer across the bottom and 
some simple figures (drawn with cairo) and text (via pango) on the page.


The problem I'm having is when I print under NetBSD my header is cut 
off.  It looks like maybe an inch or more is missing.


When I build my program under win32, I get the correct height but the 
right hand side of my page is cut off.


This all leads me to think that I am somehow confused about units, 
margins, and perhaps others.


My basic sequence is

operation = gtk_print_operation_new();
gtk_print_operation_set_use_full_page (operation, FALSE);

/* is a point here a postscript point, i.e. 72 per inch? */
gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);

later in my callback I have

cr = gtk_print_context_get_cairo_context (context);
width = gtk_print_context_get_width (context);
height = gtk_print_context_get_height (context);

at this point is it true that cairo_move_to (cr, 0, 0) should position 
me at the top left corner of my imagable area?  Is it also true that 
cairo_move_to (cr, width, height) will position me at the bottom right 
corner of my imagable area?  How does it know what paper size I've 
picked?  Maybe this is the ultimate source of my problems?



When I do things like

layout = gtk_print_context_create_pango_layout (context);

and set the markup and then do

pango_layout_get_pixel_size (layout, &text_width, &text_height);

will I get back a width and height in the same units as what my cairo 
calls are taking?



The only other question I have is really more of a comment.  The way I'm 
taking data from my program and laying it out for printing is in a way 
where I don't know how many pages I might have until I actually render 
the pages.  This makes it tough to set the number of pages before 
printing each individual page.  Luckily I've dodged the issue because 
currently I only have enough output to use a single page but if someone 
used much smaller paper, that might not be true.  Is there a "standard" 
way of doing pagination?  Its almost like I need a way to run my 
'draw_page()' call back in a "paginate" mode where it doesn't actually 
produce output, but I can put up text and graphics, get there sizes and 
keep track of when I have filled a page.


Thanks much for any suggestions.
-Dan



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


how to get a selected filter to save

2009-02-12 Thread frederico schardong
Hello,

I need to get the filter selected by user on a saving file chooser.

How I do It??

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


Re: Date edit widget?

2009-02-12 Thread Marcos Gambeta

Rodrigo Miguel escreveu:

I'm looking something like that too, like this:
http://code.google.com/p/holly-gtk-widgets/wiki/HDateEditor but
without the time/clock options, only gtk_calendar.



Rodrigo,

The project HomeBank have one.

http://homebank.free.fr/

See the sources:

\homebank-4.0.2\homebank-4.0.2\src\gtkdateentry.c
\homebank-4.0.2\homebank-4.0.2\src\gtkdateentry.h

But the license is GPL.


Regards,
Marcos Antonio Gambeta
http://www.magsoftinfo.com.br/blog/

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


Re: Date edit widget?

2009-02-12 Thread Rodrigo Miguel
I'm looking something like that too, like this:
http://code.google.com/p/holly-gtk-widgets/wiki/HDateEditor but
without the time/clock options, only gtk_calendar.

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


Re: Date edit widget?

2009-02-12 Thread Martín Vales

Michael Cronenworth escribió:

 Original Message 
Subject: Date edit widget?
From: John Coppens 
To: gtk-app-devel-list@gnome.org
Date: 02/12/2009 12:13 PM

 > Once upon a time there used to be a gnome_date_edit widget. But 
with the

tendency to eliminate most of gnome ui things, I was looking what to use
if some GTK replacement existed instead.

I only found GtkCalendar - but I don't want an entire calendar on my
forms! Anyone know if there is some practical replacement for a date
(+time) editor?


Hi:
Perhaps you can use pimlico:
http://www.pimlico-project.org/

Regards.





GTK does not have a specialized widget like that. You will have to 
create it yourself.

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




--
Martín R. Vales,
Intergeo Tecnología (IGT)
El Escorial (Madrid)
Phone: +34 91 890 20 61
Fax+: 34 91 890 75 73
www.intergeotecnologia.com




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


Re: Date edit widget?

2009-02-12 Thread Michael Cronenworth

 Original Message 
Subject: Date edit widget?
From: John Coppens 
To: gtk-app-devel-list@gnome.org
Date: 02/12/2009 12:13 PM

 > Once upon a time there used to be a gnome_date_edit widget. But with the

tendency to eliminate most of gnome ui things, I was looking what to use
if some GTK replacement existed instead.

I only found GtkCalendar - but I don't want an entire calendar on my
forms! Anyone know if there is some practical replacement for a date
(+time) editor?



GTK does not have a specialized widget like that. You will have to 
create it yourself.

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


Date edit widget?

2009-02-12 Thread John Coppens
Hello people.

Once upon a time there used to be a gnome_date_edit widget. But with the
tendency to eliminate most of gnome ui things, I was looking what to use
if some GTK replacement existed instead.

I only found GtkCalendar - but I don't want an entire calendar on my
forms! Anyone know if there is some practical replacement for a date
(+time) editor?

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


Re: Strategy for furute programs?

2009-02-12 Thread John Coppens
On Thu, 12 Feb 2009 11:30:42 +0100
Murray Cumming  wrote:

> On Tue, 2009-02-10 at 18:43 -0200, John Coppens wrote:
> > Long time ago I wrote a program to manage my wife's pharmacy, and this
> > involves (among other things) several windows with many modifiable
> > widgets (checkbuttons, entries, spinbuttons, etc.)
> 
> I suspect that Glom would make this much simpler, if you like that kind
> of thing.
> http://www.glom.org/

Interesting... but even the 'sales pitch' on the first page doesn't
really give the impression that anything will be working soon.

Thanks for the hint, Murray!
John
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Strategy for furute programs?

2009-02-12 Thread Murray Cumming
On Tue, 2009-02-10 at 18:43 -0200, John Coppens wrote:
> Long time ago I wrote a program to manage my wife's pharmacy, and this
> involves (among other things) several windows with many modifiable
> widgets (checkbuttons, entries, spinbuttons, etc.)

I suspect that Glom would make this much simpler, if you like that kind
of thing.
http://www.glom.org/

-- 
Murray Cumming
murr...@murrayc.com
www.murrayc.com
www.openismus.com


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