AlfredoSC 12-05-2021, 02:59
Hola:

Al ejecutar Gambas3 y elegir un "Nuevo Proyecto", aparecen, entre otros, 4 tipos de Aplicación:

1.- Aplicación Gráfica.- Una aplicación gráfica.
2.- Aplicación GTK+ 2.- Una aplicación gráfica usando el componente GTK+ 2.
3.- Aplicación GTK+ 3.- Una aplicación gráfica usando el componente GTK+ 3, y
4.- Aplicación QT.- Una aplicación gráfica que usa QT5 o QT4 si el primero no se encuentra en el sistema.

Mi primer diseño con Gambas fue con el (1) hace ya tiempo. en un momento dado, algún control no aparecía y entonces traté con el (2)...Me he quedado ahí, haciendo mis proyectos con GTK+ 2.

Sin embargo, me gustaría saber de una manera muy somera y concisa, cual debería ser el criterio para elegir una de las 4. Que es lo que debe plantearse uno para decidirlo?

Saludos....

PD.- Está claro que lo recomendable es leer y re-leer los temas relativos a cada uno, hasta que me quede alguna noción sobre cada tipo de aplicación. Pero sabiendo que por aquí hay expertos que ya tienen esa información totalmente asimilada, pues busco eso y entonces ya me remitiré a leer aquello.
vuott 11-05-2021, 16:30
Hola mis hermanos del Mediterraneo,
os dejo un simple código que, usando las funciones externas de la libreria libgio-2.0, cuando se pasa el ratón sobre los íconos de archivo en el Escritorio, devuelve información sobre estos archivos.
Hace falta activar el Componente gb.desktop .
(No se si en la ruta de la Constante "PERCORSO" la palabra "Escritorio" está bien)

Código:
Public Struct IconaFileDesktop
  nome As String
  x As Short
  y As Short
  rt As Rect
End Struct
Private icone As New IconaFileDesktop[]
Private PERCORSO As String = User.home &/ "Escritorio"
Private T As Timer


Public Sub Form_Open()
 
  Dim nomefile, s As String
  Dim ifd As IconaFileDesktop
 
' Carica tutti i file corrispondenti alle icone presenti sulla Scrivania:
  For Each nomefile In Dir(PERCORSO, "*", gb.File)
' Usa con "Extern" alcune funzioni esterne della libreria "libgio-2.0":
    s = EstraeInfo(PERCORSO &/ nomefile)
    If IsNull(s) Then Continue
' Carica nella "Struttura" i dati utili del file individuato dalla funzione "Dir()":
    With ifd = New IconaFileDesktop
      .nome = nomefile
      .x = Val(Scan(s, "*,*")[0])
      .y = Val(Scan(s, "*,*")[1])
' Stabilisce un'area quadrata standard di 48 pixel per ciascuna icona di file individuato:
      .rt = New Rect(.x, .y, 48, 48)
    End With
    icone.Push(ifd)
  Next
 
  T = New Timer As "Tmr"
  T.Delay = 50
  T.Start

End

Public Sub Tmr_Timer()
 
  Dim c As Short
 
  TextArea1.Clear
 
  For c = 0 To icone.Max
' Se le coordinate x,y in pixel correnti in cui si trova il puntatore del mouse rientrano in un'area quadrata caricata, va a vedere a quale icona e file appartiene:
    If icone[c].rt.Contains(Mouse.ScreenX, Mouse.ScreenY) Then
