Re: GtkPrintOperation; request for assistance

2017-02-09 Thread Eric Cashon via gtk-app-devel-list

 

Hi Norbert,

I hit the reply instead of reply all on the first send. Try again.

There is some information about printing at

https://developer.gnome.org/gtkmm-tutorial/stable/chapter-printing.html.en

It is in C++ but the C++ tutorial is very good. Sometimes I go there to figure 
out how to do something and translate it to C.

For a simple printing example in C this is my try at it. 

https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/print_buffer1.c

Change the font size and see if it fits the numbers on the different pages.

Eric

 

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


Re: Identifying monitors

2017-02-09 Thread Norbert de Jonge
> I save preferences per monitor

I think giving us more context might be useful. What kind of things do
you save per monitor, and why? These are not things you could recreate
by scaling and positioning based on detected monitor dimensions?

If we're assuming monitors can be arbitrarily plugged in and out, and
detection is unreliable or users may even have unidentifiable monitors,
no function will ever help you. If this is not a cross-platform
application and you _really_ need to recognize monitors, your program
could make a system call to "xrandr --prop" and compare EDID strings.

If you save a collection of settings per monitor, maybe your application
should a) by default, assume the setup is unchanged, and b) allow users
to specify which collection of settings should be attached to which
monitor (location) if they decide to modify their setup.

If you have a broad range of users, all GTK+ 3.22 and newer functions,
including both gdk_monitor_get_model() and gdk_display_get_monitor(),
may be problematic. My reasoning is that Ubuntu Xenial (and thus Mint
Sarah, Mint Serena, and various others) provides 3.18.9 to users:
http://packages.ubuntu.com/search?keywords=libgtk-3-dev&searchon=names&suite=xenial§ion=all
All these users would need to manually compile GTK+ 3.22 or newer,
including all the dependencies it needs.

If we know what is the application's intended behavior that is causing
you explore saving settings per monitor, we may be able to offer
alternative solutions.

Best regards,
Norbert
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Identifying monitors

2017-02-09 Thread zahlenmeer
I am rephrasing my question from a few weeks ago to hopefully be more
precise this time to get an answer:
I save preferences per monitor and I want to load the matching settings
for each monitor at application startup. However, I do not know how to
reliably identify which plugged monitor matches which preferences
section. It is tempting to use gdk_monitor_get_model. But this function
has at least two drawbacks: It is not guaranteed that each monitor has a
model, and it is not guaranteed that the returned string is unique.
Using the index in gdk_display_get_monitor to identify a monitor is also
not a promising idea because one can arbitrarily plug in and out
monitors in different orders.
So what could/should I do?

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