Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a window like Google Chrome in GTK+

Tags:

c

gtk

I'm pretty new to GTK libraries and trying to develop a small project in GTK+2 with its C API's. The requirement is to do it in a Google-Chrome type window. It'll be having it's own title bar and controls with different colors.

Can anybody help me out with any tutorial or reference or any opensource code that already implemented this?

I appreciate your help.

like image 497
intellidiot Avatar asked Dec 10 '22 11:12

intellidiot


2 Answers

What you want to do is custom decoration.

My understanding is that you have to set_decorated False on the window so that the WM doesn't add border/title bar itself to your windows and then have your own custom Window subclass that handles drawing it's decorations itself manually in the paint() method.

Not trivial.

like image 99
246tNt Avatar answered Jan 05 '23 16:01

246tNt


Since the Crhomium browser is an open source project, its source is available here: http://src.chromium.org/viewvc/chrome/trunk/

What you seek should by definition be available there :)

like image 36
Hannes Ovrén Avatar answered Jan 05 '23 16:01

Hannes Ovrén