You are not logged in.

#1 2014-07-24 14:53:09

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Can I draw panels with GTK

Hi,
Please help me with this noob question. Is it possible to write a panel with GTK alone, now that we can draw without window borders ?

Thanks for your time.


Keep Calm, And Enjoy Life smile

Offline

#2 2014-07-24 14:59:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,563
Website

Re: Can I draw panels with GTK

Eh ... yes.

You can even write a panel without gtk.  There are many panels/statusbars that don't need gtk.

What would be the contrast, if not 'gtk alone' what else would you use?  GTK is just a toolkit.

Last edited by Trilby (2014-07-24 14:59:45)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2014-07-24 15:01:05

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: Can I draw panels with GTK

well.. gnome-panel has been around since gnome1, so I think it has been possible since 1997 at least.

Offline

#4 2014-07-25 05:20:44

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: Can I draw panels with GTK

Thanks, for your response. to get processes to get displayed in the panel like in xfce4-panel. Is there any command, to get those processes, since top and ps give a lot of them. But how to filter to get the ones user has started.

If the approach is to remember while we launch, then probably it has nothing to do with ps and top then ???

Thanks for your time.


Keep Calm, And Enjoy Life smile

Offline

#5 2014-07-25 09:48:52

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Can I draw panels with GTK

Hi
Look into the source code of xfce4-panel to study how the running applis are shown in the panel (I doubt that ps or top are used for that).
If you want to learn, look at how existing applis are written and have solved the point you are interested in.
Cheers.

Offline

#6 2014-07-25 11:02:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,563
Website

Re: Can I draw panels with GTK

Do you want the panel to show "processes" or windows?  Windows are easy.  Just listen to maprequest events from the X server.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2014-07-25 13:07:23

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: Can I draw panels with GTK

Trilby wrote:

Do you want the panel to show "processes" or windows?  Windows are easy.  Just listen to maprequest events from the X server.

I was looking for open windows in the desktop as it shows up in our old mate or xfce.
Thanks for the suggestion. I will google on that an look for more to clarify myself. smile

Last edited by Debasish Patra (2014-07-25 13:11:47)


Keep Calm, And Enjoy Life smile

Offline

#8 2014-07-25 13:09:37

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: Can I draw panels with GTK

berbae wrote:

Hi
Look into the source code of xfce4-panel to study how the running applis are shown in the panel (I doubt that ps or top are used for that).
If you want to learn, look at how existing applis are written and have solved the point you are interested in.
Cheers.

Thanks, I am not quite well versed, just started to program with GTK. I find it difficult to understand at this point, but will catchup eventually. smile


Keep Calm, And Enjoy Life smile

Offline

#9 2014-07-25 14:07:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,563
Website

Re: Can I draw panels with GTK

Debasish Patra wrote:

I was looking for open windows in the desktop as it shows up in our old mate or xfce.

Then you'll want to probably use EWMH instead - this will be much easier, provided it is a EWMH compliant window manager.  You just retrieve the window list and desktop information from Atoms set on the root window.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2014-07-25 16:24:30

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: Can I draw panels with GTK

Trilby wrote:

Eh ... yes.

You can even write a panel without gtk.  There are many panels/statusbars that don't need gtk.

What would be the contrast, if not 'gtk alone' what else would you use?  GTK is just a toolkit.

Thanks, but what i see googling around is that i can draw inside the window with text fields, buttons etc with gtk. but I looked a lot for drawing a rectangle with gtk e.g a panel which does not have window decorations. it seems i have a wrong understanding of what can be done with gtk ?

Thanks for your response. smile

Last edited by Debasish Patra (2014-07-25 16:41:11)


Keep Calm, And Enjoy Life smile

Offline

#11 2014-07-25 16:57:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,563
Website

Re: Can I draw panels with GTK

A panel without window decorations is simply a window which has requested to not be decorated (often an override-redirect window).

GTK can create these just fine - but I really don't use gtk.  GTK is simply a widget toolkit.  Xlib creates windows and draws on them.  GTK is a 'wrapper' around Xlib (or Xcb) and it gives you functions to call which then in turn call the Xlib functions.

Xlib has a function called XCreateWindow to which you'd pass a window attribute structure which (among other things) could define the override-redirect status.  Gtk has some CreateWindow function (I don't know the name of it) that does the same thing.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB