From: Detlef R. <det...@gm...> - 2014-05-19 15:58:08
|
Hi, Am 19.05.2014 14:24, schrieb Kouhei Sutou: > Hi, > > In <537...@gm...> > "[ruby-gnome2-devel-en] disable widgets in print dialog" on Thu, 15 May 2014 05:45:57 +0200, > Detlef Reichl <det...@gm...> wrote: > >> I like to disable some of the settings in the print dialog, because in >> my program it is not useful to change them, i.e. the paper size. The >> dialog is created from Gtk::PrintOperation in the "run" method. Because >> I found no way, to come from this point to the print dialog widget I've >> tried to overwrite the initialize method of Gtk::PrintUnixDialog, >> connect i.e. to the configure signal, search for the widget and make it >> insensitive. But my initialize is never called. Is there any other way >> to get to this? > Could you show a sample program to reproduce the case? > > Hi, here is a simple example. From the appearing Dialog I want to disable or hide some of the settings on the second page (page setup). The reason why I want to disable some elements is, that I'm writing a label editor (see at https://github.com/detlefreichl/etti ). And for such a program it is really not useful if you i.e. can print double sided. Cheers, detlef #!/usr/bin/env ruby require 'gtk3' class Printer def initialize printOperation = Gtk::PrintOperation.new printOperation.n_pages = 1 printOperation.signal_connect('draw-page') do |widget, printContext, pageNumber| cc = printContext.cairo_context # drawing code end ret = printOperation.run :print_dialog end end printer = Printer.new Gtk.main |