Skip to content

Instantly share code, notes, and snippets.

@anaselli
anaselli / test_yitems.py
Created August 31, 2015 14:06
YItem comparison in python
import sys
import yui
factory = yui.YUI.widgetFactory()
dialog = factory.createMainDialog()
VBox = factory.createVBox(dialog)
mySelMinSize = factory.createMinSize(VBox, 50, 12)
mySel = factory.createSelectionBox(mySelMinSize, "Selection Box")
@anaselli
anaselli / test_yitems.pl
Created August 31, 2015 14:04
YItem comparison in perl
use yui;
my $factory = yui::YUI::widgetFactory;
my $dialog = $factory->createMainDialog;
my $vbox = $factory->createVBox( $dialog );
my $selMinSize = $factory->createMinSize($vbox, 50, 12);
my $sel = $factory->createSelectionBox($selMinSize, "Selection Box");
@anaselli
anaselli / seek_tail.patch
Created May 15, 2015 15:33
Possible Linux::Systemd::Journal::Read::seek_tail patch
diff --git a/lib/Linux/Systemd/Journal/Read.pm b/lib/Linux/Systemd/Journal/Read.pm
index c24bfbd..f799cb2 100644
--- a/lib/Linux/Systemd/Journal/Read.pm
+++ b/lib/Linux/Systemd/Journal/Read.pm
@@ -42,7 +42,7 @@ Seeks to the end of the open journal.
sub seek_tail {
my $self = shift;
- __seek_tail($self->_j);
+ __seek_tail();
@anaselli
anaselli / Test-YTree-multiselection.cpp
Last active August 29, 2015 14:17
test file to show that multiselection works on sub tree item with proposed patch
/*
* Copyright (c) 2015 Angelo Naselli <anaselli@linux.it>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@anaselli
anaselli / BUILD_ARCH.patch
Created March 18, 2015 09:03
Orion context broker build arch patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4996227..5705083 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,11 +130,11 @@ include_directories("/usr/include")
# Library directories
#
MESSAGE("Building for ${BUILD_ARCH}")
-if (${BUILD_ARCH} STREQUAL "x86_64")
+if ("${BUILD_ARCH}" STREQUAL "x86_64")
@anaselli
anaselli / Test-YTree-selection.cpp
Created February 20, 2015 14:04
test file to show that sub tree item are not selected
/*
* Copyright (c) 2014 Angelo Naselli <anaselli@linux.it>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
diff --git a/swig/yui.i b/swig/yui.i
index ec38584..8373555 100644
--- a/swig/yui.i
+++ b/swig/yui.i
@@ -270,6 +270,15 @@ class Exception;
}
#endif
+%extend YItem {
+#if defined(SWIGPERL5)
@anaselli
anaselli / LinkOnRichText.patch
Created November 7, 2014 12:01
Patch to workaround ncurses problem on RichText link management
iff --git a/src/NCRichText.cc b/src/NCRichText.cc
index ca1ded0..ba82fd5 100644
--- a/src/NCRichText.cc
+++ b/src/NCRichText.cc
@@ -276,7 +276,8 @@ NCursesEvent NCRichText::wHandleInput( wint_t key )
std::string str;
NCstring::RecodeFromWchar( anchors[armed].target, "UTF-8", &str );
yuiMilestone() << "LINK: " << str << std::endl;
- ret.selection = new YMenuItem( str );
+ ret.result = str;
/*
Copyright (c) 2014 Angelo Naselli <anaselli@linux.it>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: