Differenze tra le versioni di "Muovere e modificare le dimensioni della finestra di un programma con le funzioni del API di X11"
Da Gambas-it.org - Wikipedia.
Riga 13: | Riga 13: | ||
<FONT Color=gray>' ''XMoveResizeWindow(Display *display, Window w, int x, int y, unsigned int width, unsigned int height)'' | <FONT Color=gray>' ''XMoveResizeWindow(Display *display, Window w, int x, int y, unsigned int width, unsigned int height)'' | ||
' ''Changes the size and location of the specified window without raising it.''</font> | ' ''Changes the size and location of the specified window without raising it.''</font> | ||
− | Private Extern XMoveResizeWindow(displayP As Pointer, w As | + | Private Extern XMoveResizeWindow(displayP As Pointer, w As Long, x As Integer, y As Integer, width As Integer, height As Integer) |
<FONT Color=gray>' ''XCloseDisplay(Display *display)'' | <FONT Color=gray>' ''XCloseDisplay(Display *display)'' |
Versione delle 10:16, 24 nov 2014
Per spostare e modificare le dimensioni della finestra di un programma esterno si può utilizzare la funzione XMoveResizeWindow() della libreria condivisa (nella sua attuale versione) libX11.so.6.3.0 .
Tale funzione esterna non modifica le dimensioni dei bordi della finestra, e 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$ As String) As Pointer ' XMoveResizeWindow(Display *display, Window w, int x, int y, unsigned int width, unsigned int height) ' Changes the size and location of the specified window without raising it. Private Extern XMoveResizeWindow(displayP As Pointer, w As Long, x As Integer, y As Integer, width As Integer, height 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(displayP As Pointer) Public Sub Main() Dim disp As Pointer ' Connessione al server X ed impostazione di default: disp = XOpenDisplay(Null) XMoveResizeWindow(disp, num_ID_della_finestra, 50, 200, 600, 100) ' Chiude la libreria: XCloseDisplay(disp) End