meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
maemo:shared_code [2011/08/18 23:09]
grp4
maemo:shared_code [2011/08/18 23:19] (current)
grp4
Line 8: Line 8:
 http://www.pygtk.org/pygtk2tutorial/ http://www.pygtk.org/pygtk2tutorial/
  
-though every function in pygtk library does not work in maemo as developer were too lazy and didn't import them. like no scrollbar or slidebar exist in maemo.+though not every function in pygtk library does work in maemo as developer were too lazy and didn't import them. like no scrollbar or slidebar exist in maemo.
  
 +some examples
 +<code python examples.py>
 +            def main(self):
 +        # place where fin info about pygtk http://www.pygtk.org/pygtk2tutorial/
 +        win = hildon.StackableWindow()
 +     
 +        # Create and pack labels
 +        vbox = gtk.VBox(False, 10)
 +        hbox = gtk.HBox(False, 10)
 +     
 +        #interface.. buttons, labels ,... etc
 +        labelHeader = gtk.Label("MeHear")
 +        labelSubHeader = gtk.Label("voice amplifier")
 +     
 +#        buttonGTK1 = gtk.Button("Record")
 +#        buttonGTK1.connect("clicked", self.record_button_clicked, labelSubHeader)
 +     
 +        buttonGTK = gtk.ToggleButton("AMPlify")
 +        buttonGTK.connect("clicked", self.amplify_button_clicked, labelSubHeader)
 +        
 +        #a= gtk.CheckButton("check button 1")
 +        #hbox.pack_start(a, True, True, 0)
 +        
 +        #b= gtk.ToggleButton("check button 1")
 +        #hbox.pack_start(b, True, True, 0)
 +        
 +        #c = gtk.RadioButton(None, "radio button1")
 +        #hbox.pack_start(c, True, True, 0)
 +        
 +        #adjus = gtk.Adjustment(value=60, lower=0, upper=100, step_incr=1, page_incr=0, page_size=0)
 +        #d = gtk.SpinButton(adjustment= adjus, climb_rate=0.1, digits=5)
 +        #hbox.pack_start(d, True, True, 0)
 +        #hscrollbar = gtk.HSscrollbar(adjustment)
 +        
 +        #http://www.pygtk.org/pygtk2tutorial/sec-ComboWidget.html
 +        combo = gtk.Combo()
 +        combo.entry.set_text("text")
 +        slist = [ "String 1", "String 2", "String 3", "String 4" ]
 +        combo.set_popdown_strings(slist)
 +        hbox.pack_start(combo, True, True, 0)
 +        
 +        hbox.pack_start(buttonGTK, True, True, 0)
 +     
 +        vbox.pack_start(labelHeader, True, True, 0)
 +        vbox.pack_start(labelSubHeader, True, True, 0)
 +        vbox.pack_start(hbox, True, True, 0)
 +        
 +        
 +     
 +        # Add label's box to window
 +        win.add(vbox)
 +     
 +        win.connect("delete_event", gtk.main_quit)
 +     
 +        win.show_all()
 +     
 +        gtk.main()
 +</code>
  
 ===== Software playtrought ===== ===== Software playtrought =====