Differenze tra le versioni di "Muovere la finestra di un programma con le funzioni del API di X11"
Da Gambas-it.org - Wikipedia.
Riga 9: | Riga 9: | ||
<FONT Color=gray>' ''Display *XOpenDisplay(char *display_name)'' | <FONT Color=gray>' ''Display *XOpenDisplay(char *display_name)'' | ||
' ''Opens a connection to the X server that controls a display.''</font> | ' ''Opens a connection to the X server that controls a display.''</font> | ||
− | Private Extern XOpenDisplay( | + | Private Extern XOpenDisplay(display_name As String) As Pointer |
<FONT Color=gray>' ''XMoveWindow(Display *display, Window w, int x, int y)'' | <FONT Color=gray>' ''XMoveWindow(Display *display, Window w, int x, int y)'' | ||
' ''Moves the specified window to the specified x and y coordinates.''</font> | ' ''Moves the specified window to the specified x and y coordinates.''</font> | ||
− | Private Extern XMoveWindow( | + | Private Extern XMoveWindow(display As Pointer, w As Long, x As Integer, y As Integer) |
<FONT Color=gray>' ''XCloseDisplay(Display *display)'' | <FONT Color=gray>' ''XCloseDisplay(Display *display)'' | ||
' ''Closes the connection to the X server for the display specified in the Display structure and destroys all windows.''</font> | ' ''Closes the connection to the X server for the display specified in the Display structure and destroys all windows.''</font> | ||
− | Private Extern XCloseDisplay( | + | Private Extern XCloseDisplay(display As Pointer) |
Versione delle 18:26, 27 mag 2016
Per muovere all'interno del desktop la finestra di un programma esterno si può utilizzare la funzione XMoveWindow() della libreria condivisa (nella sua attuale versione) libX11.so.6.3.0 .
Tale funzione esterna richiede, fra l'altro, la specificazione del numero identificativo della finestra del programma da chiudere.
Mostriamo un esempio essenziale:
Library "libX11:6.3.0" ' Display *XOpenDisplay(char *display_name) ' Opens a connection to the X server that controls a display. Private Extern XOpenDisplay(display_name As String) As Pointer ' XMoveWindow(Display *display, Window w, int x, int y) ' Moves the specified window to the specified x and y coordinates. Private Extern XMoveWindow(display As Pointer, w As Long, x As Integer, y As Integer) ' XCloseDisplay(Display *display) ' Closes the connection to the X server for the display specified in the Display structure and destroys all windows. Private Extern XCloseDisplay(display As Pointer) Public Sub Main() Dim disp As Pointer ' Connessione al server X ed impostazione di default: disp = XOpenDisplay(Null) XMoveWindow(disp, num_ID_della_finestra, 300, 400) ' Chiude la libreria: XCloseDisplay(disp) End