' Mostra alcune caratteristiche del file al quale corrisponde l'icona sorvolata dal puntatore del mouse:
      TextArea1.Text = "== Características del archivo ==\n" &
                       "\nRuta:          " & Stat(PERCORSO &/ icone[c].nome).Path &
                       "\nTamaño:          " & Stat(PERCORSO &/ icone[c].nome).Size & " Byte" &
                       "\nÚltimo acceso:          " & Stat(PERCORSO &/ icone[c].nome).LastAccess &
                       "\nÚltima modificación: " & Stat(PERCORSO &/ icone[c].nome).LastModified &
                       "\nPermisos:          " & Stat(PERCORSO &/ icone[c].nome).Auth &
                       "\nUsuario:          " & Stat(PERCORSO &/ icone[c].nome).User &
                       "\nGrupo:          " & Stat(PERCORSO &/ icone[c].nome).Group &
                       "\nMimetype icono:  " & DesktopMime.FromFile(Stat(PERCORSO &/ icone[c].nome).Path).Type
    Endif
  Next
 
End


Library "libgio-2.0"

' GFile * g_file_new_for_commandline_arg (const char *arg)
' Creates a GFile with the given argument from the command line.
Private Extern g_file_new_for_commandline_arg(arg As String) As Pointer

' GFileInfo * g_file_query_info (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error )
' Gets the requested information about specified file.
Private Extern g_file_query_info(gfile As Pointer, attributes As String, flags As Integer, cancellable As Pointer, gerror As Pointer) As Pointer

' char ** g_file_info_list_attributes (GFileInfo *info, const char *name_space)
' Lists the file info structure's attributes.
Private Extern g_file_info_list_attributes(info As Pointer, name_space As String) As Pointer

' char * g_file_info_get_attribute_as_string (GFileInfo *info, const char *attribute)
' Gets the value of a attribute, formatted as a string.
Private Extern g_file_info_get_attribute_as_string(info As Pointer, attribute As String) As Pointer

' void g_object_unref (gpointer object)
' Decreases the reference count of object.
Private Extern g_object_unref(gobject As Pointer)


Private Function EstraeInfo(percfile As String) As String
 
  Dim fl, info As Pointer
 
  fl = g_file_new_for_commandline_arg(percfile)
  If fl == 0 Then Error.Raise("Errore !")
    
  info = g_file_query_info(fl, "*", 0, Null, Null)
  If info == 0 Then Error.Raise("Errore !")
    
  percfile = EstraeAttributi(info)
    
  g_object_unref(info)
  g_object_unref(fl)
 
  Return percfile

End


Private Function EstraeAttributi(inf As Pointer) As String
 
  Dim attr, p As Pointer
  Dim i As Integer = -1
  Dim s As String
 
  attr = g_file_info_list_attributes(inf, Null)

  Repeat
    Inc i
    s = String@(Pointer@(attr + (i * SizeOf(gb.Pointer))))
    p = g_file_info_get_attribute_as_string(inf, s)
  Until s == Trim("metadata::nemo-icon-position")

  Return String@(p)
 
End
gambafeliz 11-05-2021, 13:59
Hola

Alguien controla la manera de hacer un formulario y su contenido elástico? ¿como se hace?

Gracias
Páginas (566):    1 444 445 446 447 448 566   
Bienvenido, Invitado
Tienes que registrarte para poder participar en nuestro foro.
Recordarme?
Miembros: 295
Último miembro: ncofre98
Temas del foro: 1,748
Mensajes del foro: 9,072
Últimos temas
Problemas con las interru...
Foro: General
Último mensaje por: guizans, 14-12-2025, 18:40
Respuestas: 5 - Vistas: 239
Scrolling un ScrollArea
Foro: Controles/Librerías/Componentes
Último mensaje por: Shordi, 12-12-2025, 07:24
Respuestas: 5 - Vistas: 249
Ordenar en un TableView
Foro: General
Último mensaje por: guizans, 08-12-2025, 23:06
Respuestas: 9 - Vistas: 943
Resultados dispares según...
Foro: Bases de Datos
Último mensaje por: guizans, 04-12-2025, 22:49
Respuestas: 6 - Vistas: 399
Mover un Result a una pos...
Foro: Bases de Datos
Último mensaje por: guizans, 30-11-2025, 19:25
Respuestas: 2 - Vistas: 224
Powered By MyBB, © 2002-2025 MyBB Group.
Made with by Curves UI.