PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/library/gtk_dialog.e

http://github.com/tybor/Liberty
Specman e | 735 lines | 207 code | 144 blank | 384 comment | 4 complexity | 8926cbb5049d0e0279a2e1f08f03c094 MD5 | raw file
  1indexing
  2	description: "GtkDialog -- Create popup windows."
  3	copyright: "[
  4					Copyright (C) 2006 eiffel-libraries team, GTK+ team
  5					
  6					This library is free software; you can redistribute it and/or
  7					modify it under the terms of the GNU Lesser General Public License
  8					as published by the Free Software Foundation; either version 2.1 of
  9					the License, or (at your option) any later version.
 10					
 11					This library is distributed in the hope that it will be useful, but
 12					WITHOUT ANY WARRANTY; without even the implied warranty of
 13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14					Lesser General Public License for more details.
 15
 16					You should have received a copy of the GNU Lesser General Public
 17					License along with this library; if not, write to the Free Software
 18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 19					02110-1301 USA
 20				]"
 21	date: "$Date:$"
 22	revision: "$Revision:$"
 23
 24class GTK_DIALOG
 25	-- Dialog boxes are a convenient way to prompt the user for a small amount of
 26	-- input, e.g. to display a message, ask a question, or anything else that
 27	-- does not require extensive effort on the user's part.
 28
 29	-- GTK+ treats a dialog as a window split vertically. The top section is a
 30	-- GtkVBox, and is where widgets such as a GtkLabel or a GtkEntry should be
 31	-- packed. The bottom area is known as the action_area. This is generally
 32	-- used for packing buttons into the dialog which may perform functions such
 33	-- as cancel, ok, or apply. The two areas are separated by a GtkHSeparator.
 34
 35	-- GtkDialog boxes are created with a call to `make' or
 36	-- gtk_dialog_new_with_buttons(). gtk_dialog_new_with_buttons() is
 37	-- recommended; it allows you to set the dialog title, some convenient flags,
 38	-- and add simple buttons.
 39
 40	-- If 'dialog' is a newly created dialog, the two primary
 41	-- areas of the window can be accessed as
 42	-- GTK_DIALOG(dialog)->vbox and
 43	-- GTK_DIALOG(dialog)->action_area, as can be seen from the
 44	-- example, below.
 45
 46	-- A 'modal' dialog (that is, one which freezes the rest of
 47	-- the application from user input), can be created by
 48	-- calling gtk_window_set_modal() on the dialog. Use the
 49	-- GTK_WINDOW() macro to cast the widget returned from
 50	-- gtk_dialog_new() into a GtkWindow. When using
 51	-- gtk_dialog_new_with_buttons() you can also pass the
 52	-- GTK_DIALOG_MODAL flag to make a dialog modal.
 53
 54	-- If you add buttons to GtkDialog using
 55	-- gtk_dialog_new_with_buttons(), gtk_dialog_add_button(),
 56	-- gtk_dialog_add_buttons(), or
 57	-- gtk_dialog_add_action_widget(), clicking the button will
 58	-- emit a signal called "response" with a response ID that
 59	-- you specified. GTK+ will never assign a meaning to
 60	-- positive response IDs; these are entirely
 61	-- user-defined. But for convenience, you can use the
 62	-- response IDs in the GtkResponseType enumeration (these all
 63	-- have values less than zero). If a dialog receives a delete
 64	-- event, the "response" signal will be emitted with a
 65	-- response ID of GTK_RESPONSE_DELETE_EVENT.
 66
 67	-- If you want to block waiting for a dialog to return before
 68	-- returning control flow to your code, you can call
 69	-- gtk_dialog_run(). This function enters a recursive main
 70	-- loop and waits for the user to respond to the dialog,
 71	-- returning the response ID corresponding to the button the
 72	-- user clicked.
 73
 74	-- For the simple dialog in the following example, in reality
 75	-- you'd probably use GtkMessageDialog to save yourself some
 76	-- effort. But you'd need to create the dialog contents
 77	-- manually if you had more than a simple message in the
 78	-- dialog.
 79
 80	-- Example 1. Simple GtkDialog usage.
 81
 82	-- /* Function to open a dialog box displaying the message provided. */
 83
 84	-- void quick_message (gchar *message) {
 85	
 86	--    GtkWidget *dialog, *label;
 87	
 88	--    /* Create the widgets */
 89	
 90	-- dialog = gtk_dialog_new_with_buttons ("Message",
 91	-- main_application_window, GTK_DIALOG_DESTROY_WITH_PARENT,
 92	-- GTK_STOCK_OK, GTK_RESPONSE_NONE, NULL); -- label =
 93	-- gtk_label_new (message);
 94	
 95	-- /* Ensure that the dialog box is destroyed when the user
 96	-- responds. */
 97	
 98	--    g_signal_connect_swapped (dialog,
 99	--                              "response", 
100	--                              G_CALLBACK (gtk_widget_destroy),
101	--                              dialog);
102
103	--    /* Add the label, and show everything we've added to the dialog. */
104	
105	--    gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
106	--                       label);
107	--    gtk_widget_show_all (dialog);
108	-- }
109
110inherit 
111	GTK_WINDOW 
112		redefine 
113			make, 
114			struct_size 
115		end
116	CLOSE_SIGNAL_RECEIVER
117
118insert
119	GTK_DIALOG_EXTERNALS
120	GTK_DIALOG_STRUCT
121	GTK_STOCK_ITEMS
122		-- GtkDialog implements AtkImplementorIface.	
123
124creation new, make, from_external_pointer
125
126feature {} -- Creation
127
128	make is
129			-- Creates a new dialog box. Widgets should not be packed
130			-- into this GtkWindow directly, but into the vbox and
131			-- action_area.
132		do
133			from_external_pointer (gtk_dialog_new)
134		end
135
136	new is
137		obsolete "use `make' instead."
138		do
139			make
140		end
141
142	
143	-- TODO: reimplement gtk_dialog_new_with_buttons () without variadic as with_buttons
144
145	-- GtkWidget* gtk_dialog_new_with_buttons (const gchar *title,
146	-- GtkWindow *parent, GtkDialogFlags flags, const gchar
147	-- *first_button_text, ...);
148
149	-- Creates a new GtkDialog with title title (or NULL for the
150	-- default title; see gtk_window_set_title()) and transient parent
151	-- parent (or NULL for none; see
152	-- gtk_window_set_transient_for()). The flags argument can be used
153	-- to make the dialog modal (GTK_DIALOG_MODAL) and/or to have it
154	-- destroyed along with its transient parent
155	-- (GTK_DIALOG_DESTROY_WITH_PARENT). After flags, button
156	-- text/response ID pairs should be listed, with a NULL pointer
157	-- ending the list. Button text can be either a stock ID such as
158	-- GTK_STOCK_OK, or some arbitrary text. A response ID can be any
159	-- positive number, or one of the values in the GtkResponseType
160	-- enumeration. If the user clicks one of these dialog buttons,
161	-- GtkDialog will emit the "response" signal with the corresponding
162	-- response ID. If a GtkDialog receives the "delete_event" signal,
163	-- it will emit "response" with a response ID of
164	-- GTK_RESPONSE_DELETE_EVENT. However, destroying a dialog does not
165	-- emit the "response" signal; so be careful relying on "response"
166	-- when using the GTK_DIALOG_DESTROY_WITH_PARENT flag. Buttons are
167	-- from left to right, so the first button in the list will be the
168	-- leftmost button in the dialog.
169
170	-- Here's a simple example:
171
172	--  GtkWidget *dialog = gtk_dialog_new_with_buttons ("My dialog",
173	--  main_app_window, GTK_DIALOG_MODAL |
174	--  GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
175	--  GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
176	
177	-- title : 	Title of the dialog, or NULL
178	-- parent : 	Transient parent of the dialog, or NULL
179	-- flags : 	from GtkDialogFlags
180	-- first_button_text : 	stock ID or text to go in first button, or NULL
181	-- ... : 	response ID for first button, then additional buttons, ending with NULL
182	-- Returns : 	a new GtkDialog
183
184feature -- Running dialog
185	run: INTEGER is
186			-- run the dialog until it emits the response signal, or is
187			-- destroyed. If the dialog is destroyed during the call to
188			-- run, it returns gtk_response_none. Otherwise, it returns
189			-- the response ID from the "response" signal
190			-- emission. Before entering the recursive main loop, run
191			-- calls show on the dialog for you. Note that you still need
192			-- to show any children of the dialog yourself. During run,
193			-- the default behavior of "delete_event" is disabled; if the
194			-- dialog receives "delete_event", it will not be destroyed
195			-- as windows usually are, and run will return
196			-- gtk_response_delete_event. Also, during run the dialog
197			-- will be modal. You can force run to return at any time by
198			-- calling emit_response to emit the "response" signal.
199		do
200			Result := gtk_dialog_run (handle)
201			
202			-- TODO: eiffelize this description and example
203			
204			-- Blocks in a recursive main loop until the dialog either
205			-- emits the response signal, or is destroyed. If the dialog
206			-- is destroyed during the call to gtk_dialog_run(),
207			-- gtk_dialog_returns GTK_RESPONSE_NONE. Otherwise, it
208			-- returns the response ID from the "response" signal
209			-- emission. Before entering the recursive main loop,
210			-- gtk_dialog_run() calls gtk_widget_show() on the dialog for
211			-- you. Note that you still need to show any children of the
212			-- dialog yourself.
213
214			-- During gtk_dialog_run(), the default behavior of
215			-- "delete_event" is disabled; if the dialog receives
216			-- "delete_event", it will not be destroyed as windows
217			-- usually are, and gtk_dialog_run() will return
218			-- GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run()
219			-- the dialog will be modal. You can force gtk_dialog_run()
220			-- to return at any time by calling gtk_dialog_response() to
221			-- emit the "response" signal. Destroying the dialog during
222			-- gtk_dialog_run() is a very bad idea, because your post-run
223			-- code won't know whether the dialog was destroyed or not.
224
225			-- After gtk_dialog_run() returns, you are responsible for
226			-- hiding or destroying the dialog if you wish to do so.
227
228			-- Typical usage of this function might be:
229
230			--   gint result = gtk_dialog_run (GTK_DIALOG (dialog));
231			--   switch (result)
232			--     {
233			--       case GTK_RESPONSE_ACCEPT:
234			--          do_application_specific_something ();
235			--          break;
236			--       default:
237			--          do_nothing_since_dialog_was_cancelled ();
238			--          break;
239			--     }
240			--   gtk_widget_destroy (dialog);
241
242			-- Note that even though the recursive main loop gives the
243			-- effect of a modal dialog (it prevents the user from
244			-- interacting with other windows in the same window group
245			-- while the dialog is run), callbacks such as timeouts, IO
246			-- channel watches, DND drops, etc, will be triggered during a
247			-- gtk_dialog_run() call.
248			
249			-- dialog : 	a GtkDialog
250			-- Returns : 	response ID
251		end
252
253	emit_response (a_response_id: INTEGER) is
254			-- Emits the "response" signal with the given response
255			-- ID. Used to indicate that the user has responded to the
256			-- dialog in some way; typically either you or `run' be
257			-- monitoring the "response" signal and take appropriate
258			-- action.
259		do
260			gtk_dialog_response (handle, a_response_id)
261		end
262
263	add_button (a_button_text: STRING; a_response_id: INTEGER) is
264			-- Adds a button with the given text (or a stock button, if
265			-- `a_button_text' is a stock ID) and sets things up so that
266			-- clicking the button will emit the "response" signal with
267			-- the given `a_response_id'. The button is appended to the
268			-- end of the dialog's action area. The button widget is
269			-- returned, but usually you don't need it.
270
271			-- `a_button_text': text of button, or stock ID
272			
273			-- `a_response_id' : response ID for the button
274
275			-- TODO: store the button widget that was added somewhere
276		local unused_button_ptr: POINTER
277		do
278			unused_button_ptr := gtk_dialog_add_button (handle, a_button_text.to_external, a_response_id)
279		end
280
281	add_buttons (some_buttons: COLLECTION[TUPLE[STRING, INTEGER]]) is
282			-- Adds more buttons,  calling add_button repeatedly on each tupla of `some_buttons'.
283		require
284			buttons_not_void: some_buttons /= Void
285			-- valid_buttons:  some_buttons.for_all (agent (i:TUPLE[STRING, INTEGER]) i.item_1 /= Void
286		local
287			iterator: ITERATOR[TUPLE[STRING, INTEGER]];
288			a_text: STRING; an_id: INTEGER
289			--a_button: GTK_BUTTON
290		do
291			iterator:=some_buttons.get_new_iterator;
292			from iterator.start until iterator.is_off
293			loop
294				-- a_text:=iterator.item.item_1
295				-- an_id:=iterator.item.item_2 add_button (a_text, an_id)
296				add_button (iterator.item.item_1, iterator.item.item_2)
297				iterator.next
298			end
299		end
300
301	add_action_widget (a_widget: GTK_WIDGET; a_response_id: INTEGER) is
302			-- Adds an activatable widget to the action area of a
303			-- GtkDialog, connecting a signal handler that will emit the
304			-- "response" signal on the dialog when the widget is
305			-- activated. The widget is appended to the end of the
306			-- dialog's action area. If you want to add a non-activatable
307			-- widget, simply pack it into the action_area field of the
308			-- GtkDialog struct.
309		
310			-- `a_widget': an activatable widget
311		
312			-- `a_response_id' : response ID for child
313		require valid_widget: a_widget /= Void
314		do
315			gtk_dialog_add_action_widget (handle, a_widget.handle, a_response_id)
316		end
317
318feature -- Separator
319	has_separator: BOOLEAN is
320			-- Has the dialog a separator?
321		do
322			Result := gtk_dialog_get_has_separator (handle).to_boolean
323		end
324
325	set_has_separator is
326			-- Gives the dialog a separator above the buttons.
327		do
328			gtk_dialog_set_has_separator (handle, 1)
329		ensure has_separator_set: has_separator = True
330		end
331
332	unset_has_separator is
333			-- Remove the separator above the buttons.
334		do
335			gtk_dialog_set_has_separator (handle, 0)
336		ensure has_separator_unset: has_separator = False
337		end
338
339feature -- default response
340	
341	set_default_response (a_response_id: INTEGER) is
342			-- Sets the last widget in the dialog's action area with the
343			-- given `a_response_id' as the default widget for the
344			-- dialog. Pressing "Enter" normally activates the default
345			-- widget.
346		do
347			gtk_dialog_set_default_response (handle, a_response_id)
348		end
349	
350-- gtk_dialog_set_response_sensitive ()
351
352-- void        gtk_dialog_set_response_sensitive
353--                                             (GtkDialog *dialog,
354--                                              gint response_id,
355--                                              gboolean setting);
356
357-- Calls gtk_widget_set_sensitive (widget, setting) for each widget in
358-- the dialog's action area with the given response_id. A convenient way to
359-- sensitize/desensitize dialog buttons.
360
361-- dialog : 	a GtkDialog
362-- response_id : 	a response ID
363-- setting : 	TRUE for sensitive
364-- gtk_dialog_get_response_for_widget ()
365
366-- gint        gtk_dialog_get_response_for_widget
367--                                             (GtkDialog *dialog,
368--                                              GtkWidget *widget);
369
370-- Gets the response id of a widget in the action area of a dialog.
371
372-- dialog : 	a GtkDialog
373-- widget : 	a widget in the action area of dialog
374-- Returns : 	the response id of widget, or GTK_RESPONSE_NONE if widget doesn't have a response id set.
375
376-- Since 2.8
377-- gtk_alternative_dialog_button_order ()
378
379-- gboolean    gtk_alternative_dialog_button_order
380--                                             (GdkScreen *screen);
381
382-- Returns TRUE if dialogs are expected to use an alternative button order on the screen screen. See gtk_dialog_set_alternative_button_order() for more details about alternative button order.
383
384-- If you need to use this function, you should probably connect to the ::notify:gtk-alternative-button-order signal on the GtkSettings object associated to screen, in order to be notified if the button order setting changes.
385
386-- screen : 	a GdkScreen, or NULL to use the default screen
387-- Returns : 	Whether the alternative button order should be used
388
389-- Since 2.6
390-- gtk_dialog_set_alternative_button_order ()
391
392-- void        gtk_dialog_set_alternative_button_order
393--                                             (GtkDialog *dialog,
394--                                              gint first_response_id,
395--                                              ...);
396
397-- Sets an alternative button order. If the gtk-alternative-button-order setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids passed to this function.
398
399-- By default, GTK+ dialogs use the button order advocated by the Gnome Human Interface Guidelines with the affirmative button at the far right, and the cancel button left of it. But the builtin GTK+ dialogs and GtkMessageDialogs do provide an alternative button order, which is more suitable on some platforms, e.g. Windows.
400
401-- Use this function after adding all the buttons to your dialog, as the following example shows:
402
403-- cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
404--                                        GTK_STOCK_CANCEL,
405--                                        GTK_RESPONSE_CANCEL);
406 
407-- ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
408--                                    GTK_STOCK_OK,
409--                                    GTK_RESPONSE_OK);
410  
411-- gtk_widget_grab_default (ok_button);
412  
413-- help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
414--                                      GTK_STOCK_HELP,
415--                                      GTK_RESPONSE_HELP);
416 
417-- gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
418--                                          GTK_RESPONSE_OK,
419--                                          GTK_RESPONSE_CANCEL,
420--                                          GTK_RESPONSE_HELP,
421--                                          -1);
422
423-- dialog : 	a GtkDialog
424-- first_response_id : 	a response id used by one dialog's buttons
425-- ... : 	a list of more response ids of dialog's buttons, terminated by -1
426
427-- Since 2.6
428-- gtk_dialog_set_alternative_button_order_from_array ()
429
430-- void        gtk_dialog_set_alternative_button_order_from_array
431--                                             (GtkDialog *dialog,
432--                                              gint n_params,
433--                                              gint *new_order);
434
435-- Sets an alternative button order. If the gtk-alternative-button-order setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids in new_order.
436
437-- See gtk_dialog_set_alternative_button_order() for more information.
438
439-- This function is for use by language bindings.
440
441-- dialog : 	a GtkDialog
442-- n_params : 	the number of response ids in new_order
443-- new_order : 	an array of response ids of dialog's buttons
444
445-- Since 2.6
446-- Property Details
447-- The "has-separator" property
448
449--   "has-separator"        gboolean              : Read / Write
450
451-- The dialog has a separator bar above its buttons.
452
453-- Default value: TRUE
454-- Style Property Details
455-- The "action-area-border" style property
456
457--   "action-area-border"   gint                  : Read
458
459-- Width of border around the button area at the bottom of the dialog.
460
461-- Allowed values: >= 0
462
463-- Default value: 5
464-- The "button-spacing" style property
465
466--   "button-spacing"       gint                  : Read
467
468-- Spacing between buttons.
469
470-- Allowed values: >= 0
471
472-- Default value: 10
473-- The "content-area-border" style property
474
475--   "content-area-border"  gint                  : Read
476
477-- Width of border around the main dialog area.
478
479-- Allowed values: >= 0
480
481-- Default value: 2
482-- Signal Details
483-- The "close" signal
484
485-- void        user_function                  (GtkDialog *dialog,
486--                                             gpointer   user_data)      : Run last / Action
487
488-- dialog : 	the object which received the signal.
489-- user_data : 	user data set when the signal handler was connected.
490-- The "response" signal
491
492-- void        user_function                  (GtkDialog *dialog,
493--                                             gint       arg1,
494--                                             gpointer   user_data)      : Run last
495
496-- Emitted when an action widget is clicked, the dialog receives a
497-- delete event, or the application programmer calls gtk_dialog_response().
498-- On a delete event, the response ID is GTK_RESPONSE_NONE. Otherwise, it
499-- depends on which action widget was clicked.
500
501-- dialog : 	the object which received the signal.
502-- arg1 : 	the response ID
503-- user_data : 	user data set when the signal handler was connected.
504-- See Also
505
506-- GtkVBox 	
507
508-- Pack widgets vertically.
509-- GtkWindow 	
510
511-- Alter the properties of your dialog box.
512-- GtkButton 	
513
514-- Add them to the action_area to get a response from the user.
515
516feature -- From ewg implementation
517	feature -- Adding stock buttons
518
519	add_reject_button (a_label: STRING) is
520			-- Add a "reject" button with a_label. Stock response is used
521		require label_not_void: a_label /= Void
522		local a_widget: POINTER
523		do
524			a_widget := gtk_dialog_add_button (handle, a_label.to_external, gtk_response_reject)
525		end
526
527	add_accept_button (a_label: STRING) is
528			-- Add a "Accept" button. Stock item and response are used
529		require label_not_void: a_label /= Void
530		local a_widget: POINTER
531		do
532			a_widget := gtk_dialog_add_button (handle, a_label.to_external, gtk_response_accept)
533		end
534
535	add_ok_cancel_buttons is
536			-- Add both 'Ok' and 'Cancel' buttons
537		do
538			add_ok_button
539			add_cancel_button
540		end
541
542	add_ok_button is
543			-- Add a "Ok" button. Stock item and response are used
544		local a_widget: POINTER
545		do
546			a_widget := gtk_dialog_add_button (handle, gtk_stock_ok.to_external, gtk_response_ok)
547		end
548
549	add_cancel_button is
550			-- Add a "Cancel" button. Stock item and response are used
551		local a_widget: POINTER
552		do
553			a_widget := gtk_dialog_add_button (handle, gtk_stock_cancel.to_external, gtk_response_cancel)
554		end
555
556	add_close_button is
557			-- Add a "Close" button. Stock item and response are used
558		local a_widget: POINTER
559		do
560			a_widget := gtk_dialog_add_button (handle, gtk_stock_close.to_external, gtk_response_close)
561		end
562
563	add_yes_no_buttons is
564			-- Add both 'Yes' and 'No' buttons
565		do
566			add_yes_button
567			add_no_button
568		end
569
570	add_yes_button is
571			-- Add a "Yes" button. Stock item and response are used
572		local a_widget: POINTER
573		do
574			a_widget := gtk_dialog_add_button (handle, gtk_stock_yes.to_external, gtk_response_yes)
575		end
576
577	add_no_button is
578			-- Add a "No" button. Stock item and response are used
579		local a_widget: POINTER
580		do
581			a_widget := gtk_dialog_add_button (handle, gtk_stock_no.to_external, gtk_response_no)
582		end
583
584	add_apply_button is
585			-- Add a "Apply" button. Stock item and response are used
586		local a_widget: POINTER
587		do
588			a_widget := gtk_dialog_add_button (handle, gtk_stock_apply.to_external, gtk_response_apply)
589		end
590
591	add_help_button is
592			-- Add a "Help" button. Stock item and response are used
593		local a_widget: POINTER
594		do
595			a_widget := gtk_dialog_add_button (handle, gtk_stock_help.to_external, gtk_response_help)
596		end
597
598	-- TODO: wrap gtk_dialog_set_response_sensitive 
599	-- TODO: wrap gtk_alternative_dialog_button_order 
600	-- TODO: wrap gtk_dialog_set_alternative_button_order
601
602feature -- properties
603	
604	action_area_border: INTEGER is
605			-- Width of border around the button area at the bottom of
606			-- the dialog.
607		local value: G_VALUE
608		do
609			create value.make_integer
610			g_object_get_property (handle,action_area_border_property_name.to_external,value.handle)
611			Result := value.integer
612		ensure positive_result: Result >= 0
613		end
614
615	button_spacing: INTEGER is
616			-- Spacing between buttons.
617		local value: G_VALUE
618		do
619			create value.make_integer
620			g_object_get_property (handle, button_spacing_property_name.to_external,value.handle)
621			Result := value.integer
622		ensure positive_result: Result >= 0
623		end
624
625	content_area_border: INTEGER is
626			-- Width of border around the main dialog area.
627		local value: G_VALUE
628		do
629			create value.make_integer
630			g_object_get_property(handle, content_area_border_property_name.to_external,value.handle)
631			Result:=value.integer
632		ensure positive_result: Result >= 0
633		end
634
635feature -- Dialog's parts
636
637	vbox: GTK_VBOX is
638			-- main part of the dialog box
639		local
640			retriever: G_OBJECT_FACTORY [GTK_VBOX]
641		do
642			Result := retriever.existant_wrapper (get_vbox (handle))
643			if Result=Void then create Result.from_external_pointer (get_vbox(handle)) end
644		ensure
645			result_not_void: Result /= Void
646		end
647
648	action_area: GTK_HBOX is
649			--  bottom area of the dialog. Generally used for packing
650			--  buttons into the dialog which may perform functions such
651			--  as cancel, ok, or apply
652		local
653			retriever: G_OBJECT_EXPANDED_FACTORY [GTK_HBOX]
654		do
655			Result := retriever.existant_wrapper (get_action_area (handle)) 
656			if Result=Void then create Result.from_external_pointer (get_action_area(handle)) end
657			ensure result_bot_void: Result /= Void
658			end
659
660-- feature -- The "close" signal
661-- 	close_signal_name: STRING is "close"
662
663-- 	enable_on_close is
664-- 			-- Connects "close" signal to `on_close' feature.
665-- 		do
666-- 			connect (Current, close_signal_name, $on_close)
667-- 		end
668
669-- 	on_close is
670-- 			-- Built-in close signal handler; empty by design; redefine it.
671-- 		do
672-- 		end
673
674-- 	connect_agent_to_close_signal (a_procedure: PROCEDURE [ANY, TUPLE[GTK_DIALOG]]) is
675-- 		require
676-- 			valid_procedure: a_procedure /= Void
677-- 			wrapper_is_stored: is_eiffel_wrapper_stored
678-- 		local close_callback: CLOSE_CALLBACK
679-- 		do
680-- 			create close_callback.make
681-- 			close_callback.connect (Current, a_procedure)
682-- 		end
683
684-- 	content_area_border: INTEGER is
685-- 			-- Width of border around the main dialog area.
686-- 		local
687-- 			value: G_VALUE
688-- 		do
689-- 			create value.make_new_shared
690-- 			g_object_get_property (item,
691-- 										  content_area_border_property_name,
692-- 										  value.item)
693-- 			Result := value.integer
694-- 		ensure
695-- 			positive_result: Result >= 0
696-- 		end
697
698
699-- feature -- TODO: close signal
700-- 	-- connect_close_signal_receiver (a_receiver: GTK_CLOSE_SIGNAL_RECEIVER) is
701-- 	-- Connect `a_receiver' to the current widget
702-- 	--require
703-- 	--		a_receiver_not_void: a_receiver /= Void
704-- 	--		do
705-- 	--	connect_signal_receiver (a_receiver)
706-- 	--end
707
708-- feature -- TODO: response signals
709	
710-- 	-- connect_response_signal_receiver (a_receiver: GTK_RESPONSE_SIGNAL_RECEIVER) is
711-- 	-- Connect `a_receiver' to the current widget
712-- 	--	require
713-- 	-- a_receiver_not_void: a_receiver /= Void
714-- 	-- do
715-- 	-- connect_signal_receiver (a_receiver)
716-- 	-- end
717	
718-- feature {} -- Signals' names
719	
720-- 	action_area_border_property_name: STRING is "action-area-border"
721	
722-- 	button_spacing_property_name: STRING is "button-spacing"
723
724-- 	content_area_border_property_name: STRING is  "content-area-border"
725-- end
726feature {} -- property names strings
727	action_area_border_property_name: STRING is "action-area-border"
728	button_spacing_property_name: STRING is "button-spacing"
729	content_area_border_property_name: STRING is "content-area-border"
730feature -- size
731	struct_size: INTEGER is
732		external "C inline use <gtk/gtk.h>"
733		alias "sizeof(GtkDialog)"
734		end
735end