Re: messy hack and stability

From: Date: Thu, 08 Sep 2005 18:54:33 +0000
Subject: Re: messy hack and stability
References: 1 2  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1614@lists.php.net to get a copy of this message
It's an internal GTK function... we don't touch it, but it's how the thang works. ----- Original Message ----- From: "Andrei Zmievski" <andrei@gravitonic.com> To: "Steph" <steph@zend.com> Cc: "PHP-GTK dev" <php-gtk-dev@lists.php.net> Sent: Thursday, September 08, 2005 7:49 PM Subject: Re: [PHP-GTK-DEV] messy hack and stability > WTF is gtk_label_set_uline_text_internal? > > -Andrei > > > On Sep 5, 2005, at 7:38 PM, Steph wrote: > > > I finally got GTK+ source to download (definitely bedtime now). > > Just say > > 'no' to dialup, kids... > > > > If use_underline is true and there's no mnemonic value set, > > gtk_label_set_uline_text_internal() simply returns GDK_VoidSymbol > > as the > > accelerator key. The mnemonic widget by default is the parent > > widget, i.e. > > the button or menu item containing the label. However if the label > > itself > > can't find an 'activatable ancestor' to use as a target, you get a > > warning > > beep and a bit of barfing. So it's not a good idea to have > > use_underline = > > 1 indiscriminately in things like set_text() or even in gtklabel > > (because it > > would generally find its ancestral gtkwindow, which might make for > > confusion, and because labels in gtknotebook would act completely > > differently from everywhere else), but it _is_ a good idea to apply > > it with > > discrimination, in the places where people are likely to want to > > use it more > > often than they are likely to want to escape it. > > > > So can I make that small change in the button and menuitem > > constructors and > > make PHP-GTK a tad easier to use, please? > > > > ----- Original Message ----- > > From: "Steph" <steph@zend.com> > > To: "Andrei" <andrei@gravitonic.com> > > Cc: "PHP-GTK dev" <php-gtk-dev@lists.php.net> > > Sent: Monday, September 05, 2005 6:43 PM > > Subject: Fw: [PHP-GTK-DEV] messy hack > > > > > > > >> OK, I looked again now and discovered the second parameter in > >> gtk_button_new. > >> > >> I think what I'm asking, then, is whether that second parameter > >> couldn't > >> > > be > > > >> made a more intuitive '1' by default, i.e. it's switch-off-able > >> but is > >> generally 'just there' in things like menu items, labels and > >> buttons using > >> the text parameter, and probably also in set_text(). > >> > >> I'm having trouble getting access to the C source for gtk+/win32 at > >> > > present, > > > >> so I've no idea whether that's going to render those widgets > >> unstable. > >> > >> It _appears_ to work without problems here for GtkButton and > >> GtkLabel. > >> > >> > >> ----- Original Message ----- > >> From: "Steph" <steph@zend.com> > >> To: "PHP-GTK dev" <php-gtk-dev@lists.php.net> > >> Cc: "Andrei" <andrei@gravitonic.com> > >> Sent: Sunday, September 04, 2005 4:18 PM > >> Subject: [PHP-GTK-DEV] messy hack > >> > >> > >> > >>> <?php > >>> > >>> $window = new GtkWindow('Testing stuff'); > >>> $window->connect_object('destroy', array('gtk', > >>> 'main_quit')); > >>> > >>> $button = new GtkButton(''); > >>> $label = $button->child; > >>> $label->set_text_with_mnemonic('_Suck it and see'); > >>> $window->add($button); > >>> > >>> $window->show_all(); > >>> > >>> gtk::main(); > >>> > >>> ?> > >>> > >>> It took a while to understand why use_underline is TRUE by > >>> default, but > >>> > > it > > > >>> has to be better than working around it in userland. > >>> > >>> I think I can probably tackle those outstanding 'mnemonic' calls > >>> with my > >>> copy/paste skills, there are a few incidences of it already in the > >>> > > source. > > > >>> > >>> Do you have any strong feelings about that approach, Andrei? > >>> > >>> - Steph > >>> > >>> -- > >>> PHP-GTK Development Mailing List (http://gtk.php.net/) > >>> To unsubscribe, visit: > >>> http://www.php.net/unsub.php > >>> > >>> > >> > > > > -- > PHP-GTK Development Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.gtk.dev (#1614) next »