Where can I learn advanced (Perl) Gtk2 design? [closed] - perl

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I've been working with Perl for years and recently started learning how to do GUI via Gtk2. All examples and tutorials I've found illustrate simple one-window type applications. Anything with a second window is limited to a simple text entry or yes/no type dialogue. I want to learn how to build something with that next-step more complex. I know how to build the windows, etc. (manually, or via Glade) but I don't understand how to tie the program flow together.
I'm willing to buy books, etc. but I've only seen ones for C (and not in-stock, I'd have to order them unseen) and I'm worried the differences to Perl::Gtk2 might still add too much complexity. Can anyone either provide me an example, or point me to a tutorial, etc.
Thanks much,
Adam

I've been doing Perl/GTK development for a couple years now and know what your talking about. Gtk2::Ex::FormFactory is a neat module but wasn't really my thing and definitely not necessary for building a complex Perl/GTK app. All widgets, including windows, in Perl/GTK support the show/hide method. Plus you can have as many toplevel windows as you want and just show and hide them as needed. Here's a simple example of switching between multiple windows:
#!/usr/bin/perl
use Glib qw/TRUE FALSE/;
use Gtk2 '-init';
$window = Gtk2::Window->new('toplevel');
$window->signal_connect(delete_event => sub { Gtk2->main_quit; });
$window->set_border_width(10);
$window->set_title("Window 1");
$window->set_position('center');
$button = Gtk2::Button->new("Switch to Window 2");
$button->signal_connect(clicked => sub {
$window->hide;
$window2->show;
});
$window->add($button);
$button->show;
$window2 = Gtk2::Window->new('toplevel');
$window2->signal_connect(delete_event => sub { Gtk2->main_quit; });
$window2->set_border_width(10);
$window2->set_title("Window 2");
$window2->set_position('center');
$button2 = Gtk2::Button->new("Switch to Window 1");
$button2->signal_connect(clicked => sub {
$window2->hide;
$window->show;
});
$window2->add($button2);
$button2->show;
$window->show;
Gtk2->main;

Check out Gtk2::Ex::FormFactory for writing consistent, data-driven Gtk applications, also look here for more information. Basically Gtk2::Ex::FormFactory helps you build applications rather than single screens. As the Gtk2::Ex::FormFactory widgets are simple wrappers over the Gtk2 classes, and the Perl Gtk2 classes are fairly simple wrappers over the C classes (except where the idioms are made more perlish), C-level experience in the Gtk libraries should not confuse you, in fact, the perl Gtk+2 manuals refer you back to the Gtk+2 Reference manual. See Gtk2::api for the differences.

Related

Is there an embeddable code editor for Elm? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 11 months ago.
Improve this question
I want to have a code editor widget, like CodeMirror or Ace, in my Elm webpage. Unfortunately, CodeMirror and Ace don't work with Elm as they modify the DOM (at least that's my understanding why they don't work).
I need something at least better than <textarea> for students to submit code. And for us to display code. Just automatic indenting and syntax highlighting for now.
I personally found elm-ace very useful.
It requires some native code, so you will not be able to install it with elm package install. Instead copy the relevant source tree to yours and change your elm-package.json to include "native-modules": true like this.
While using this library, make sure you have manually added ace.js to index.html.
Once you have that setup, you can get a code editor this way:
view : Model -> Html Msg
view model =
div []
[ Ace.toHtml
[ Ace.onSourceChange UpdateSource
, Ace.value model.source
, Ace.mode "lua"
, Ace.theme model.theme
, Ace.enableBasicAutocompletion True
, Ace.enableLiveAutocompletion True
, Ace.enableSnippets True
, Ace.tabSize 2
, Ace.useSoftTabs False
, Ace.extensions [ "language_tools" ]
]
[]
]
I'm not sure if it's embeddable but I've heard a lot of good things about Ellie. Another consideration may to be the Monaco Editor which I believe was the basis for Microsoft's VSCode product as well as the code editor embedded into some parts of Microsoft Azure.

LimeJS vs CreateJS for game development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to start developing HTML5/JS games. And I see these 2 frameworks LimeJS and CreateJS & EaselJS. Which one is better? Does anyone have experience with these 2 frameworks? And what about the documentation?
Yes, I experienced both unfortunately.
Limejs :
1 . You should have python installed to compile and run the code.
2 . You should manually use other javascripts inorder to preload
all the assets before the game gets start or else there will be
chance to slower the game animations.
3 . The compiled code is non human readable so that your code
cannot be understandable to third party users. The compilation
is done using python
4 . Issue with audio on different browsers in different
levels.
5 . No other resources other than Developers
API
CreateJS
1 . You can directly use javascript for html and run.
2 . CreateJS itself haves PreLoadJS,TweenJs,EaselJS,SoundJS so you
can render loaders and audio easily
3 . No compilation less security in case of javascript file
4 . You will be using soundjs for loading audio.
5 . Has their own API for each Tween,Easel,Sound and
Preload
Last and Finally compare to LimeJs, Many developers use Createjs for developing games including me.
The Breakouts project might help. It's sort of like TodoMVC in that they take a simple game of Breakout and implement it in different frameworks.
It covers Easel/CreateJS, LimeJS and 10 other popular frameworks.
I'm using EaselJS and personally I'm very happy with it, it's activly developed and also supported by Adobe and Microsoft.
As a possible alternative you could take a look at http://kineticjs.com
If you are interested in getting started with EaselJS you can take a look at my tutorial-series: http://indiegamr.com/retro-style-plattform-runner-game-for-mobile-with-easeljs-part-1/
(They are slightly out of date, as they where written for the previous verison of EaselJS, but still do work with the current version)
I've just started developing games with EaselJS, seems easy if you know JS at some level.
The lack of real world examples is a minus, but there are plenty of tutorials on basic usages of framework. And yeah, there is lots of good documentation on Easel on their website.
http://www.createjs.com/Docs/EaselJS/
Their SoundJS and TweenJS are also very impressive libraries, take a look at them ;)
CreateJS is right tool to get started quickly. We are using HTML5 to create games with Javascript and HTML and that's why no reason to get involved with Python in LimeJS.
The documentation for CreateJS got a huge update in February/2013, and there are a bunch of tutorials for EaselJS that can help get you started.

