annotate Gui/mplayer/gtk/mb.c @ 7390:2357ee501582

fixed to comply with new loader
author alex
date Fri, 13 Sep 2002 21:55:55 +0000
parents 98bed9e12087
children e5dda05f9aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
1
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
2 #include "../../events.h"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
3 #include "../../../config.h"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
4 #include "../../../help_mp.h"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
5
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
6 #include "../pixmaps/error.xpm"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
7 #include "../pixmaps/warning.xpm"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
8
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
9 #include "../widgets.h"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
10 #include "mb.h"
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
11
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
12 GtkWidget * gtkMessageBoxText;
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
13 GtkWidget * MessageBox;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
14
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
15 int gtkVMessageBox = 0;
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
16
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
17 void ShowMessageBox( char * msg )
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
18 {
6898
138a7ff52a26 - fix fuckin' locale (?:)
pontscho
parents: 6854
diff changeset
19 if ( gtkVMessageBox ) { gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); }
138a7ff52a26 - fix fuckin' locale (?:)
pontscho
parents: 6854
diff changeset
20 MessageBox=create_MessageBox( 0 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
21 if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
22 }
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
23
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
24 static void on_Ok_released( GtkButton * button,gpointer user_data )
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6898
diff changeset
25 { gtkVMessageBox=0; gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); }
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
26
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
27 static void on_MessageBox_show( GtkButton * button,gpointer user_data )
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
28 { gtkVMessageBox=(int)user_data; }
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
29
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
30 GtkWidget * create_MessageBox( int type )
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
31 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
32 GtkWidget * MessageBox;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
33 GtkWidget * frame1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
34 GtkWidget * frame2;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
35 GtkWidget * frame3;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
36 GtkWidget * frame4;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
37 GtkWidget * vbox1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
38 GtkWidget * hbox1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
39 GtkWidget * hseparator1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
40 GtkWidget * hbuttonbox1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
41 GtkWidget * Ok;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
42 GtkAccelGroup * accel_group;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
43 GtkStyle * pixmapstyle;
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6146
diff changeset
44 GdkPixmap * pixmapwid;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
45 GdkBitmap * mask;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
46
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
47 accel_group=gtk_accel_group_new();
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
48
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
49 MessageBox=gtk_window_new( GTK_WINDOW_TOPLEVEL );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
50 gtk_widget_set_name( MessageBox,"MessageBox" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
51 gtk_object_set_data( GTK_OBJECT( MessageBox ),"MessageBox",MessageBox );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
52 gtk_widget_set_events( MessageBox,GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
53 gtk_window_set_title( GTK_WINDOW( MessageBox ),"MPlayer ..." );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
54 gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
55 gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
56 gtk_window_set_policy( GTK_WINDOW( MessageBox ),TRUE,TRUE,FALSE );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6159
diff changeset
57 gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),"Message","MPlayer" );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6159
diff changeset
58
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6159
diff changeset
59 gtk_widget_realize( MessageBox );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6159
diff changeset
60 gtkAddIcon( MessageBox );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
61
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
62 frame1=gtk_frame_new( NULL );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
63 gtk_widget_set_name( frame1,"frame1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
64 gtk_widget_ref( frame1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
65 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
66 gtk_widget_show( frame1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
67 gtk_container_add( GTK_CONTAINER( MessageBox ),frame1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
68 gtk_container_set_border_width( GTK_CONTAINER( frame1 ),1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
69 gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
70
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
71 frame2=gtk_frame_new( NULL );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
72 gtk_widget_set_name( frame2,"frame2" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
73 gtk_widget_ref( frame2 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
74 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
75 gtk_widget_show( frame2 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
76 gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
77 gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
78
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
79 frame3=gtk_frame_new( NULL );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
80 gtk_widget_set_name( frame3,"frame3" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
81 gtk_widget_ref( frame3 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
82 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
83 gtk_widget_show( frame3 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
84 gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
85 gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
86
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
87 frame4=gtk_frame_new( NULL );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
88 gtk_widget_set_name( frame4,"frame4" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
89 gtk_widget_ref( frame4 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
90 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
91 gtk_widget_show( frame4 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
92 gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
93 gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
94
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
95 vbox1=gtk_vbox_new( FALSE,0 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
96 gtk_widget_set_name( vbox1,"vbox1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
97 gtk_widget_ref( vbox1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
98 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
99 gtk_widget_show( vbox1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
100 gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
101
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
102 hbox1=gtk_hbox_new( FALSE,0 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
103 gtk_widget_set_name( hbox1,"hbox1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
104 gtk_widget_ref( hbox1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
105 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
106 gtk_widget_show( hbox1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
107 gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
108
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
109 pixmapstyle=gtk_widget_get_style( MessageBox );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
110
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
111 pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )warning_xpm );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
112 WarningPixmap=gtk_pixmap_new( pixmapwid,mask );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
113 pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )error_xpm );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
114 ErrorPixmap=gtk_pixmap_new( pixmapwid,mask );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
115
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
116 gtk_widget_set_name( WarningPixmap,"pixmap1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
117 gtk_widget_ref( WarningPixmap );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
118 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"pixmap1",WarningPixmap,(GtkDestroyNotify )gtk_widget_unref );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
119 gtk_widget_hide( WarningPixmap );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
120 gtk_box_pack_start( GTK_BOX( hbox1 ),WarningPixmap,FALSE,FALSE,0 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
121 gtk_widget_set_usize( WarningPixmap,55,-2 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
122
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
123 gtk_widget_set_name( ErrorPixmap,"pixmap1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
124 gtk_widget_ref( ErrorPixmap );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
125 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"pixmap1",ErrorPixmap,(GtkDestroyNotify )gtk_widget_unref );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
126 gtk_widget_hide( ErrorPixmap );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
127 gtk_box_pack_start( GTK_BOX( hbox1 ),ErrorPixmap,FALSE,FALSE,0 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
128 gtk_widget_set_usize( ErrorPixmap,55,-2 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
129
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
130 gtkMessageBoxText=gtk_label_new( "Text jol. Ha ezt megerted,akkor neked nagyon jo a magyar tudasod,te." );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
131 gtk_widget_set_name( gtkMessageBoxText,"gtkMessageBoxText" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
132 gtk_widget_ref( gtkMessageBoxText );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
133 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"gtkMessageBoxText",gtkMessageBoxText,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
134 gtk_widget_show( gtkMessageBoxText );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
135 gtk_box_pack_start( GTK_BOX( hbox1 ),gtkMessageBoxText,TRUE,TRUE,0 );
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6903
diff changeset
136 // gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL );
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6903
diff changeset
137 gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_CENTER );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
138 gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),FALSE );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
139
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
140 hseparator1=gtk_hseparator_new();
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
141 gtk_widget_set_name( hseparator1,"hseparator1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
142 gtk_widget_ref( hseparator1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
143 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
144 gtk_widget_show( hseparator1 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
145 gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
146 gtk_widget_set_usize( hseparator1,-2,9 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
147
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
148 hbuttonbox1=gtk_hbutton_box_new();
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
149 gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
150 gtk_widget_ref( hbuttonbox1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
151 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
152 gtk_widget_show( hbuttonbox1 );
3617
d435bda20a3e button design fix
pontscho
parents: 3597
diff changeset
153 gtk_widget_set_usize( hbuttonbox1,-2,25 );
d435bda20a3e button design fix
pontscho
parents: 3597
diff changeset
154 gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
155 gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
156
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
157 Ok=gtk_button_new_with_label( MSGTR_Ok );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
158 gtk_widget_set_name( Ok,MSGTR_Ok );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
159 gtk_widget_ref( Ok );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
160 gtk_object_set_data_full( GTK_OBJECT( MessageBox ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
161 gtk_widget_show( Ok );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
162 gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
163 gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
164 gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
165
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
166 gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy_event",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
167 gtk_signal_connect( GTK_OBJECT( MessageBox ),"show",GTK_SIGNAL_FUNC( on_MessageBox_show ),(void *)1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
168 gtk_signal_connect( GTK_OBJECT( MessageBox ),"hide",GTK_SIGNAL_FUNC( on_MessageBox_show ),0 );
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
169 gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
170
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 4818
diff changeset
171 gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
172
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
173 return MessageBox;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
174 }