forked from Miroirs/x49gp
fix last deprecated code
Thanks https://stackoverflow.com/questions/70655268/drawing-to-gtk-gdk-drawing-area-with-cairo#70658500
This commit is contained in:
parent
1f118799db
commit
2a586e0449
1 changed files with 3 additions and 7 deletions
|
@ -1148,10 +1148,8 @@ static gboolean react_to_focus_lost( GtkWidget* widget, GdkEventFocus* event, gp
|
||||||
|
|
||||||
static void ui_open_file_dialog( x49gp_t* x49gp, const char* prompt, GtkFileChooserAction action, char** filename )
|
static void ui_open_file_dialog( x49gp_t* x49gp, const char* prompt, GtkFileChooserAction action, char** filename )
|
||||||
{
|
{
|
||||||
GtkWidget* dialog;
|
|
||||||
x49gp_ui_t* ui = x49gp->ui;
|
x49gp_ui_t* ui = x49gp->ui;
|
||||||
|
GtkWidget* dialog = gtk_file_chooser_dialog_new( prompt, GTK_WINDOW( ui->window ), action, "_Cancel", GTK_RESPONSE_CANCEL, "_Open",
|
||||||
dialog = gtk_file_chooser_dialog_new( prompt, GTK_WINDOW( ui->window ), action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
|
|
||||||
GTK_RESPONSE_ACCEPT, NULL );
|
GTK_RESPONSE_ACCEPT, NULL );
|
||||||
|
|
||||||
gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( dialog ), true );
|
gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( dialog ), true );
|
||||||
|
@ -1510,15 +1508,13 @@ static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int redraw_lcd( GtkWidget* widget, GdkEventExpose* event, gpointer user_data )
|
static int redraw_lcd( GtkWidget* widget, cairo_t* cr, gpointer user_data )
|
||||||
{
|
{
|
||||||
x49gp_t* x49gp = user_data;
|
x49gp_t* x49gp = user_data;
|
||||||
x49gp_ui_t* ui = x49gp->ui;
|
x49gp_ui_t* ui = x49gp->ui;
|
||||||
|
|
||||||
cairo_t* cr = gdk_cairo_create( gtk_widget_get_window( widget ) );
|
|
||||||
cairo_set_source_surface( cr, ui->lcd_surface, 0, 0 );
|
cairo_set_source_surface( cr, ui->lcd_surface, 0, 0 );
|
||||||
cairo_paint( cr );
|
cairo_paint( cr );
|
||||||
cairo_destroy( cr );
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue