omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. undefined

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 1
    • Controversial 0
    • Groups 0

    undefined

    @undefined

    1
    Reputation
    293
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    undefined Unfollow Follow

    Best posts made by undefined

    • RE: Colors for ListDataSource items

      Here's how I did it, probably not the right way... but eh, it works.

      Copy the ListDataSource class from ui.py standard Library to your site-packages directory.

      add this to the top of the new file

      from ui import *
      

      add this in def init

      self.background_color = None
      

      add this in def tableview_cell_for_row:

      cell.background_color = self.background_color
      

      Then just set TableView.datasource to the new ListDataSource instead of TableView.datasource = ui.ListDataSource

      import ui
      from ListDataSource import ListDataSource
      
      t = ui.TableView()
      t.background_color = 'black'
      t.tint_color = 'white'
      #l = ui.ListDataSource(['One', 'Two'])
      l = ListDataSource(['One', 'Two'])
      l.text_color = 'cyan'
      l.highlight_color = 'blue'
      l.background_color = 'red'
      l.tint_color = 'green'
      t.data_source = l
      t.present()
      
      posted in Pythonista
      undefined
      undefined

    Latest posts made by undefined

    • RE: Colors for ListDataSource items

      Here's how I did it, probably not the right way... but eh, it works.

      Copy the ListDataSource class from ui.py standard Library to your site-packages directory.

      add this to the top of the new file

      from ui import *
      

      add this in def init

      self.background_color = None
      

      add this in def tableview_cell_for_row:

      cell.background_color = self.background_color
      

      Then just set TableView.datasource to the new ListDataSource instead of TableView.datasource = ui.ListDataSource

      import ui
      from ListDataSource import ListDataSource
      
      t = ui.TableView()
      t.background_color = 'black'
      t.tint_color = 'white'
      #l = ui.ListDataSource(['One', 'Two'])
      l = ListDataSource(['One', 'Two'])
      l.text_color = 'cyan'
      l.highlight_color = 'blue'
      l.background_color = 'red'
      l.tint_color = 'green'
      t.data_source = l
      t.present()
      
      posted in Pythonista
      undefined
      undefined