Skip to content

Perl 6 interface to the IUP toolkit for building graphical user interfaces

License

Notifications You must be signed in to change notification settings

hankache/perl6-IUP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perl 6 IUP IUP Logo

Perl 6 interface to the IUP toolkit for building GUI's.

Operating System Build Status
Linux Build Status

Description

IUP is a multi-platform toolkit for building graphical user interfaces. IUP's purpose is to allow a program source code to be compiled in different systems without any modification. Its main advantages are:

  • It offers a simple API.
  • High performance, due to the fact that it uses native interface elements.
  • Fast learning by the user, due to the simplicity of its API.

Installation

Get the IUP library and install it:

mkdir libiup
cd libiup
curl -L https://sourceforge.net/projects/iup/files/3.25/Linux%20Libraries/iup-3.25_Linux44_64_lib.tar.gz > libiup.tar.gz
tar xvzf libiup.tar.gz
sudo bash install
sudo bash install_dev
cd ..

Install the Perl 6 module with Zef:

zef update
zef install IUP

Synopsis

WARNING:
This module is in its early stages and should be considered a Work in Progress. The interface is not final and may change in the future.

Sample GUI:

Hello World IUP Application

Sample code:

use IUP;

my @argv = ("Test");

#
# initialize iup
#

my $iup = IUP.new();

$iup.image_lib_open();
$iup.open(@argv);

#
# create widgets and set their attributes
#

my $btn = $iup.button("&Ok", "");

$btn.set_callback("ACTION", &exit_callback);

$btn.set_attribute("IMAGE", "IUP_ActionOk");
$btn.set_attribute("EXPAND", "YES");
$btn.set_attribute("TIP", "Exit button");

my $lbl = $iup.label("Hello, world!");

my $vb = $iup.vbox($lbl, $btn);
$vb.set_attribute("MARGIN", "10x10");
$vb.set_attribute("GAP", "10");
$vb.set_attribute("ALIGNMENT", "ACENTER");

my $dlg = $iup.dialog($vb);
$dlg.set_attribute("TITLE", "Hello");

#
# Map widgets and show dialog
#

$dlg.show();

#
# Wait for user interaction
#

$iup.main_loop();

#
# Clean up
#

$dlg.destroy();
$iup.close();

exit();

sub exit_callback() returns Int {
	return IUP_CLOSE;
}

Author

Henrique Dias mrhdias@gmail.com

See Also

License

This library is free software; you can redistribute it and/or modify it under the same terms as Perl 6 itself.

About

Perl 6 interface to the IUP toolkit for building graphical user interfaces

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 81.8%
  • C 15.5%
  • Makefile 2.7%