Re: Another Patch (was Re: yet another new snapshot (again))

On Wed, 16 Apr 2003, muppet wrote:

Chas Owens said:
I took an old Gnome app from before I knew about Gtk::GladeXML and am
updating it to use Gtk2 and Gnome2.  The transition was very minimal, with


Yeah, I was very supprised, of course it is a simple app and I have no
functionality since both the menu and the toolbar were created using the
Gnome::AppHelper functions.  I imagine the pain will get worse when I try
to insert text into the Gtk2::TextView or display the result set in a
Gtk2::TreeView instead of a Gtk::CList.

the exception of the $app->create_menus.  The helper functions from
Gnome::AppHelper do not appear to be implemented.  I took a brief stab at
it, but I need to study XS more before I can do anything that big.

it was more than i wanted to do yesterday afternoon when it was so sunny
outside.  ;-)  actually, the menu helper stuff requires some callbacks that i
haven't looked into handling yet.

Well, I don't feel that bad anymore.


<snip />
the _ornull means that you should be able to pass undef for that parameter
with no problems, e.g.:

  $sw = Gtk2::ScrolledWindow->new (undef, undef);

Yeah, I noticed that after I changed the code.  My mistake was going back
to the tutorial and seeing it say

$scrolled_window = new Gtk::ScrolledWindow( "", "" );

Which simply doesn't work with the new code (even after my change).

as for supplying default parameters, i think that's already been changed that to

 gtk_scrolled_window_new (class, hadjustment=NULL, vadjustment=NULL)

since last night's snapshot.

Is it available from some CVS?  I think I remember seeing something about
it being checked in parallel to the other Gtk2-Perl module somewhere.

If you don't mind I am going
to go through the code and setup the defaults to match as closely to
Gtk-Perl-0.7008's defaults as I can get them.

use =NULL, not =0 (whoever put =0 in gtk-perl was very naughty).  we might
also consider adding some pod that explains the differences.

Yeah, I thought about that, but I wasn't sure what the magic XS code was
doing behind the scenes so I just decided to follow the original blindly.

i'm all for consolidating constructors and coming up with abbreviations and
default parameters for things, but have been implementing things "faithfully"
for now.

I am only faithful to my wife, everything else must bend to _my_ whims
hahahahahahahahahaahaha*cough*cough*sputter*.  I think I need more meds.

While we are speaking of faithfulness vs. easy, what is the general
consensus about adding some helper functions to Gtk2::TextView?  I really
don't like having to create Gtk2::TextIter objects just to get a dump of
everything in the widget, or replace everything, or insert, append, and
everything else I did with Gtk::Text with simple integer offsets.

Instead of something like (and I apologize for using C#/Gtk# code,
but it is the only Gtk2 stuff I have laying arround)

<code lang="C#">
        public void save() {
                TextIter Start = new TextIter();
                TextIter End   = new TextIter();

                sql.GetIterAtOffset(out Start,  0);
                sql.GetIterAtOffset(out End,   -1);

                Console.WriteLine(sql.GetText(Start, End, false));

I want to be able to say

<code lang="Perl">
        sub save {
                my $editor = shift;
                print $editor->{sql}->get_text(0, -1, 0), "\n";

muppet <scott asofyet org>

gtk-perl-list mailing list
gtk-perl-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]