mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
implement dialog to edit chat text
This commit is contained in:
parent
4ae58342da
commit
e069a268cd
1 changed files with 22 additions and 6 deletions
|
@ -24,13 +24,29 @@
|
||||||
gchar*
|
gchar*
|
||||||
gtkGetChatMessage( GtkAppGlobals* XP_UNUSED(globals) )
|
gtkGetChatMessage( GtkAppGlobals* XP_UNUSED(globals) )
|
||||||
{
|
{
|
||||||
/* GtkWidget* dlg = gtk_message_dialog_new( NULL, /\* parent *\/ */
|
gchar* result = NULL;
|
||||||
/* GTK_MESSAGE_QUESTION, */
|
GtkWidget* dialog = gtk_dialog_new_with_buttons( "message text", NULL, //GtkWindow *parent,
|
||||||
/* GTK_DIALOG_MODAL, */
|
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
/* buttons, "%s", message ); */
|
GTK_STOCK_OK,
|
||||||
|
GTK_RESPONSE_ACCEPT,
|
||||||
|
NULL );
|
||||||
|
|
||||||
gchar* msg = g_strdup( "Hello world" );
|
GtkWidget* entry = gtk_entry_new();
|
||||||
return msg;
|
|
||||||
|
gtk_container_add( GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG (dialog))),
|
||||||
|
entry );
|
||||||
|
gtk_widget_show_all( dialog );
|
||||||
|
gtk_dialog_run( GTK_DIALOG (dialog) );
|
||||||
|
|
||||||
|
const char* text = gtk_entry_get_text( GTK_ENTRY(entry) );
|
||||||
|
|
||||||
|
if ( 0 != text[0] ) {
|
||||||
|
result = g_strdup( text );
|
||||||
|
}
|
||||||
|
gtk_widget_destroy (dialog);
|
||||||
|
|
||||||
|
LOG_RETURNF( "%s", result );
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue