prepare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7)

The Gtk::Widget::modify_fs() API was removed in Gtkmm3 [1] and also
there is no direct replacement.  GParted uses this in one place.  So
instead use the C gtk_widget_modify_fg() version that is still present
in Gtk3.

This is just a temporary change to port GParted to Gtk3.  In future this
will be replaced as part of the switch from Gdk::Color to Gtk::RGBA,
since Gdk::Color was deprecated in Gtkmm 3.10 [2].

Reference:

[1] ee432e2190
    commit message "... Remove the modify_*() methods, ..."

[2] Gtkmm 3.10 Gdk::Color Class Reference
    https://developer.gnome.org/gtkmm/3.10/classGdk_1_1Color.html#details
        Deprecated:
        Use Gdk::RGBA instead.

Closes #7 - Port to Gtk3
This commit is contained in:
Luca Bacci 2018-08-09 09:41:09 +02:00 committed by Mike Fleetwood
parent 0d73ff83d9
commit 5379352766
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#include "Dialog_Rescue_Data.h"
#include "Partition.h"
#include <gtk/gtk.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/stock.h>
#include <gtkmm/checkbutton.h>
@ -67,7 +68,7 @@ void Dialog_Rescue_Data::draw_dialog()
Gtk::Label *inconsis_label=manage(Utils::mk_label(msg_label));
Gdk::Color c( "red" );
inconsis_label->modify_fg(Gtk::STATE_NORMAL, c );
gtk_widget_modify_fg(GTK_WIDGET(inconsis_label->gobj()), GTK_STATE_NORMAL, c.gobj());
this->get_vbox()->pack_end(*inconsis_label, Gtk::PACK_SHRINK, 5);
}
message->append("</b></big>");