How can I see the code behind all the widgets on a NetLogo Interface? - netlogo

I am looking at a NetLogo model with lots of widgets. Which of them have code behind them? What global variables are hidden behind them? Which procedures do they call? How do I find out?
Solution (1): Open each widget one at a time, then look at what's back there. Make notes because I have to close this one to open the next one.
Solution (2): View the nlogo file in a text editor, scrolling down past the Code section, and dig out the widget code from all those numbers.
Neither of those solutions are very pleasant or fast.
What I would like is a quick way to see what lurks behind the widgets on the Interface. Is there a tool that will do that?

Yes! (update Jan 2017)
At [modelingcommons.org][1], download nivi.
nivi stands for "NetLogo Interface Variables Information". It is a NetLogo 6.0 file that parses the information about the widgets into a report that you can read on the screen or copy/paste.
It requires version 6.0 of NetLogo, but will use files created by earlier versions of NetLogo as data.
[1] http://modelingcommons.org/browse/one_model/4962

Related

QgsRelationEditorWidget configuration example with python code

I'm learning to use python to control forms in a Qgis project where I use some QgsRelationEditorWidgets to edit attributes of entities in various related layers.
I need information (if possible, some code example) on how to control the Widget with phyton: select the editing buttons to show, activate/deactivate these buttons depending on whether the entity is being edited, etc.
Any idea or reference where to look?
Thanks in advance.

Weston : Customize composition to duplicate window display

I want to be able to duplicate a window at the compositor/window manager level.
That is, when the user open a weston-terminal, I want to display it as 2 windows, and be able to apply movement/rotation to those windows.
To emphasize, I don't want to have 2 weston-terminal open, I really need to duplicate the window's content on screen.
Is that possible with weston and where should I look in the code?
I already compiled it and learned to rotate/move windows using weston-shell.c but don't know where to look after.
This isn't possible with the Weston implementation, in the manner you've described. You'd have to hack your own Weston implementation to do this, such that one client can bind to multiple surfaces.
An alternative to consider is to have a surface and subsurface, and have you client render to both the main surface and the subsurface.

ReactiveUI - Confused about Routing

