A list of things to do. More info in the following sections.
_fallback()
.FALLBACK()
and _fallback()
after deprecation period..new(:native-object)
the native type should be tested against its proper type to match its Raku wrapper class.-rk()
subroutines in favor of coercing.N-xyz
(like in N-GObject) and TopLevelClassSupport
classes to coerce types.N-GObject()
in other repr('CPointer')
types.Remove property and signal examples in those sections and move it to tutorials.
Getting Started; simple examples.
Actions; button, menu, …
Applications; sceleton, commandline, multi instances.
Drag and drop.
Pango; Text control, use with Cairo and Gtk.
Theming and styling; style sheets in text, file or resource.
Threads; event loop, nest loops, context.
Gdk; lower level interaction.
Reorder the list of methods in all modules in such a way that they are sorted. This might be of use for documentation to find the methods more quickly. This is done in new generated pod code.
is rw
traits) is more convienient. For example the following
my Int ( $width, $height) = $window.get-size;
Instead of
my Int ( $width, $height);
$window.get-size( $width, $height);
which is a teeny bit more cumbersome but also I find that the action is a side effect where the variables $width
and $height
are changed in the process. In this case not very confusing but other cases might be.
Error messages generated in the packages, should be displayed in other languages as well, starting with the most used ones like German, French and Spanish. And for the fun of it also in Dutch. Gtk already has done this for several return messages from the Gtk libraries.
To test for errors, an error code must be tested instead of the text message. The errors generated in the package need to add such a code. To keep a good administration the errors must be centralized in e.g. Gnome::M (for messages). This is also good to have translations there. Need to use tools for that. For localization, GTK+/GNOME uses the GNU gettext interface. gettext works by using the strings in the original language (usually English) as the keys by which the translations are looked up. All the strings marked as needing translation are extracted from the source code with a helper program.
When a native object is given using .new(:native-object())
, it is not correct to set the type of the object assuming that the type is the same of the Raku class consuming this native object. E.g it is possible to create a Gnome::Gtk3::Widget using a native object of a button. This can give problems when casting or even worse, creating a Gnome::Gtk3::Button using a native GtkContainer. Testing should be done to accept the proper native object.
-rk()
methods are not needed anymore. Code is added to Gnome::N::TopLevelClassSupport and Gnome::N::N-GObject to coerce to and from a native object stored in a N-GObject type object.
```
my Gnome::Gtk3::Window $w .= new;my N-GObject() $no = $w;
$no = $w.N-GObject;
$no = $w.get-native-object;
my Gnome::Gtk3::Window() $w2 = $no;
my Gnome::Gtk3::Window(N-GObject) $w2 = $no;
my Gnome::Gtk3::Window $w2 .= new(:native-object($no));
$w.set-title(‘N-GObject coercion’); $no = $w;
say $no(Gnome::Gtk3::Window).get-title; # N-GObject coercion say $no(‘Gnome::Gtk3::Window’).get-title; # N-GObject coercion say $no().get-title; # N-GObject coercion
my Gnome::Gdk3::Screen $s .= new; $screen.get-rgba-visual.().get-depth;
$screen.get-rgba-visual.(‘Gnome::Gdk3::Visual’).get-depth;
* Error objects are sometimes created when instantiating a class. The error object is then stored and can be reviewed after noticing that the object is not valid. This could be tested like;
my XYZ::Object $xyz .= new( … ); die $xyz.last-error.message unless $xyz.is-valid;
Also methods can return error objects. When they do, also set the `$.last-error` attribute so it can still be examined later at a more convenient moment. Maybe always, and no return of an error?
$xyz.do-something( … ); die $xyz.last-error.message unless $xyz.last-error.is-valid;
Sometimes the gnome functions return a boolean. Can return that instead?
die $xyz.last-error.message unless $xyz.do-something( … ); ```
get-name()
from Builder and Widget. Dashes are prevered.
gtk_grid_attach()
-> attach()
.gtk_label_new()
-> new()
. Handled with submethod BUILD()
.gtk_widget_set_name()
-> widget-set-name()
. Cannot be too short.gtk-list-store-append()
-> append()
. Needs an extra method.DESTROY()
in a user object to cleanup a native object which inherits a Raku G*::object.
.clean-object()
.Each user class inheriting a Raku G*::object must have a new() to create the native object. This must be repeated for other subsequent inheriting classes because only the top new() is run!
Add plantuml diagrams to documents. SVG is the best picture format.
Explain difference in actions of a widget like show, realize, map events, expose events and map. A question from a blog
In some situations, modules need to be imported just for a name from an enumerated type. In those cases it would be better when all enums go into the Enums module instead of having some of them in a specific module. E.g. GTK_WIN_POS_MOUSE
comes from Window, GTK_RESPONSE_NO
from Dialog and GTK_MESSAGE_WARNING
from Enums. We might need to include all three of the modules when dealing with e.g. a MessageDialog.
.menu_new_with_model()
using Gnome::Gio::MenuModel (better approach). Menu handling from gtk is completely removed in version 4, so, to make your program more ready for version 4 use the menu modules from Gnome::Gio. Also the MenuBar is removed from GTK version 4. The only way to have a menubar is to use the Application module which is a bit complex..set_icon_name()
methods instead where applicable. For example, read Gnome::Gtk3::ToolButton doc. In menu, unfortunately, GTK has dropped the use of icons in menus. See also google docsCode samples shown are taken directly from real working programs. This makes it easy to work on the programs without modifying the code in the docs. However with longer listings I want to show parts of it using min and max line numbers.
<!–
Resources
Gnome::*
libraries will be classes, derived directly or indirectly from the root class Gnome::N::TopLevelClassSupport. There are also interfaces, which can contain implemented methods and variables. These interfaces are declared as roles and are mixed in, in the appropriate class. E.g. a role Gnome::Gtk3::Buildable is mixed in Gnome::Gtk3::Widget. All objects created from classes inheriting from Gnome::Gtk3::Widget can then use the methods from Gnome::Gtk3::Buildable too.Pango
Gnome::N::debug()
.> gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
ctrl-shift-D
or ctrl-shift-I
$window.set-interactive-debugging(True)
g_signal_connect_object()
instead of .register-signal()
..clean-object()
on iterators, widgets, or in callback handlers.Check licensing of the whole project, contact Gnome?
Remove changelog from About page and add separate pages for the changelog from the packages.