Codebase list sugar-pippy-activity / 33729a2
Fix GTK deprecation warnings in tutorials James Cameron 4 years ago
15 changed file(s) with 39 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
1313 def button_cb(widget):
1414 print('click')
1515
16 button = Gtk.Button('Button')
16 button = Gtk.Button(label='Button')
1717 fixed = Gtk.Fixed()
1818 fixed.put(button, 20, 30)
1919 button.connect('clicked', button_cb)
1414 grid.set_column_homogeneous(True)
1515 grid.set_row_homogeneous(True)
1616
17 button = Gtk.Button('Button 1')
17 button = Gtk.Button(label='Button 1')
1818 grid.attach(button, 0, 0, 1, 1)
1919
20 button = Gtk.Button('Button 2')
20 button = Gtk.Button(label='Button 2')
2121 grid.attach(button, 0, 2, 1, 2)
2222
23 button = Gtk.Button('Button 3')
23 button = Gtk.Button(label='Button 3')
2424 grid.attach(button, 1, 1, 2, 2)
2525
26 button = Gtk.Button('Button 4')
26 button = Gtk.Button(label='Button 4')
2727 grid.attach(button, 2, 0, 2, 1)
2828
29 button = Gtk.Button('Button 5')
29 button = Gtk.Button(label='Button 5')
3030 grid.attach(button, 3, 3, 3, 3)
3131
3232 self.add(grid)
1616 scrolled.add(vbox)
1717
1818 for x in range(1, 16):
19 boton = Gtk.Button('Button %d' % x)
19 boton = Gtk.Button(label='Button %d' % x)
2020 vbox.pack_start(boton, False, False, 1)
2121
2222 self.add(scrolled)
2323 box = Gtk.HBox()
2424 textview.add_child_at_anchor(box, anchor)
2525
26 button = Gtk.Button('Click me')
26 button = Gtk.Button(label='Click me')
2727 button.connect('clicked', self._clicked_cb, textbuffer)
2828 box.pack_start(button, False, False, 0)
2929
1818 menubar = Gtk.MenuBar()
1919 vbox.pack_start(menubar, False, False, 0)
2020
21 self.label = Gtk.Label('Activate a menu item')
21 self.label = Gtk.Label(label='Activate a menu item')
2222 vbox.pack_start(self.label, True, True, 0)
2323
2424 menu_file = Gtk.Menu()
102102 menu_edit.append(separator)
103103
104104 label = 'Vertical page'
105 item_vertical = Gtk.RadioMenuItem(label)
105 item_vertical = Gtk.RadioMenuItem(label=label)
106106 item_vertical.set_active(True)
107107 item_vertical.connect('toggled', self._toggled_cb, label)
108108 menu_edit.append(item_vertical)
126126
127127 menu_help = Gtk.Menu()
128128
129 item_help = Gtk.MenuItem('Ayuda')
129 item_help = Gtk.MenuItem(label='Ayuda')
130130 item_help.set_submenu(menu_help)
131131 menubar.append(item_help)
132132
2222 self.bar1.set_vexpand(True)
2323 grid.attach(self.bar1, 1, 0, 3, 1)
2424
25 label = Gtk.Label("Una barra de progreso simple")
25 label = Gtk.Label(label="Una barra de progreso simple")
2626 label.set_hexpand(True)
2727 grid.attach(label, 1, 1, 1, 1)
2828
3131 self.bar2.set_vexpand(True)
3232 grid.attach(self.bar2, 1, 2, 3, 1)
3333
34 label = Gtk.Label("Una barra de progreso con pulsos")
34 label = Gtk.Label(label="Una barra de progreso con pulsos")
3535 grid.attach(label, 1, 3, 1, 1)
3636
3737 GObject.timeout_add(200, self._update)
3434 palette_box = Gtk.VBox()
3535 palette.set_content(palette_box)
3636
37 checkbutton1 = Gtk.CheckButton('Option 1')
37 checkbutton1 = Gtk.CheckButton(label='Option 1')
3838 palette_box.pack_start(checkbutton1, False, False, 0)
3939
40 checkbutton2 = Gtk.CheckButton('Option 2')
40 checkbutton2 = Gtk.CheckButton(label='Option 2')
4141 palette_box.pack_start(checkbutton2, False, False, 0)
4242
43 checkbutton3 = Gtk.CheckButton('Option 3')
43 checkbutton3 = Gtk.CheckButton(label='Option 3')
4444 palette_box.pack_start(checkbutton3, False, False, 0)
4545
4646 separator = Gtk.VSeparator()
4747 palette_box.pack_start(separator, False, False, 0)
4848
49 radio_button1 = Gtk.RadioButton('Option 1')
49 radio_button1 = Gtk.RadioButton(label='Option 1')
5050 palette_box.pack_start(radio_button1, False, False, 0)
5151
52 radio_button2 = Gtk.RadioButton('Option 2', group=radio_button1)
52 radio_button2 = Gtk.RadioButton(label='Option 2', group=radio_button1)
5353 palette_box.pack_start(radio_button2, False, False, 0)
5454
55 radio_button3 = Gtk.RadioButton('Option 3', group=radio_button1)
55 radio_button3 = Gtk.RadioButton(label='Option 3', group=radio_button1)
5656 palette_box.pack_start(radio_button3, False, False, 0)
5757
5858 palette_box.show_all()
1212 def button_cb(widget):
1313 print('click')
1414
15 button = Gtk.Button("Boton")
15 button = Gtk.Button(label="Boton")
1616 fixed = Gtk.Fixed()
1717 fixed.put(button, 20, 30)
1818 button.connect('clicked', button_cb)
1414 grid.set_column_homogeneous(True)
1515 grid.set_row_homogeneous(True)
1616
17 button = Gtk.Button('Boton 1')
17 button = Gtk.Button(label='Boton 1')
1818 grid.attach(button, 0, 0, 1, 1)
1919
20 button = Gtk.Button('Boton 2')
20 button = Gtk.Button(label='Boton 2')
2121 grid.attach(button, 0, 2, 1, 2)
2222
23 button = Gtk.Button('Boton 3')
23 button = Gtk.Button(label='Boton 3')
2424 grid.attach(button, 1, 1, 2, 2)
2525
26 button = Gtk.Button('Boton 4')
26 button = Gtk.Button(label='Boton 4')
2727 grid.attach(button, 2, 0, 2, 1)
2828
29 button = Gtk.Button('Boton 5')
29 button = Gtk.Button(label='Boton 5')
3030 grid.attach(button, 3, 3, 3, 3)
3131
3232 self.add(grid)
1616 scrolled.add(vbox)
1717
1818 for x in range(1, 16):
19 boton = Gtk.Button('Boton %d' % x)
19 boton = Gtk.Button(label='Boton %d' % x)
2020 vbox.pack_start(boton, False, False, 1)
2121
2222 self.add(scrolled)
2323 box = Gtk.HBox()
2424 textview.add_child_at_anchor(box, anchor)
2525
26 button = Gtk.Button('Haz click en mi')
26 button = Gtk.Button(label='Haz click en mi')
2727 button.connect('clicked', self._clicked_cb, textbuffer)
2828 box.pack_start(button, False, False, 0)
2929
1818 menubar = Gtk.MenuBar()
1919 vbox.pack_start(menubar, False, False, 0)
2020
21 self.label = Gtk.Label('Activa un item del menu')
21 self.label = Gtk.Label(label='Activa un item del menu')
2222 vbox.pack_start(self.label, True, True, 0)
2323
2424 menu_file = Gtk.Menu()
102102 menu_edit.append(separator)
103103
104104 label = 'Pagina vertical'
105 item_vertical = Gtk.RadioMenuItem(label)
105 item_vertical = Gtk.RadioMenuItem(label=label)
106106 item_vertical.set_active(True)
107107 item_vertical.connect('toggled', self._toggled_cb, label)
108108 menu_edit.append(item_vertical)
126126
127127 menu_help = Gtk.Menu()
128128
129 item_help = Gtk.MenuItem('Ayuda')
129 item_help = Gtk.MenuItem(label='Ayuda')
130130 item_help.set_submenu(menu_help)
131131 menubar.append(item_help)
132132
2222 self.bar1.set_vexpand(True)
2323 grid.attach(self.bar1, 1, 0, 3, 1)
2424
25 label = Gtk.Label('Una barra de progreso simple')
25 label = Gtk.Label(label='Una barra de progreso simple')
2626 label.set_hexpand(True)
2727 grid.attach(label, 1, 1, 1, 1)
2828
3131 self.bar2.set_vexpand(True)
3232 grid.attach(self.bar2, 1, 2, 3, 1)
3333
34 label = Gtk.Label('Una barra de progreso con pulsos')
34 label = Gtk.Label(label='Una barra de progreso con pulsos')
3535 grid.attach(label, 1, 3, 1, 1)
3636
3737 GObject.timeout_add(200, self._update)
3434 palette_box = Gtk.VBox()
3535 palette.set_content(palette_box)
3636
37 checkbutton1 = Gtk.CheckButton('Opcion 1')
37 checkbutton1 = Gtk.CheckButton(label='Opcion 1')
3838 palette_box.pack_start(checkbutton1, False, False, 0)
3939
40 checkbutton2 = Gtk.CheckButton('Opcion 2')
40 checkbutton2 = Gtk.CheckButton(label='Opcion 2')
4141 palette_box.pack_start(checkbutton2, False, False, 0)
4242
43 checkbutton3 = Gtk.CheckButton('Opcion 3')
43 checkbutton3 = Gtk.CheckButton(label='Opcion 3')
4444 palette_box.pack_start(checkbutton3, False, False, 0)
4545
4646 separator = Gtk.VSeparator()
4747 palette_box.pack_start(separator, False, False, 0)
4848
49 radio_button1 = Gtk.RadioButton("Opcion 1")
49 radio_button1 = Gtk.RadioButton(label="Opcion 1")
5050 palette_box.pack_start(radio_button1, False, False, 0)
5151
52 radio_button2 = Gtk.RadioButton("Opcion 2", group=radio_button1)
52 radio_button2 = Gtk.RadioButton(label="Opcion 2", group=radio_button1)
5353 palette_box.pack_start(radio_button2, False, False, 0)
5454
55 radio_button3 = Gtk.RadioButton("Opcion 3", group=radio_button1)
55 radio_button3 = Gtk.RadioButton(label="Opcion 3", group=radio_button1)
5656 palette_box.pack_start(radio_button3, False, False, 0)
5757
5858 palette_box.show_all()
141141 entry = {"name": _(_file.capitalize()),
142142 "path": os.path.join(path, _file)}
143143
144 button = Gtk.Button(entry['name'])
144 button = Gtk.Button(label=entry['name'])
145145 button.set_tooltip_text(entry['path'])
146146 button.set_has_tooltip(False)
147147 button.connect('clicked', self._destroy, True)