A small exercise for a friend. Contain basic python operations, global variables, gtk interactions and a Glade windows UI file.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

window.ui 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Generated with glade 3.36.0 -->
  3. <interface>
  4. <requires lib="gtk+" version="3.22"/>
  5. <object class="GtkWindow" id="window1">
  6. <property name="can_focus">False</property>
  7. <property name="title" translatable="yes">Calculator</property>
  8. <signal name="destroy" handler="onDestroy" swapped="no"/>
  9. <child>
  10. <object class="GtkFixed" id="fixed">
  11. <property name="visible">True</property>
  12. <property name="can_focus">False</property>
  13. <child>
  14. <object class="GtkLabel" id="lblResult">
  15. <property name="name">lblDisplay</property>
  16. <property name="width_request">250</property>
  17. <property name="height_request">50</property>
  18. <property name="visible">True</property>
  19. <property name="can_focus">False</property>
  20. <property name="margin_start">15</property>
  21. <property name="margin_end">10</property>
  22. <property name="margin_top">15</property>
  23. <property name="margin_bottom">15</property>
  24. <property name="label" translatable="yes">0</property>
  25. <property name="justify">right</property>
  26. <property name="selectable">True</property>
  27. <attributes>
  28. <attribute name="style" value="normal"/>
  29. <attribute name="weight" value="heavy"/>
  30. <attribute name="scale" value="2"/>
  31. </attributes>
  32. </object>
  33. <packing>
  34. <property name="x">65</property>
  35. </packing>
  36. </child>
  37. <child>
  38. <object class="GtkGrid">
  39. <property name="width_request">300</property>
  40. <property name="height_request">280</property>
  41. <property name="visible">True</property>
  42. <property name="can_focus">False</property>
  43. <property name="margin_right">45</property>
  44. <property name="margin_start">15</property>
  45. <property name="margin_end">15</property>
  46. <property name="margin_bottom">15</property>
  47. <property name="row_spacing">5</property>
  48. <property name="column_spacing">5</property>
  49. <property name="row_homogeneous">True</property>
  50. <property name="column_homogeneous">True</property>
  51. <child>
  52. <object class="GtkButton" id="btn1">
  53. <property name="label" translatable="yes">1</property>
  54. <property name="visible">True</property>
  55. <property name="can_focus">True</property>
  56. <property name="receives_default">True</property>
  57. <signal name="clicked" handler="btn1_clicked_cb" swapped="no"/>
  58. </object>
  59. <packing>
  60. <property name="left_attach">0</property>
  61. <property name="top_attach">0</property>
  62. </packing>
  63. </child>
  64. <child>
  65. <object class="GtkButton" id="btn2">
  66. <property name="label" translatable="yes">2</property>
  67. <property name="visible">True</property>
  68. <property name="can_focus">True</property>
  69. <property name="receives_default">True</property>
  70. <signal name="clicked" handler="btn2_clicked_cb" swapped="no"/>
  71. </object>
  72. <packing>
  73. <property name="left_attach">1</property>
  74. <property name="top_attach">0</property>
  75. </packing>
  76. </child>
  77. <child>
  78. <object class="GtkButton" id="btn3">
  79. <property name="label" translatable="yes">3</property>
  80. <property name="visible">True</property>
  81. <property name="can_focus">True</property>
  82. <property name="receives_default">True</property>
  83. <signal name="clicked" handler="btn3_clicked_cb" swapped="no"/>
  84. </object>
  85. <packing>
  86. <property name="left_attach">2</property>
  87. <property name="top_attach">0</property>
  88. </packing>
  89. </child>
  90. <child>
  91. <object class="GtkButton" id="btnPlus">
  92. <property name="label" translatable="yes">+</property>
  93. <property name="visible">True</property>
  94. <property name="can_focus">True</property>
  95. <property name="receives_default">True</property>
  96. <signal name="clicked" handler="btnPlus_clicked_cb" swapped="no"/>
  97. </object>
  98. <packing>
  99. <property name="left_attach">3</property>
  100. <property name="top_attach">0</property>
  101. </packing>
  102. </child>
  103. <child>
  104. <object class="GtkButton" id="btn4">
  105. <property name="label" translatable="yes">4</property>
  106. <property name="visible">True</property>
  107. <property name="can_focus">True</property>
  108. <property name="receives_default">True</property>
  109. <signal name="clicked" handler="btn4_clicked_cb" swapped="no"/>
  110. </object>
  111. <packing>
  112. <property name="left_attach">0</property>
  113. <property name="top_attach">1</property>
  114. </packing>
  115. </child>
  116. <child>
  117. <object class="GtkButton" id="btn5">
  118. <property name="label" translatable="yes">5</property>
  119. <property name="visible">True</property>
  120. <property name="can_focus">True</property>
  121. <property name="receives_default">True</property>
  122. <signal name="clicked" handler="btn5_clicked_cb" swapped="no"/>
  123. </object>
  124. <packing>
  125. <property name="left_attach">1</property>
  126. <property name="top_attach">1</property>
  127. </packing>
  128. </child>
  129. <child>
  130. <object class="GtkButton" id="btn6">
  131. <property name="label" translatable="yes">6</property>
  132. <property name="visible">True</property>
  133. <property name="can_focus">True</property>
  134. <property name="receives_default">True</property>
  135. <signal name="clicked" handler="btn6_clicked_cb" swapped="no"/>
  136. </object>
  137. <packing>
  138. <property name="left_attach">2</property>
  139. <property name="top_attach">1</property>
  140. </packing>
  141. </child>
  142. <child>
  143. <object class="GtkButton" id="btnMinus">
  144. <property name="label" translatable="yes">-</property>
  145. <property name="visible">True</property>
  146. <property name="can_focus">True</property>
  147. <property name="receives_default">True</property>
  148. <signal name="clicked" handler="btnMinus_clicked_cb" swapped="no"/>
  149. </object>
  150. <packing>
  151. <property name="left_attach">3</property>
  152. <property name="top_attach">1</property>
  153. </packing>
  154. </child>
  155. <child>
  156. <object class="GtkButton" id="btn7">
  157. <property name="label" translatable="yes">7</property>
  158. <property name="visible">True</property>
  159. <property name="can_focus">True</property>
  160. <property name="receives_default">True</property>
  161. <signal name="clicked" handler="btn7_clicked_cb" swapped="no"/>
  162. </object>
  163. <packing>
  164. <property name="left_attach">0</property>
  165. <property name="top_attach">2</property>
  166. </packing>
  167. </child>
  168. <child>
  169. <object class="GtkButton" id="btn8">
  170. <property name="label" translatable="yes">8</property>
  171. <property name="visible">True</property>
  172. <property name="can_focus">True</property>
  173. <property name="receives_default">True</property>
  174. <signal name="clicked" handler="btn8_clicked_cb" swapped="no"/>
  175. </object>
  176. <packing>
  177. <property name="left_attach">1</property>
  178. <property name="top_attach">2</property>
  179. </packing>
  180. </child>
  181. <child>
  182. <object class="GtkButton" id="btn9">
  183. <property name="label" translatable="yes">9</property>
  184. <property name="visible">True</property>
  185. <property name="can_focus">True</property>
  186. <property name="receives_default">True</property>
  187. <signal name="clicked" handler="btn9_clicked_cb" swapped="no"/>
  188. </object>
  189. <packing>
  190. <property name="left_attach">2</property>
  191. <property name="top_attach">2</property>
  192. </packing>
  193. </child>
  194. <child>
  195. <object class="GtkButton" id="btnMultiple">
  196. <property name="label" translatable="yes">*</property>
  197. <property name="visible">True</property>
  198. <property name="can_focus">True</property>
  199. <property name="receives_default">True</property>
  200. <signal name="clicked" handler="btnMultiple_clicked_cb" swapped="no"/>
  201. </object>
  202. <packing>
  203. <property name="left_attach">3</property>
  204. <property name="top_attach">2</property>
  205. </packing>
  206. </child>
  207. <child>
  208. <object class="GtkButton" id="btnDivide">
  209. <property name="label" translatable="yes">/</property>
  210. <property name="visible">True</property>
  211. <property name="can_focus">True</property>
  212. <property name="receives_default">True</property>
  213. <signal name="clicked" handler="btnDivide_clicked_cb" swapped="no"/>
  214. </object>
  215. <packing>
  216. <property name="left_attach">3</property>
  217. <property name="top_attach">3</property>
  218. </packing>
  219. </child>
  220. <child>
  221. <object class="GtkButton" id="btnDo">
  222. <property name="label" translatable="yes">=</property>
  223. <property name="visible">True</property>
  224. <property name="can_focus">True</property>
  225. <property name="receives_default">True</property>
  226. <signal name="clicked" handler="btnDo_clicked_cb" swapped="no"/>
  227. <style>
  228. <class name="suggested-action"/>
  229. </style>
  230. </object>
  231. <packing>
  232. <property name="left_attach">2</property>
  233. <property name="top_attach">3</property>
  234. </packing>
  235. </child>
  236. <child>
  237. <object class="GtkButton" id="btn0">
  238. <property name="label" translatable="yes">0</property>
  239. <property name="visible">True</property>
  240. <property name="can_focus">True</property>
  241. <property name="receives_default">True</property>
  242. <signal name="clicked" handler="btn0_clicked_cb" swapped="no"/>
  243. </object>
  244. <packing>
  245. <property name="left_attach">1</property>
  246. <property name="top_attach">3</property>
  247. </packing>
  248. </child>
  249. <child>
  250. <object class="GtkButton" id="btnReset">
  251. <property name="label" translatable="yes">CE</property>
  252. <property name="visible">True</property>
  253. <property name="can_focus">True</property>
  254. <property name="receives_default">True</property>
  255. <signal name="clicked" handler="btnReset_clicked_cb" swapped="no"/>
  256. <style>
  257. <class name="destructive-action"/>
  258. </style>
  259. </object>
  260. <packing>
  261. <property name="left_attach">0</property>
  262. <property name="top_attach">3</property>
  263. </packing>
  264. </child>
  265. </object>
  266. <packing>
  267. <property name="y">80</property>
  268. </packing>
  269. </child>
  270. <child>
  271. <object class="GtkLabel" id="lblOperator">
  272. <property name="name">lblOperator</property>
  273. <property name="width_request">50</property>
  274. <property name="height_request">50</property>
  275. <property name="visible">True</property>
  276. <property name="can_focus">False</property>
  277. <property name="margin_start">15</property>
  278. <property name="margin_end">15</property>
  279. <property name="margin_top">15</property>
  280. <property name="margin_bottom">15</property>
  281. <property name="label" translatable="yes">#</property>
  282. <attributes>
  283. <attribute name="weight" value="ultraheavy"/>
  284. <attribute name="scale" value="1"/>
  285. </attributes>
  286. </object>
  287. </child>
  288. </object>
  289. </child>
  290. <child type="titlebar">
  291. <placeholder/>
  292. </child>
  293. </object>
  294. </interface>