• import ui import time from random import choice class myclass(): def __init__(self): #self.v = ui.load_view('UIwithOtherName.pyui') self.v = ui.load_view() self.v.present('sheet') self.v.name = 'goapp' self.intro() self.key() def intro(self): self.v['textfield1'].text = "The Guitar Oracle is listening." time.sleep(2) def key(self): self.v['textfield1'].text = "Good bye." myclass()
  • Or, to look at it in another way, you are resizing the contained Stepper, but not the containing View.

  • @niz whoops, i meant to type

    ui.View.__init__(self, *args, **kwargs)
  • @Phuket2 As I mentioned in other forum post I have added the example file position_img_shape_in_custom_view.py in textlayout repository.
    You can do a git pull if you have already got this.

    It is not just limited to pyui. We could use it in custom views for placement of various shapes and images. May be I will post an example later.

    This example illustrates using placement of images and shapes in custom view using textlayout module. The textlayout module is generic enough to use in other types of applications. Here is the portion of code illustrating the layout of images and shapes.

    Only one image or shape (element) is shown at a time and you can do a tap to change the current element.

    layout_text = ''' ******** i--***** |--***** **s--*** ******** ****s--* ******** ******** ''' ui_element_map = { 'i': ('image', Img), 's': ('shape', Shape) }
  • @dgm , nice short cuts. But normally your functions would return something rather than print. Or pprint. But you could turn this into a very functional class.

  • Thanks guys. Looks maybe its a storm in a teacup 😬 Personally I would have thought just for consistency and memorising, that the designer and the code creation would use the same defaults. Ok, created ui.Button basically does.
    Good to know about the button though. Explains why sometimes testing I get different results. Often getting the placements correct before populating them. Can you the impression that it is behaving erratically or that's something has changed when it's just the sequence in which you do things. Live and learn 👍

Internal error.

Oops! Looks like something went wrong!