Re: [gtk-list] Re: Newbie Gtk+ questions...
- From: "Larry 'Daffy' Daffner" <vizzie mail airmail net>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Newbie Gtk+ questions...
- Date: Sat, 21 Feb 1998 23:08:38 -0600
>>>>> "OT" == Owen Taylor <owt1@cornell.edu> writes:
[ integer valued scale ]
OT> If you want a scale widget that actually moves in integer
OT> increments, then you are out of luck, unless you write your
OT> own. Otherwise, just use
OT> gtk_scale_set_digits (GTK_SCALE(my_scale), 0);
That will do the trick. It will be easy enough to convert the value to
an int myself when I get it back :)
>> 3) I have an idle procedure which ends up taking about
>> 500ms. This makes interactive performance *really* bad :). From
>> UTS,L!
OT> <curious> what's that? </curious>
UTS,L! = Use The Source, Luke! (IE, digging through the gtk code :)
If you're talking about the idle procedure, it's a procedure which
reads an image from the quickcam using libqcam (~350ms for a
320x240x6bpp gray image), and thunking it into a gtkimage and writing
it to the screen (~120ms or so).
>> it appears that splitting it up into 2 procedures will still call
>> both procedures between event checks, no matter what.
OT> Not " matter what". One thing you can do which will work is to
OT> set up the second half as a one-shot idle handler at a higher
OT> priority than the first half. (You'll need the CVS gtk for this,
OT> which has gtk_idle_add_priority(), or it will appear in the next
OT> release)
Sounds confusing.. I'll just go with...
>> Can I call gtk_main_iteration_do() in the middle of my idle
>> function and have it process events correctly, or am I basically
>> taking my chances if I do that?
OT> Just calling gtk_main_iteration_do() is taking your
OT> chances. (The non-block isn't currently working) But doing:
OT> while (gtk_events_pending()) gtk_main_iteration();
This here.. That seems to work better (though that 350ms grab is still
a hit - I may need to bite the bullet and do the qcam stuff myself :()
and is simple enough for a beginner like me to understand. :)
OT> will work safely. Though, if you do this, idle redraws may not
OT> work correctly. [ I haven't tested it out, but it strikes me
OT> that this may be the case. Maybe gtk_events_pending() should
OT> count idle handlers above some priority as pending events? ]
Idle redraws? What's that? Should I be concerned?
>> 4) What's the correct syntax for using the space bar as a menu
>> accelerator?
OT> I think " " should work. (I, unfortunately, won't show up on the
OT> menu, though)
Duuuh. That works. :) Here I was thinking it was something hard :)
Thanks for all the help :)
-Larry
--
Larry Daffner | Linux: Unleash the workstation in your PC!
vizzie@airmail.net / http://web2.airmail.net/vizzie/
There is nothing so terrifying as ignorance in action.
-- Col Jeff Cooper
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]