From 540a3890f1cf18afb46dd523affe4a42f7fc6e01 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Mon, 19 Sep 2016 14:45:43 +0900 Subject: [PATCH] Refacto Window initialize code - Move from OnRealized to Constructor - Orignally we add initialize code into OnRealized method to reuse with Sub class(WidgetWindow) But, Initialized code only for elm-window, not Widget window, So move to Constructor of Window - To deprecate OnRealized method Change-Id: I7d4ddc8f04cdeb7e22acdd25d071e426a32a01e9 --- src/ElmSharp/ElmSharp/Window.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs index 6ce44d2..7f45245 100644 --- a/src/ElmSharp/ElmSharp/Window.cs +++ b/src/ElmSharp/ElmSharp/Window.cs @@ -46,6 +46,12 @@ namespace ElmSharp { Name = name; Realize(parent); + Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */); + + _deleteRequest = new Interop.SmartEvent(this, Handle, "delete,request"); + _rotationChanged = new Interop.SmartEvent(this, Handle, "wm,rotation,changed"); + _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty); + _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty); } protected Window() @@ -136,18 +142,6 @@ namespace ElmSharp Interop.Elementary.elm_win_resize_object_add(Handle, obj); } - protected override void OnRealized() - { - base.OnRealized(); - Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */); - - _deleteRequest = new Interop.SmartEvent(this, Handle, "delete,request"); - _rotationChanged = new Interop.SmartEvent(this, Handle, "wm,rotation,changed"); - - _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty); - _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty); - } - protected override IntPtr CreateHandle(EvasObject parent) { Interop.Elementary.elm_config_accel_preference_set("3d"); -- 2.7.4