Open BrainBlasted opened 5 years ago
Note that we don't need all of them (or not even most of them) for writing meaningful widgets. Check existing widget implementations, only a very small subset of the virtual methods is usually needed.
I think the main important missing one is draw
at this point, that should really be added rather sooner than later :)
Currently we use expect
if no parent implementation for a vfunc exists. There are a few vfuncs in GtkWidget that default to NULL
- what's the right way to handle this? Is it okay to leave these as panics if the user makes a call to a non-existent parent implementation?
On 10 August 2019 09:35:12 EEST, Chris notifications@github.com wrote:
Currently we use
expect
if no parent implementation for a vfunc exists. There are a few vfuncs in GtkWidget that default toNULL
- what's the right way to handle this? Is it okay to leave these as panics if the user makes a call to a non-existent parent implementation?
It depends. If it's mandatory to implement the virtual method then yes, and you would put no default impl into the Impl trait.
If it's optional then you would instead return a default value here. Whatever the base class would do anyway if it was left at NULL.
See the various cases in gstreamer-rs, they all appear there.
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
A few of the vfunc have been added, I don't have the permissions to check them in the list.
Which ones?
The ones in commit ccc855a for example. No?
@GuillaumeGomez your job :)
This issue is to provide a list of vfuncs of GtkWidget, to be crossed of as they are implemented. The first batch is covered in gtk-rs/gtk#861.
can_activate_accel(Needs work on signals API)delete_event(Needs bindings for GdkEventAny)