Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-20 20:37:18 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-20 20:37:54 (GMT)
commit19edf2339a8480dd735820d76502a18f74353e3e (patch)
tree9b8654f92eddd10b24800bf0297366ab8af71e97
parent413bf51096979d1bc1d6c9f98eeb5553af32c7d5 (diff)
Fix the Quiz toolbar and fix constellation and star drawing.
-rwxr-xr-xConstellationsFlashCards.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/ConstellationsFlashCards.py b/ConstellationsFlashCards.py
index c17dfdd..70c02aa 100755
--- a/ConstellationsFlashCards.py
+++ b/ConstellationsFlashCards.py
@@ -92,6 +92,7 @@ from sugar3.activity.widgets import StopButton
from sugar3.activity.activity import get_bundle_path
from sugar3.graphics.toolbarbox import ToolbarButton
from sugar3.graphics.toolbarbox import ToolbarBox
+from sugar3.graphics.toolbutton import ToolButton
import logging
from gettext import gettext
@@ -129,8 +130,8 @@ figures = constellations.data
# controls on second menubar ("Quiz"):
labelq1 = Gtk.Label(_("Name"))
cbq1 = Gtk.ComboBoxText()
-buttonq1 = Gtk.Button(_("Tell me"))
-buttonq2 = Gtk.Button(_("Another"))
+buttonq1 = ToolButton(_("Tell me"))
+buttonq2 = ToolButton(_("Another"))
# controls on third menubar ("Results"):
containerr1 = Gtk.VBox()
labelr1 = Gtk.Label(_(" constellations seen."))
@@ -442,9 +443,11 @@ class ChartDisplay(Gtk.DrawingArea):
py2 = py2 + self.margin - 2 + self.yoffset
self.ctx.move_to(px1, py1)
self.ctx.line_to(px2, py2)
+ self.ctx.stroke()
def plot_star(self, px, py, starsize):
self.ctx.arc(px, py, starsize, 0, 360*64)
+ self.ctx.stroke()
def pick_constellation(self):
global seen
@@ -688,10 +691,19 @@ class ConstellationsFlashCards(activity.Activity):
# Quiz Toolbar
self.quiz_toolbar = Gtk.Toolbar()
- self.quiz_toolbar.add(labelq1)
- self.quiz_toolbar.add(cbq1)
- self.quiz_toolbar.add(buttonq1)
- self.quiz_toolbar.add(buttonq2)
+ label_container = Gtk.ToolItem()
+ label_container.add(labelq1)
+ label_container.show_all()
+ self.quiz_toolbar.insert(label_container, -1)
+ label_container = Gtk.ToolItem()
+ label_container.add(cbq1)
+ label_container.show_all()
+ self.quiz_toolbar.insert(label_container, -1)
+ label_container = Gtk.ToolItem()
+ label_container.add(cbq1)
+ label_container.show_all()
+ self.quiz_toolbar.insert(buttonq1, -1)
+ self.quiz_toolbar.insert(buttonq2, -1)
self.quiz_toolbar.show_all()
quiz_toolbar_button = ToolbarButton(