Re: Re: [PHP-GTK] GTKText solutions?

From: Date: Tue, 04 Feb 2003 21:42:23 +0000
Subject: Re: Re: [PHP-GTK] GTKText solutions?
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3008@lists.php.net to get a copy of this message
Steph, Thanks for the hand! 1) The cursor is going weird because I've been pulling the text out of the GtkText Box, wrapping, then putting it back in. That leaves the cursor in an indeterminate spot, thus it "goes weird". 2) Tried to do GtkScintilla() - and have been unable to get this to work on Windows 98/95, even with the latest 0.5.2 and 0.5.2a binary downloads. What's the quickest way to get this up so I can see it? -Ben As with most of the people around here, I'll be eagerly awaiting PHP(4.x)-GTK(2.x)! On Monday 03 February 2003 10:39 pm, you wrote: > Sorry, I've no clue what you're doing to make the cursor go weird..! > > Did you look into GtkScintilla at all yet? If you want more than 'very > simple' it is seriously the best option ATM, until we get PHP-GTK2 (next > autumn at the very earliest I'd say). > > GtkText is apt to get messy with inserts greater than 1024 bytes, hence > freeze() and thaw(), my best guess is that you're omitting those and > hence the cursor problem. > > Precisely how many bytes it needs to _really_ screw up, I couldn't tell > you off-hand. I saw an article once about GTK+ that mentioned it, and > Markus made a script early in PHP-GTK history that basically was a > server log, using a text widget, which had a load of problems with > redrawing once the data string reached a certain point. If I asked you > about something that happened in a colleague's work 18 months ago you > probably wouldn't remember the details either.. > > Normally I'd pore over GTK+ source to try and find you some proper > answers, but you've caught me at a bad moment - I'm about to disappear > for a fortnight and haven't packed yet. So I'm keeping this reply > off-list, on the chance that someone else might come up with something > sensible to assist you. > > > ----- Original Message ----- > From: "Benjamin Smith" <bens@effortlessis.com> > To: <php-gtk-general@lists.php.net> > Sent: Tuesday, February 04, 2003 1:29 AM > Subject: Fwd: Re: [PHP-GTK] GTKText solutions? > > > Also, this method causes weird stuff to happen with the cursor when > > you are > > > inserting text - it's definitely NOT optimum! > > > > -Ben > > > > ---------- Forwarded Message ---------- > > > > There's enough there (I suppose) to come up with something. > > > > I'm well into development of a mid-sized project using PHP-GTK, and > > this has > > > to be licked somehow. So far, it looks like I'll have to trap the > > signal > > > 'changed' and reload the gtktext object's contents when a wordwrap > > event is > > > encountered. Something like > > > > <? > > > > Function DieBoxes($from) > > { > > global ${$from}; > > $text=${$from}->Get_Chars(0, -1); > > if (($new=wordwrap($text, 40, "\n", 1))!=$text) > > { > > ${$from}->Delete_Text(0, -1); > > ${$from}->Insert_Text($new, 0); > > } > > } > > > > $textbox=&New GtkText(); > > $textbox->Set_Editable(true); > > $textbox->connect('changed', 'DieBoxes', 'textbox'); > > > > ?> > > > > While wasteful and cumbersome, this appears to work. I was just > > wondering if > > > anybody else'd come up with something more elegant. Also, I've had > > some > > > concerns about this method and the following: > > > > " it cannot cope with very frequent text updates for long" > > > > Is there a better way? > > > > (As far as "frequent updates", I've run test loops of 1000 each > > numerous > > > times, deleting and then replacing slightly modified text in gtktext() > > without issues... are we talking hundreds of thousands? Millions? > > ...?) > > > -Ben > > > > On Sunday 02 February 2003 08:26 pm, you wrote: > > > Does this mean that you didn't find the manual page, or that there > > > wasn't enough info there? > > > > > > http://gtk.php.net/manual/en/gtk.gtktext.php > > > > > > I wrote something a long time ago, it's on an old hard drive and > > > probably isn't very good anyway but it does kind of work. I'll dig > > it > > > > out if you're still stuck tomorrow :) > > > > > > The other option is gtkscintilla, which has recently become > > available > > > > for win32. It looks like a text widget should, and is way more > > flexible > > > > than gtktext, but you'll need to refer back to the original docs for > > it > > > > because these haven't been started yet on gtk.php.net beyond their > > > initial generation from source. > > > > > > HTH, > > > > > > - Steph > > > > > > ----- Original Message ----- > > > From: "Benjamin Smith" <bens@effortlessis.com> > > > To: <php-gtk-general@lists.php.net> > > > Sent: Monday, February 03, 2003 3:46 AM > > > Subject: [PHP-GTK] GTKText solutions? > > > > > > > What's the best way to get the functionality of GtkText without > > the > > > > "black > > > > > > > box" syndrome for Windows development? > > > > > > > > Yes, I know it's officially "broken". > > > > > > > > Has anybody come up with a wrapper function/method/class extension > > > > > > that > > > > > > > allows for this with reasonable grace? How might you approach a > > > > > > reasonable > > > > > > > workaround? > > > > > > > > -Ben > > > > > > > > -- > > > > PHP-GTK General Mailing List (http://gtk.php.net/) > > > > To unsubscribe, visit: > > > > http://www.php.net/unsub.php > > > > -- > > PHP-GTK General Mailing List (http://gtk.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > ------------------------------------------------------- > > > > -- > > PHP-GTK General Mailing List (http://gtk.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

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