I'm in the process of comparing MvvmCross with ReactiveUI for a major pharma project on Win Store, WP8, iOS, Droid. We've already selected Xamarin.
I'm totally new to ReactiveUI. I really like what I see in principle, and I think Paul is a genius. However the details are becoming a real bear. I've spend several days tracking down documentation (the manual is from 2011 and seems almost entirely outdated - it doesn't even contain the word "Router") and sample code.
I'm looking at the sample from ReactiveUI.Samples
Also the project MobileSample-RT from the ReactiveUI solution.
I based my little hello world on the ReactiveUI.Samples "Routing" example. Frankly this isn't much of an example as all it does is navigate from AppBootstrapper to the one and only view. I'm trying to do something similar to the "three page" example from MobileSample-RT. The problem is, if I try something like this in my project:
HostScreen.Router.Navigate.Execute(RxApp.DependencyResolver.GetService(typeof(LoginViewModel)));
It crashes (pdb symbols not loaded in ReactiveUI.dll)
If I try this:
HostScreen.Router.NavigateCommandFor<LoginViewModel>().Execute(HostScreen);
Same result - hard crash. That really threw me as it seems like something that should "just work".
I can call this:
HostScreen.Router.Navigate.Execute(new LoginViewModel(HostScreen));
And it does go to my view, as expected. I also wired up a back button in the main screen:
this.OneWayBind(AppBootstrapper, x => x.Router.NavigateBack, x => x.BackButton.Command);
And that indeed moves back from the view to which I'd just navigated.
So now I want to move forward again. I click on the button that does this (again):
HostScreen.Router.Navigate.Execute(new LoginViewModel(HostScreen));
And I go back to that view. However this time it takes 2 clicks on the back button to get actually move back. If I then move forward again, it takes 3 clicks the next time. The NavigationStack is filling up with new instances of LoginViewModel.
So, what IS the correct way to do routing/navigation? Why are those commands crashing? Rather than calling "new" each time in the Navigate.Execute, how do I navigate to a viewmodel that is already in the navigation stack (or should it be there in the first place?).
Many thanks for any clarity you can provide.
If you're building for iOS and Android, you simply don't want to use Routing - the notion of routing conflicts too much with what the platforms want you to do (even on WP8 it's a stretch but I was able to hacky make it work). You should stick with View-first location.
However, if you're using Xamarin Forms, ReactiveUI works great with VM-based routing (since Xamarin managed to do all the hacks to make it possible!). Check out https://github.com/paulcbetts/xamarinevolve2014 for a demo of it
I know the docs suck and I'm working on new ones:
https://github.com/reactiveui/ReactiveUI/pull/391 - Pull Request / Progress
https://github.com/reactiveui/ReactiveUI/tree/docs/docs/basics - Browsable version

Silverlight Navigation using Mvvm-light(oobe)+MEF?

What is the best approach for navigating between UserControls/Pages(out of browser experience)? I'm fairly new to Silverlight and even newer to the mvvm pattern.
How well does the Navigation Framework Integrate with the MVVM Light Toolkit? A snippet for general application flow control with the two would be great.
The plan was to use the Navigation Framework for general flow or using Jeremy Likeness's approach to region management(http://csharperimage.jeremylikness.com/search/label/regions) and swapping out regions as needed. I've seen a few places mention replacing the Visual Root, but that sounded like a hack to me.
Any advice, snippets, or a nudge in the general direction would be greatly appreciated.
Thank you.
You may find the following post useful:
SL4 Navigation Template with MVVM Light
I had the same problem and found this link (applies to Silverlight too):
Windows Phone 7 — Navigation between pages using MVVM Light Messaging
I'm struggling with the same thing, However, I am kinda steered away from the "NavigationService" because allegedly the journal keeps the object reference in memory or something I read somewhere.
I've been trying to utilize a frame in the main window, and using mvvm light to send navigation messages to the window to change the frame.
Edit: I figured it out.
In the main window (code behind, not viewmodel) I added a Messenger.Default.Register(Of NotificationMessage(Of NavMsg))...
Then in ANY view model I do a Messenger.Default.Send(Of Notificationmessage(Of NavMsg))...
And then I created a NavMsg class which accepts a string uri or an object to navigate to.
Here's some T4 code templates to generate you the code for your view/viewmodel to work with mvvmlight and it demonstrated the closing window message above. http://dl.activeaspsoftware.net/dl.aspx?f=MvvmLightCodeTemplates.zip

Creating GTK Widget Using Expander

I am trying to create GTK Widget like shows in following Images
Is it possible to create it in GTK+ under C,
I tried using GtkExpander but it is not working out ...
Can any one Help....
Stripping the arrow is quite trivial. Just append the following code to you $HOME/.gtkrc-2.0 (or create it if not found):
style "pradeep" {
GtkExpander::expander-size = 0
GtkExpander::expander-spacing = 0
}
widget "*.GtkExpander" style "pradeep"
This is done by customizing the appearance using resource files. You can get the same result programmatically by changing the GtkExpander style properties.
Furthermore, you can connect your own callback to its "activate" signal and switch the background color of the widget whenever is active or not. And a lot more...
Just remember someone loves to have a consistent user interface.
If what you want is to duplicate the look, then there are two very inefficient solutions to the problem:
Write your own GTK theme engine (see Murrine or Clearlooks).
Replace your entire program by a GtkDrawingArea widget and use Cairo to draw exactly the look you want. You'll be on your own then, though, so you'll have to write all your widget placement algorithms, buttons, expanders, menus, and whatnot, from scratch.
GTK isn't really meant for this sort of thing. The whole point of GTK is that you design your user interface with the standard widgets, and they just work with whatever theme, language, or accessibility technologies your users need to use. If you design your own look and there's no way to change it, then someone with color blindness or poor eyesight won't be able to use it. Or the text will get all misaligned if someone uses your application in another language. Or at the very least, maybe someone just likes a black desktop with white lettering, and your application will stick out and look really ugly on that user's computer. If you really need to make it look exactly that way, then probably GTK isn't the right tool for you.