Skip to content

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

Notifications You must be signed in to change notification settings

dwarring/perl6-IUP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

perl6-IUP

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

Description

Perl 6 interface to the IUP toolkit. 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

You will need the Linux libraries libiup and libiupimglib installed in order to use perl6-IUP (version 3). You can download the library binaries or sources for your platform from here.

To install with the Zef tool.

zef update
zef install IUP

To run a script that uses the IUP library.

PERL6LIB=$HOME/.perl6/2013.02.1/lib LD_LIBRARY_PATH=$HOME/.perl6/2013.02.1/lib ./hello.p6

Synopsis

WARNING: This module is Work in Progress and is in a early stage, which means: this interface is not final. This will perhaps change in the future.
A sample of the code can be seen below.

Hello World IUP Application

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 [email protected]

See Also

License

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 82.0%
  • C 15.3%
  • Makefile 2.7%