Re: GtkLayout continued - anyone out there?

From: Date: Fri, 01 Mar 2002 01:13:04 +0000
Subject: Re: GtkLayout continued - anyone out there?
References: 1 2 3 4 5 6 7 8  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-1399@lists.php.net to get a copy of this message
You've seen that generally, or just on doze? ----- Original Message ----- From: "Alan Knowles" <alan@akbkhome.com> To: "Steph" <steph.fox@btinternet.com> Cc: "Jared Smith" <jaredsmith@jaredsmith.net>; "PHP-GTK gen" <php-gtk-general@lists.php.net> Sent: Friday, March 01, 2002 1:31 AM Subject: Re: [PHP-GTK] GtkLayout continued - anyone out there? > have you tried > connect the 'scroll action' to an callback > on the callback do > $layout->hide(); > $layout->show(); > > - ive seen problems with gtkhtml on scrolling that the buttons / text > entry boxes can get messed up (gtkhtml is basically an gtklayout with a > gtkpixmap + standard gtk widgets for form elements..) > > regards > alan > > > Steph wrote: > > >Cool, thank you. > > > >Following discussion with Havoc (GTK dev team), we're all agreed it's a bug in > >the win32 port of GTK (nothing to do with our Frank). > > > >Under win32, we need to connect to the scrolled window's adjustment changes and use > >$layout->queue_draw() to see any apparent scrolling at all in the layout widget. > > > >In the second example, the labels scroll as expected but the buttons are stationary. I > >have absolutely no idea why, and can't get them to budge except by doing the maximize/restore > >thing to create an expose event. The first example works only if you make the GtkButtons into > >GtkLabels and use the queue_draw() callback. > > > >New adaptation below, on the off-chance that any Windows people feel like solving The Great > >Button Mystery :) > > > ><? > >dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : > >"so")); > > > >function exposure($adj, $layout) { > > $layout->queue_draw(); > >} > > > >$window = &new GtkWindow(); > >$window->set_position(GTK_WIN_POS_CENTER); > >$window->set_title('Layout'); > >$window->set_usize(200, 200); > >$window->connect_object("destroy", array("gtk", > >"main_quit")); > > > >$scrolledwindow = &new GtkScrolledWindow(); > >$window->add($scrolledwindow); > > > >$layout = &new GtkLayout(null, null); > >$scrolledwindow->add($layout); > > > >$x = gdk::screen_width(); > >$y = gdk::screen_height(); > >$layout->set_size($x, $y); > > > >$hadj = $scrolledwindow->get_hadjustment(); > >$vadj = $scrolledwindow->get_vadjustment(); > >$hadj->connect('value-changed', 'exposure', $layout); > >$vadj->connect('value-changed', 'exposure', $layout); > > > >for ($i=0 ; $i < round($y/100); $i++) { > > for ($j=0 ; $j < round($x/100); $j++) { > > $buf =sprintf("Button %d, %d", $i, $j); > > if (($i + $j) % 2) $button = &new GtkButton($buf); > > else $button = &new GtkLabel($buf); > > $layout->put($button, $j*100, $i*100); > > } > > } > > > >$layout->show_all(); > >$window->show_all(); > > > >gtk::main(); > >?> > > > > > > > > > >----- Original Message ----- > >From: "Jared Smith" <jaredsmith@jaredsmith.net> > >To: "Steph" <steph.fox@btinternet.com> > >Cc: "PHP-GTK gen" <php-gtk-general@lists.php.net> > >Sent: Thursday, February 28, 2002 10:53 PM > >Subject: Re: [PHP-GTK] GtkLayout continued - anyone out there? > > > > > >>OK, I've posted some screenshots of both of Steph's scripts at > >>http://www.jaredsmith.net/jared/shots.html... It should > >>give you an idea > >>of what's going on. (For some reason, my screenshots didn't get the > >>border around the window... I guess I'll have to reread the man page on > >>"import" again.) > >> > >>Jared > >> > > > >> > > > > > > >

« previous php.gtk.general (#1399) next »