Skip to content

Instantly share code, notes, and snippets.

View angstyloop's full-sized avatar

Sean Allen angstyloop

View GitHub Profile
/** example-3.c
*
* COMPILE
*
* gcc `pkg-config --cflags gtk4` -o example-3 example-3.c `pkg-config --libs gtk4`
*
* EXAMPLE
*
* ./example-3
*
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object id="window" class="GtkWindow">
<property name="title">Grid</property>
<child>
<object id="grid" class="GtkGrid">
<child>
<object id="button1" class="GtkButton">
<property name="label">Button1</property>
<layout>
@angstyloop
angstyloop / tooltip.c
Created March 30, 2023 06:56
GTK4 tooltip example
/** tooltip.c
*
* COMPILE
*
* gcc `pkg-config --cflags gtk4` -o tooltip tooltip.c `pkg-config --libs gtk4`
*
* RUN
*
* ./tooltip
*/
@angstyloop
angstyloop / install_virtualbox_on_debian_based_linux.sh
Created March 30, 2023 11:24
Install VirtualBox Version 7.0 on Debian-based Linux
#!/bin/bash
# install_virtualbox_on_debian_based_linux.sh
# Install VirtualBox Version 7.0 on Debian-based Linux
# Add a line for the oracle virtualbox debian package to /etc/apt/sources.list
# (you can use echo/append). Replace "jammy" with your distribution name.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
@angstyloop
angstyloop / create-windows-enterprise-vm-from-iso.sh
Created March 30, 2023 11:39
Use VBoxManage to create a VirtualBox VM from an evaluation copy of Windows 10 Enterprise ISO.
#!/bin/sh
# create-windows-enterprise-vm-from-iso.sh
# Use VBoxManage to create a VirtualBox VM from an evaluation copy of Windows 10
# Enterprise ISO.
# Follow the download instructions for your region at
#
# https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise
@angstyloop
angstyloop / scrolledwindow.c
Created March 31, 2023 00:28
Example of putting a widget ( specifically a GtkLabel ) in a GtkScrolledWindow.
/* scrolledwindow.c
*
* Example of putting a GtkLabel in a GtkScrolledWindow.
*
* COMPILE
*
* gcc `pkg-config --cflags gtk4` -o scrolledwindow scrolledwindow.c `pkg-config --libs gtk4`
*
* RUN
*
@angstyloop
angstyloop / infobar.c
Last active May 4, 2023 05:09
Basic usage of ( now deprecated, but still incredibly useful, in GTK 4 ) GtkInfoBar widget as a "toast".
/** infobar.c
*
* COMPILE
*
* gcc `pkg-config --cflags gtk4` -o infobar infobar.c `pkg-config --libs gtk4`
*
* RUN
*
* ./infobar
*
@angstyloop
angstyloop / metadata.c
Last active May 12, 2023 09:15
Print all image metadata with VIPS
/*
Print metadata with VIPS
COMPILE
gcc -o metadata metadata.c `pkg-config --libs --cflags vips`
RUN
@angstyloop
angstyloop / popover.c
Created May 12, 2023 07:14
GTK4 Example: Popover containing a TextView
/** popover.c
*
* COMPILE
*
* gcc `pkg-config --cflags gtk4` -o popover popover.c `pkg-config --libs gtk4`
*
* RUN
*
* ./popover
*/
@angstyloop
angstyloop / metadata-popover.c
Last active May 12, 2023 09:39
Use VIPS to show the metadata of a test image in a non-editable GTK4 4 popover text view.
/*
Use VIPS to show the metadata of a test image in a non-editable GTK4
popover text view.
COMPILE
gcc `pkg-config --cflags gtk4 vips` -o metadata-popover metadata-popover.c `pkg-config --libs gtk4 vips`
RUN