Re: Why GTK+ ignore, that someone want's to create own widget ?!



Thank's for your answer.

I understand what is do under the public API. But when I'm using CSS
(which is great idea for styling desktop application) in browser, i
have still base tools (methods or access) to all display attributes
like color, image, gradient, radius or what i need.

Now, if I want to get these settings from GTK+, I must doing some
breakneck magic, and I'm still don't know, if I'll get it. That are the
obstacles.

May be, GTK provides very rich API to affect final visual, but that is
not enough. The simplest ways as possible are deprecated, and really
yes, sometimes, that ways are the best solution, than complex visual
system.

The same applies to StatusIcon and ActionHelper etc. I really
understand why could be bad. But sometimes, is the unified solution of
problem.

Ondra

V Tue, 13 Dec 2016 09:46:28 +0000
Emmanuele Bassi <ebassi gmail com> napsáno:

Hi;

On 13 December 2016 at 05:33, Ondrej Tuma <konference webjet cz>
wrote:
At the moment, i just to get default widget border color. But, the
gtk_style_context_get_border_color is deprecated... and i should to
use gtk_render_frame. Please tell me how can i use gtk_render_frame
to get border color?! How?  

You don't "get the border color" because there's no such thing as a
border or background color.

CSS, which is used to represent the rendering operations, has a stack
of background and border images, which are blended with colors. Asking
for a single color does not make sense.

You need to call gtk_render_frame() and gtk_render_background() to
*render* the border and background. Then you set up what you want to
render using CSS style classes and call gtk_style_context_add_class()
to add the matching classes to your widget.

Every widget you see is the result of this process.

What GTK do is putting obstacles in the way of creating more complex
application. But yes, sometimes, we need special widgets, with
special using :-(  

GTK does not put obstacles anywhere: it provides you with a very rich
and powerful way to describe the rendering process and its final
outcome using a standardised API called "CSS" instead of using only a
C API.

Ciao,
 Emmanuele.




-- 
Ondřej Tůma <mcbig zeropage cz>
www: http://ipv6.mcbig.cz   jabber: mcbig jabber cz   twitter: mcbig_cz


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