From 24d07aa63eb77616a38ff178726d0f4a0908b7dc Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 7 Nov 2013 16:56:16 +0100 Subject: switch from gtk2 to gtk3 --- lib/Xconfig/resolution_and_depth.pm | 12 ++++++------ lib/Xconfig/test.pm | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/Xconfig') diff --git a/lib/Xconfig/resolution_and_depth.pm b/lib/Xconfig/resolution_and_depth.pm index 6b8ed66..06662ce 100644 --- a/lib/Xconfig/resolution_and_depth.pm +++ b/lib/Xconfig/resolution_and_depth.pm @@ -3,7 +3,7 @@ package Xconfig::resolution_and_depth; # $Id: resolution_and_depth.pm 250289 200 use diagnostics; use strict; # perl_checker: require MDK::Common -# perl_checker: require ugtk2 +# perl_checker: require ugtk3 use common; @@ -338,14 +338,14 @@ sub choose_gtk { #- $chosen_res must be one of @resolutions, so that it has a correct {ratio} field first($filter_on_res->(@resolutions)) || $resolutions[0]; - require ugtk2; - mygtk2->import; - ugtk2->import(qw(:create :helpers :wrappers)); - my $W = ugtk2->new(N("Resolution"), modal => 1); + require ugtk3; + mygtk3->import; + ugtk3->import(qw(:create :helpers :wrappers)); + my $W = ugtk3->new(N("Resolution"), modal => 1); my %monitor_images_x_res = do { my @l = qw(640 800 1024 1152 1280 1400 1600 1920 2048); - my %h = map { $_ => ugtk2::_find_imgfile("monitor-$_.png") } @l; + my %h = map { $_ => ugtk3::_find_imgfile("monitor-$_.png") } @l; #- for the other, use the biggest smaller foreach my $x_res (uniq map { $_->{X} } @resolutions) { diff --git a/lib/Xconfig/test.pm b/lib/Xconfig/test.pm index a1764b3..36b0e30 100644 --- a/lib/Xconfig/test.pm +++ b/lib/Xconfig/test.pm @@ -88,8 +88,8 @@ sub test { BEGIN { $::no_ugtk_init = 1 } BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' } require lang; - require ugtk2; #- help perl_checker - ugtk2->import(qw(:wrappers :helpers)); #- help perl_checker + require ugtk3; #- help perl_checker + ugtk3->import(qw(:wrappers :helpers)); #- help perl_checker use interactive::gtk; use run_program; use common; @@ -99,23 +99,23 @@ sub test { lang::bindtextdomain(); $ENV{DISPLAY} = ":9"; - Gtk2->init; + Gtk3->init; gtkset_background(200 * 257, 210 * 257, 210 * 257); - my $text = Gtk2::Label->new; + my $text = Gtk3::Label->new; my $time = 12; Glib::Timeout->add(1000, sub { $text->set(sprintf(translate("%s"), $time)); - $time-- or Gtk2->main_quit; + $time-- or Gtk3->main_quit; 1; }); eval { #- eval it so that missing pixmap will not break the test completely my $root = gtkroot(); - my $gc = Gtk2::Gdk::GC->new($root); - my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png"); + my $gc = Gtk3::Gdk::GC->new($root); + my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file("$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png"); my ($w, $h) = ($pixbuf->get_width, $pixbuf->get_height); - my $pixmap = Gtk2::Gdk::Pixmap->new($root, $w, $h, $root->get_depth); + my $pixmap = Gtk3::Gdk::Pixmap->new($root, $w, $h, $root->get_depth); $pixbuf->render_to_drawable($pixmap, $gc, 0, 0, 0, 0, $w, $h, 'none', 0, 0); $root->set_back_pixmap($pixmap, 0); $root->clear; -- cgit v1.2.1