2017 Google Summer of Code - Port Cricket to use Toga, instead of Tkinter
After almost 4 months of work on Google Summer of Code 2017, finally I'm completing my proposal. Every widget migration and every commit/PR/issue/discussion with my mentors about Cricket , Toga and Rubicon-ObjC were detailed on the Issue 58.
"Eating your own dog food"¶
The best way to show that a product is reliable to the customers is use it. So, the way to show that Toga is an effective tool to build a GUI is to build a complete application using it.
Cricket is a graphical tool that helps you run your test suites. Its current version is implemented using
Results¶
The proposal focus not only on the port of
The work I did during GSoC were sent through the PR 65, reported on the Issue 58 and the final demonstration of the work can be seen in this link. There were widgets used on Cricket that weren't ready yet on Toga, so some improvements were necessary on Toga so that I could use them on Cricket. In summary here are some PRs and issues that I contributed to get my work done in Cricket:
Open PR that I sent to Toga:
- PR 201 : [Core][Cocoa] Refactoring of the Tree widget
Merged PRs that I sent to Toga:
- PR 112 : [Core][Cocoa] Enable/disable state for buttons, solved Issue 91
- PR 170 : [Cocoa] Content and retry status for stack trace dialog
- PR 172 : [Cocoa] Window resize
- PR 173 : [Core][Cocoa] Button color
- PR 174 : [Doc] Examples folder and button features example
- PR 178 : [Doc] Fix tutorial 2 setup
- PR 180 : [Doc] Update Toga widgets roadmap
- PR 182 : [Cocoa] Update the label of the Stack trace button for critical dialog
- PR 184 : [Core][Cocoa] Hide/show boxes widget
- PR 188 : [Cocoa] Fix error on
MultilineTextInputwidget, solved Issue 187 - PR 204 : [Core][Cocoa] Clear method to
MultilineTextInputwidget, solved Issue 203 - PR 206 : [Core][Cocoa] Read-only and placeholder for
MultilineTextInputwidget - PR 208 : [Cocoa] Fix apply style to a
SplitContainerwidget, solved Issue 207
Merged PR that I sent to Cricket:
Merged PR that I sent to rubicon-objc:
- PR 34 : [Doc] Add reference to
NSObject
Open issues that I sent to Toga:
- Issue 175 : [Core] Add more properties for Label and Font widgets
- Issue 176 : [Core] Add "rehint()" on the background of the widget after changing font size
- Issue 186 : [Core] Set initial position of the divisor of a
SplitContainer - Issue 197 : [Core] Get the id of the selected Tab View on the
OptionContainer
Closed issues that I reported to Toga:
- Issue 167 : [Cocoa] Addition of a
SplitContaineron a Box doesn't show theSplitContainer, was fixed by Russell Keith-Magee - Issue 168 : [Cocoa] Addition of 2 boxes on an
OptionContaineremits Rubicon's error, was fixed by Russell Keith-Magee - Issue 169 : [Cocoa] Addition of 2 empty boxes on an
OptionContaineremits error from Toga Cocoa platform, was fixed by Russell Keith-Magee - Issue 181 : [Core][Cocoa] "Hide" option for widgets, was solved by me
- Issue 187 : [Cocoa] Errors on
MultilineTextInput, was fixed by me - Issue 189 : [Cocoa]
ProgressBardoesn't appears in a Box, was fixed by JonasSchell - Issue 194 : [Cocoa] The frame of the
MultilineTextInputdoesn't appear, was fixed by Russell Keith-Magee - Issue 195 : [Cocoa]
ProgressBardoesn't appear inside of a Box oriented by row, was fixed by Russell Keith-Magee - Issue 196 : [Cocoa] Set max value and value on a
ProgressBardoesn't make any effect on the layout, was fixed by Russell Keith-Magee - Issue 203 : [Core][Cocoa] Clear text on
MultilineTextInputwidget, was solved by me - Issue 207 : [Cocoa] Set
SplitContainerheight doesn't update its size, was solved by me
Closed issues that I didn't reported but I solved on Toga:
Closed issue that I reported to Cricket:
- Issue 59 : Run selected doesn't count/ runs every test selected in a test module, was fixed by me
Open issue that I reported to rubicon-objc Jonas
- Issue 1 : Segfault when iterate through a
NSIndexSetusing block notation
Future Plans¶
There are some features on Cricket that I want to help develop in a near future, for example:
- A button to refresh all the tests tree
- Cricket settings
Also, there are some issues remained after this migration to Toga. These issues will be fixed on Toga widgets in a near future too, for example:
- A gap between the output and error boxes when there is no output message
- Run a test if the user click on it
I truly believe that Toga will be the official framework on Python to build GUI for multi-platform applications, so I'll continue to contribute to this project because I want to use in every application that I would need a GUI.
Final Considerations¶
I would like to truly thank my mentors Russell Keith-Magee and