Skip to content

Commit

Permalink
Added tutorial 2
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffHoogland committed Mar 12, 2015
1 parent 0d9fc48 commit 46b65ec
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tut2-weight-hints/ex3-weight.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import efl.elementary as elm
from efl.elementary.window import StandardWindow
from efl.elementary.button import Button
from efl.elementary.box import Box

from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL

class MainWindow(StandardWindow):
def __init__(self):
StandardWindow.__init__(self, "ex3", "Weight Example", size=(300, 400))
self.callback_delete_request_add(lambda o: elm.exit())

ourButton = Button(self)
ourButton.size_hint_weight = (0, 0)
ourButton.size_hint_align = FILL_BOTH
ourButton.text = "Button 1"
ourButton.show()

ourButton2 = Button(self)
ourButton2.size_hint_weight = EXPAND_BOTH
ourButton2.size_hint_align = FILL_BOTH
ourButton2.text = "Button 2"
ourButton2.show()

ourButton3 = Button(self)
ourButton3.size_hint_weight = (0, 0.5)
ourButton3.size_hint_align = FILL_BOTH
ourButton3.text = "Button 3"
ourButton3.show()

ourBox = Box(self)
ourBox.size_hint_weight = EXPAND_BOTH
ourBox.pack_end(ourButton)
ourBox.pack_end(ourButton2)
ourBox.pack_end(ourButton3)
ourBox.show()

self.resize_object_add(ourBox)

if __name__ == "__main__":
elm.init()
GUI = MainWindow()
GUI.show()
elm.run()
elm.shutdown()
Binary file added tut2-weight-hints/screenshots/example3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 46b65ec

Please sign in to comment.