Differenze tra le versioni di "Modificare le dimensioni della finestra di un programma con le funzioni del API di X11"

Da Gambas-it.org - Wikipedia.
Riga 7: Riga 7:
 
  Library "libX11:6.3.0"
 
  Library "libX11:6.3.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(display$ As String) As Pointer
 
  Private Extern XOpenDisplay(display$ As String) As Pointer
 
   
 
   
  <FONT Color=gray>' ''XResizeWindow(display, w, x, y)''
+
  <FONT Color=gray>' ''XResizeWindow(Display *display, Window w, unsigned int x, unsigned int y)''
 
  ' ''Changes the inside dimensions of the specified window, not including its borders.''</font>
 
  ' ''Changes the inside dimensions of the specified window, not including its borders.''</font>
 
  Private Extern XResizeWindow(displayP As Pointer, w As Integer, width As Integer, height As Integer)
 
  Private Extern XResizeWindow(displayP As Pointer, w 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(displayP As Pointer)
 
  Private Extern XCloseDisplay(displayP As Pointer)

Versione delle 09:51, 24 nov 2014

Per modificare le dimensioni della finestra di un programma esterno si può utilizzare la funzione XResizeWindow() 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

' XResizeWindow(Display *display, Window w, unsigned int x, unsigned int y)
' Changes the inside dimensions of the specified window, not including its borders.
Private Extern XResizeWindow(displayP As Pointer, w 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)

  XResizeWindow(disp, num_ID_della_finestra, 50, 200)

' Chiude la libreria:
  XCloseDisplay(disp)

End



Riferimenti