[Gambas-user] gb.desktop.x11 (taskbar)

Benoît Minisini gambas at ...1...
Mon May 19 20:06:50 CEST 2014


Le 19/05/2014 14:22, herberth guzman a écrit :
> Hi Beno?t
>
> Thanks for giving us the gb.desktop.x11 component
> The margins of the panel is funsional, the problem  had it in CARDINAL
> funsiona perfectly, thank you .
>

Please try to use a better english, because I don't really understand 
what you are saying.

Provide me a little project that shows your problem (telling what you 
want to do, and what you get). This is the fastest way for me to fix the 
problems.

> Funsiona The code that follows ( the dependent position of the panel) :
>
> CODE
> X11.SetWindowProperty ( Atom [" _NET_WM_STRUT_PARTIAL "] , Atom [" CARDINAL
> "], [ 0, 0 , 33, 0, 0 , 0, 0, 0 , 0, 0 , 32, desktop.w ] f_taskbar.Id )
>
> Maybe I'm doing a bad procedure and correct me if I am in error. The
> problem I have is as follows:
>
> I have a form and created a Panel:
>
> CODE
> HPanel_app = New Panel ( Me.Panel1 ) As " PanelApp "
>
> Show active windows through ToggleButton when the form loads in the open
> event .
>
> CODE
>    Desktop.Windows.Refresh
>    For I = 0 To Desktop.Windows.Count - 1
>
>      If Desktop.Windows [ i]. Name Then
>        hToggle = new ToggleButton ( Me.HPanel_app ) As " toggle "
>        Desktop.Windows hToggle.Text = [ i]. Name
>     Endif
>
> next
>
> The problem is :
>
> How I can refresh or update inmediantemente MyPanel when a window is closed
> or open.

Create a DesktopWatcher object, passing TRUE to its constructor, so that 
you watch the root window of the screen.

The DesktopWatcher raises the following events:
- Windows: the desktop windows list has changed (a top-level window has 
been created of destroyed). Use Desktop.Windows to browse them.
- Change: the current virtual desktop has changed.
- Count: the number of virtual desktops has changed.
- ActiveWindow: the active window has changed. Use Desktop.ActiveWindow 
to get it.
- Geometry: the geometry of the desktop has changed.

The Desktop.Windows returns sort of array of DesktopWindow objects. 
DesktopWindow encapsulates a X11 window id into a object with properties 
and methods to move the window, resize it, get its icon...

With that, you should have everything to create a taskbar in your panel, 
and manage virtual desktops.

Finally, you can create DesktopWatcher objects to watch individual 
top-level windows, by using their window id.

Regards,

-- 
Benoît Minisini




More information about the User mailing list