How to set print and save as pdf icon in TYPO3 pages [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Can anybody help me that how can i set PRINT and save as PDF icon(functionality) in TYPO3 pages ?
Thanks...in advance..
There are many examples in Google and I think that you should browse them, to find the one the best fits your needs.
In general 'historically' print version was suggested to be build with new PAGE cObject which typeNum is set to 98 (of course that's only suggestion) in general going this clue, you should find many examples and other resources by searching in Google for typo3 typeNum 98.
When you'll create alternative PAGE object (and maybe also use modified template for it) you need also add on your webpage a link which be the same as the current URL but with additional param &type=98, when user will click it TYPO3 will open the alternative version of the page. So you can add to this a JS in header which will also start system's print dialog.
You can also search the extensions repository and find something for placing the print button if you are unfamiliar with TypoScript.
PDF rendering is similar from point of view of the frontend, however most probably you need to use some additional lib, so it will be best to search for ready to use solution from the repo.
In general PDF version could be tricky, therefore from my experience I can say that nowadays it's sometimes better to avoid the PDF icon at all or use linking to some external service. Of course all depends on your needs. Remember that there are many programs which are able to create PDF's so if it is not required maybe it's no worth of its effort.
Finally take a look at the AddThis widget it can be also used for easy adding of icons for printing and online PDF creation, additionally you can also send invitations via e-mail, or even share the link on the hundreds social portals. And what's most important installing this is just like adding view lines of HTML code vie TypoScript.

CSS-to-HTML Email converter [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm on a project where we're going to be sending HTML emails. I've done dozens of projects where we send plaintext emails but for some unknown reason, I've never had to do HTML emails.
I "grew up" with tables. I used to use them for layout development. Then CSS came along with its "layers" as we called them back then, and I changed my ways pretty rapidly. By 2002, I wasn't using tables for layouts at all.
We're almost a decade on and I've been writing pretty good code consistently. I'm now faced by something quite terrifying: writing bad code on purpose. I'm not sure if my mind or fingers will allow it.
So instead of starting by writing bad code, can I write my emails like I would with any other design-build-out: with beautiful divs and CSS, and then use something evil to convert it all out? I realise this might cause issues with background images (of which there may be a couple), but I'm sure I can man-up enough to "fix" those.
I should add that we will have a number of dynamic emails being generated and a newsletter-sender. Ideally this should be something I can plug onto the end of that process so emails get generated in "standards mode", then flown through Mordor to come out the other side as beastly 90's HTML.
There is no way to autmatically turn css and div based HTML pages into working tables that work in emails.
And you probably already know normal CSS style tag is not working in webmail like gmail and hotmail.
But most email clients support embedded css, yes I know its not something you would like to do in any normal page but for email its the only way to avoid having to use font tags.
Here is a page with some of the css and what clients it works in
http://www.campaignmonitor.com/css/
But for layout, tables is the only stable way to go for any more complex layout, especially if you like multiple columns or borders but my advice after 10 year of coding for emails is to try to keep it as simple as possible, think typewriter style letters with a few images, a header and footer and no more, that almost always work.
Try premailer.. http://premailer.dialect.ca/ its written in rb.. if you want the same in php.. then try https://gist.github.com/1204853
There's a tool called Premailer which might be a step in the right direction.
You still can't use divs and floats but it at least alleviates the need for writing your styles inline. You just write your styles in a <style> tag and it'll inline-ify them for you.
https://github.com/alexdunae/premailer
found out something http://www.pelagodesign.com/sidecar/emogrifier/ .. its written is php.. and its awesome... :)

Any good tools for creating timelines? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I need to create a historical timeline starting from 1600's to the present day. I also need to have some way of showing events on the timeline so that they do not appear cluttered when many events are close together.
I have tried using Visio 2007 as well as Excel 2007 Radar Charts, but I could not get the results I wanted. the timeline templates in Visio are not great and using Radar charts in Excel leads to cluttered data.
Are there any other tools or techniques I could use to create these?
#Darren:
The first link looks great. Thanks! The second link did not work in Firefox and was rendered as ASCII. It opened up fine in IE.
And yes, this is for the end users. So I want it to look as presentable as possible, if you know what I mean.
Thanks again!
SIMILIE Timeline would probably suit your needs.
http://simile.mit.edu/timeline/
Timeline .NET: http://www.codeplex.com/timelinenet
Oh, i guess i should ask... for personal use or for display to end users? that might change what i would suggest, but this could work for internal purposes too i suppose.
Lifehacker has a good overview and tutorial of SIMILIE Timeline. They seem to like it quite a bit.
If you need a timeline from RSS Feeeds give xTimeline a try. I just used it
http://lifehacker.com/software/rss/create-a-timeline-from-rss-feeds-with-xtimeline-283098.php
#Pascal this page? http://tools.mscorlib.com/timeline/Default.aspx. If it's looking like ascii maybe look for a js error, but that renders on my system fine. If all else fails, it's a decent js library by the MIT team as it is, so you could wire up your own implementation
I also recommend Simile Timeline... I just implemented a webpage that uses it and JQuery and produces fantastic results. The downside is that you need to implement it through some html page, hook it up with the js and create some xml files, so it probably won't do for a presentational tool.
http://infosthetics.com/ is a good data visualization blog, maybe you find something there. Also check flowingdata.com
For webbased timelines, there is also:
circavie: http://flowingdata.com/2007/10/25/create-share-and-embed-custom-timelines-with-circavie/
dipity (looks killer): http://flowingdata.com/2008/08/18/tell-stories-with-interactive-timelines-from-dipity/
You can used this great timeline tool built with JavaScript.
You can download it for free here: http://timeline.verite.co/#examples