|
|
Subject: Re: Getting currently-selected Gtk::Notebook page - msg#00081
List: gnome.gtk+.perl
On Thu, 2003-10-09 at 04:25, Ken Restivo wrote:
> "switch-page"
> void user_function (GtkNotebook *notebook,
> GtkNotebookPage *page,
> gint page_num,
> gpointer user_data);
>
> I tested this in C, and the page_num variable does in fact deliver the
> correct number.
>
> But in Perl all I can shift out of there is the notebook widget itself.
Well, it seems to work for me:
$notebook -> signal_connect(switch_page => sub {
warn join(", ", @_);
});
gives someting like:
Gtk2::Notebook=HASH(0x865340c), 142057896, 2 at ...
which is what the prototype suggests.
Of course, the GtkNotebookPage parameter is not correct. It's a struct
and supposedly gets cast to an integer. We'd need custom marshalling for
this to work correctly, but as far as I can tell that struct is supposed
to be private anyway.
HTH,
-Torsten
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: last call
* muppet <scott@xxxxxxxxxxx> [2003-10-09 11:47]:
> should we go to 2.00 for the 2.4/2.6/3.0 release, or just keep
> on the 1.xx series indefinitely?
I say stick to 1.x. Gtk2-Perl version numbers should IMHO reflect
the state of Gtk2-Perl, not the version of Gtk2 they are tied to.
--
Regards,
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."
Next Message by Date:
click to view message preview
key bindings
I would like to add custom key bindings to a widget, preferably binding
keys directly to perl subroutines. Now I found in the Gtk reference this
page <http://developer.gnome.org/doc/API/2.0/gtk/gtk-Bindings.html> but
this is totally unhelpful due to the lack of descriptions/explanations.
Could someone show me how to bind a key to a perl sub ?
--
) ( Jaap Karssenberg || Pardus [Larus]
: : http://pardus-larus.student.utwente.nl/~pardus
) \ / (
",.*'*.," Proud owner of "Perl6 Essentials" 1st edition :)
Previous Message by Thread:
click to view message preview
Getting currently-selected Gtk::Notebook page
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm trying to get the CURRENTLY-selected Gtk::Notebook page. This is driving me
bananas, because all that I can get is the PREVIOUSLY-selected Gtk::Notebook
page, which is utterly useless to me.
The gtk+ C-language callbacks for the "switch-page" signal give me:
"switch-page"
void user_function (GtkNotebook *notebook,
GtkNotebookPage *page,
gint page_num,
gpointer user_data);
I tested this in C, and the page_num variable does in fact deliver the correct
number.
But in Perl all I can shift out of there is the notebook widget itself.
Calls to $w->get_current_page(), and $w->page just give me the
PREVIOUSLY-selected page.
Even more bizarre: if I get the widget directly using GTK::GladeXML's
get_widget() function, and perform these same get_current_page() operations on
it, I still get the PREVIOUSLY-selected page, NOT the one that is sitting there
on screen, looking right at me.
How can I fix this? My project is quite stuck without this working.
- -ken
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE/hMcje8HF+6xeOIcRArvaAKC9xGhS3TwYiDw320weAzFXAk5PdgCgp6Eg
skLh1aDTt6gdjWY6Ggkh1N0=
=2kho
-----END PGP SIGNATURE-----
Next Message by Thread:
click to view message preview
last call
it's been a while since a major bug has been found in Gtk2 or Glib, and
there hasn't been a commit to either since last week. if you know of
any bugs that need to be fixed before the stable release finally fights
its way out of beta, the speak now or forever hold your peace.
otherwise, i will release the actual 1.00 of each on the tenth.
so...
/me points the microphone at the crowd and waits for a response
as for the post-1.00 release plan:
i plan to take a while off from making releases, as i haven't seen a
normal thursday night since Gtk2 0.90, which was twelve weeks ago.
the 1.00 release will reach a lot of people, and we'll get bug reports
i'm sure. i'll reserve 1.01 for the Brown Paper Bag release, which i
hope will not be needed. we'll collect the bug fixes and new
documentation (you guys are still writing documentation, right?) and
make a 1.02 in a month or so. once gtk+ 2.4.x is generally available,
we'll start patching that in, and have another major stable release for
that, similarly for 2.6 etc.
should we go to 2.00 for the 2.4/2.6/3.0 release, or just keep on the
1.xx series indefinitely?
i'd also like to get lots of example code up on the website, and start
discussion on how we're going to do the perl API reference docs. (as
we've seen, not everyone in the perl community is comfortable reading
the C API docs.)
in the meantime, torsten has taken the conch as maintainer of Gnome2
and will be making releases on Gnome2 on a separate schedule. watch
for him on freshmeat -- http://freshmeat.net/projects/gnome2-perl/
as always, comments, rebuttals, and questions are very welcome.
--
muppet <scott at asofyet dot org>
|
|