Re: Gtk2::Notebook and switch-page signal
- From: "Kiss Gabor (Bitman)" <kissg ssg ki iif hu>
- To: muppet <scott asofyet org>
- Cc: gtk-perl-list gnome org
- Subject: Re: Gtk2::Notebook and switch-page signal
- Date: Fri, 28 Jan 2011 10:44:00 +0100 (CET)
Anyway the original question is: could somebody explain what
gpointer mean in "switch-page(Gtk2::Notebook, gpointer, Glib::UInt)"? :-)
For this signal, in git master, the gpointer argument is now a proper
GTK_TYPE_WIDGET representing the new selected child, suggesting someone
attempted to fix this.
You may be able to get a usable thing by doing
$child = Glib::Object->new_from_pointer ($the_gpointer_value);
if you really want to try using it. However, if it breaks, you get the keep the pieces.
Eeerr.... I'm confused a bit. As far as I can see documentation
mixes two different meaning of the word "pointer".
1. a variable holding a memory address
2. a small arrow (or other shape) moved by mouse (or other pointing device)
http://gtk2-perl.sourceforge.net/doc/pod/Glib/Object.html writes:
scalar = Glib::Object->new_from_pointer ($pointer, $noinc=FALSE)
$pointer (unsigned) a C pointer value as an integer.
[...]
gpointer = $object->get_pointer
Complement of new_from_pointer.
Unfortunately Gtk2::Widget class overrides method get_pointer so
$notebook->get_pointer() returns two small integers,
the actual coordinates of the small arrow within the window.
See
http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/Widget.html#_x_y_widget_get_poin
What is $object in the former doc snippet?
How to get a valid gpointer value?
One problem with the signal documentation is that we get the signal
signatures by asking the library at runtime for the types of the parameters.
This information doesn't include parameter names, and doesn't explain which
signals are private and which are public. Many of the very old things in
gtk+ have signals when they actually just wanted virtual functions, so
they're not always intended for application usage.
Any idea how could I force signal handler to be executed without
actual page switch? :-)
Now I have to do some workarounds. The program works but it is not "clean".
Gabor
--
No smoke, no drugs, no vindoze.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]