a7acc6f38f8ed2ad4eee4042c5dc0876e43b0c7e
[nit.git] / examples / calculator / src / ios.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Aesthetic variation for iOS
16 module ios
17
18 import calculator
19 import ::ios
20
21 redef class CalculatorWindow
22 init do title = "app.nit Calculator"
23 end
24
25 redef class TextInput
26 init do set_ios_style(native)
27
28 private fun set_ios_style(objc_text_field: UITextField)
29 in "ObjC" `{
30 objc_text_field.textAlignment = NSTextAlignmentCenter;
31 `}
32 end