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.
(4 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 1: | Riga 1: | ||
− | Per spostare e modificare le dimensioni della finestra di un programma esterno si può utilizzare la funzione ''XMoveResizeWindow()'' della libreria condivisa | + | Per spostare e modificare le dimensioni della finestra di un programma esterno si può utilizzare la funzione ''XMoveResizeWindow()'' della libreria condivisa: "''libX11.so.6.4.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. | 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: | Mostriamo un esempio essenziale: | ||
− | Library "libX11:6. | + | Library "libX11:6.4.0" |
− | <FONT Color=gray>' ''Display *XOpenDisplay(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 Pointer) As Pointer |
− | <FONT Color=gray>' ''XMoveResizeWindow(display, w, x, y, width, 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( | + | Private Extern XMoveResizeWindow(display As Pointer, w As Long, x As Integer, y As Integer, width As Integer, height As Integer) |
− | <FONT Color=gray>' ''XCloseDisplay(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) |
− | + | Public Sub Main() | |
Dim disp As Pointer | Dim disp As Pointer | ||
<FONT Color=gray>' ''Connessione al server X ed impostazione di default:''</font> | <FONT Color=gray>' ''Connessione al server X ed impostazione di default:''</font> | ||
− | + | disp = XOpenDisplay(0) | |
+ | If disp == 0 Then Error.Raise("Errore !") | ||
− | + | <FONT Color=red>XMoveResizeWindow</font>(disp, <FONT Color=gray>''num_ID_della_finestra''</font>, 50, 200, 600, 100) | |
<FONT Color=gray>' ''Chiude la libreria:''</font> | <FONT Color=gray>' ''Chiude la libreria:''</font> | ||
− | + | XCloseDisplay(disp) | |
− | + | End | |
− | |||
Versione attuale delle 17:01, 28 giu 2024
Per spostare e modificare le dimensioni della finestra di un programma esterno si può utilizzare la funzione XMoveResizeWindow() della libreria condivisa: "libX11.so.6.4.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.4.0" ' Display *XOpenDisplay(char *display_name) ' Opens a connection to the X server that controls a display. Private Extern XOpenDisplay(display_name As Pointer) 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(display 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(display As Pointer) Public Sub Main() Dim disp As Pointer ' Connessione al server X ed impostazione di default: disp = XOpenDisplay(0) If disp == 0 Then Error.Raise("Errore !") XMoveResizeWindow(disp, num_ID_della_finestra, 50, 200, 600, 100) ' Chiude la libreria: XCloseDisplay(disp) End