Commit 884c8b73 authored by Claes Sjofors's avatar Claes Sjofors

Ge, title was not UTF8, and title changed when new graph is opened

parent eb1d18e6
...@@ -145,7 +145,9 @@ void GeGtk::subgraphs_new() ...@@ -145,7 +145,9 @@ void GeGtk::subgraphs_new()
void GeGtk::set_title( char *title) void GeGtk::set_title( char *title)
{ {
gtk_window_set_title( GTK_WINDOW(toplevel), title); char *titleutf8 = g_convert( title, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
gtk_window_set_title( GTK_WINDOW(toplevel), titleutf8);
g_free( titleutf8);
} }
void GeGtk::open_input_dialog( const char *text, const char *title, void GeGtk::open_input_dialog( const char *text, const char *title,
...@@ -1748,12 +1750,16 @@ GeGtk::GeGtk( void *x_parent_ctx, ...@@ -1748,12 +1750,16 @@ GeGtk::GeGtk( void *x_parent_ctx,
strcat( title, tmp_name); strcat( title, tmp_name);
} }
char *titleutf8 = g_convert( title, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW, toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", window_height, "default-height", window_height,
"default-width", window_width, "default-width", window_width,
"title", title, "title", titleutf8,
NULL); NULL);
g_free( titleutf8);
g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this); g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this);
g_signal_connect( toplevel, "destroy", G_CALLBACK(destroy_event), this); g_signal_connect( toplevel, "destroy", G_CALLBACK(destroy_event), this);
g_signal_connect( toplevel, "focus-in-event", G_CALLBACK(ge_action_inputfocus), this); g_signal_connect( toplevel, "focus-in-event", G_CALLBACK(ge_action_inputfocus), this);
...@@ -3495,4 +3501,4 @@ GeGtk::GeGtk( void *x_parent_ctx, ...@@ -3495,4 +3501,4 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_type_routed), TRUE); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_type_routed), TRUE);
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_round_amount_2), TRUE ); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_round_amount_2), TRUE );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_corners_rounded), TRUE ); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(cons_corners_rounded), TRUE );
} }
\ No newline at end of file
...@@ -1559,6 +1559,7 @@ void Ge::activate_graph_attr() ...@@ -1559,6 +1559,7 @@ void Ge::activate_graph_attr()
void Ge::open_list_cb( void *ctx, char *text, int ok_pressed) void Ge::open_list_cb( void *ctx, char *text, int ok_pressed)
{ {
((Ge *)ctx)->open_graph( text); ((Ge *)ctx)->open_graph( text);
((Ge *)ctx)->set_title();
if ( ok_pressed) if ( ok_pressed)
((Ge *)ctx)->open_dialog = 0; ((Ge *)ctx)->open_dialog = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment