Re: Some GtkStyle questions




Mattias "Grönlund" <Mattias.Gronlund@sdf.se> writes:

> I'm in the process of trying to convert the gtkcalendar widget to 
> taking advantage of GtkStyles, but I run into a couple of questions.
>    
> What do the function 'gdk_im_decide_style' do, should it be used in
> gtk_calendar_realize?

gdk_im_decide_style has nothing to do with styles. It is part of
the X Input Method extension support.
 
> styles.txt says:
> gtk_widget_realize ()
>   Besides realizing the widget this function will:
>   - perform an rc lookup if necessary,
>   - attach a widget's style.
 
> But out of what I can see, it looks like gtk_widget_realize only does
> the rc-lookup. And when I read the tutorial it looks like it only does
> the attach. But as I understand it the gtkcalendar widget should:

I think this is referring to the action both of the code
in gtk_widget_realize, and to what happens in the widget's
"realize" callback that that function calls. The latter does
the attachment.
 
> gtk_widget_ensure_style (GtkWidget *widget);
> widget->style = gtk_style_attach (widget->style, widget->window);
 
The realize() callback does not need to call gtk_widget_ensure_style(),
because that is already done implicitly before the realize() callback
is called.
 
> One thing I don't know how to handle is the problem that the widget
> is not a composite widget but uses fonts to three different things.
> This mean that I would like to give the user the possibility to 
> change any of these fonts one at a time. Can I implement that
> which three different GtkStyle:s attached to the widget, and how
> would the user do to chang them one at a time?
> 
> And another problem is that one of these fonts should be fixed, so
> that I would need a default font other than the normal default.

Hmmm, I don't know a good solution to this one. I think you'll
have to leave the fixed font hardcoded in for now.
 
> And as a last problem, I would like to find out the maximum ascent/
> descent for a text-string with a specific font, not for the whole font
> like I can do with XTextExtents().

see gdk_[text/string]_extents() the was added into the 1.1 branch 
recent.

Regards,
                                        Owen



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