I'd like to have a class respond to the morphic "step" message - but the class doesn't need to be displayed (directly)... so it's not a Morph
is there a way to use this message outside of morphic, or is there a morph without a displayed UI?
with thanks
Chris
World doOneCycle may help.
The UI process repeatedly calls World doOneCycle. You can do that too. Just ensure your do that in the main thread.
Related
Below are two questions on the same component:
Which signal is triggered when the mouse passes over a Gio.MenuItem?
How to implement a tooltip for Gio.MenuItem?
Gio.MenuItem is a direct descendent from GObject.GObject (See https://lazka.github.io/pgi-docs/Gio-2.0/classes/MenuItem.html). It does not have any signals itself, and only receives a notify signal via its descent from GObject.
As Gio.MenuItem is not a widget, it does not receive any signals from the GUI. It only represents data (opaque data at that).
I suspect you want Gtk.MenuItem, which is the visual component.
EDIT It seems the widget you are after is Gtk.PopoverMenu. Just to be clear, Gio.MenuItem is not a visible item, which is why I replied as above. Gtk.PopoverMenu is a widget (widget = a visible item).
PopoverMenu is the visible widget, and you can see how it fits together with other widgets. It inherits from Popover, which inherits from Gtk.Bin, Gtk.Container and finally from Gtk.Widget.
So, you have all the signals from those widgets, but those are for the 'complete' Gtk.PopoverMenu, not for the individual items.
According to this definition, the individual items are Gtk.ModelButtons, so you might be able to access them that way.
The solution to get this was much further than I thought. I always suspected that the Devhelp's menu could not be built using GtkPopoverMenu because my OS uses gtk 3.14. The solution involves a totally new concept of running an application, proposed by Gtk.Application interface and the Gtk.Action features. These "new" concepts can be studied in the following places.
http://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html?highlight=Gtk.Application
https://wiki.gnome.org/HowDoI/GtkApplication
https://github.com/Programmica/python-gtk3-tutorial/blob/master/_examples/application.py
Apparently tooltip features are not available for this menu type.
I have a simple question.
In my UWP app I am using multiple threads and while on a background thread when i try to create a simple BitmapImage by using code: var image=new BitmapImage();. It throws an exception
The application called an interface that was marshalled for a different thread.
this exception occurs on the very line where I try to create the image. I simply want to create this image, deal with its properties and then store it in my datalist.
Note: datalist is a simple public static property which is accesible throughout the app. thankyou
I can't see the full context from the question, so I am not sure why this exception is bubbling up, but one sure way to fix it is using CoreDispatcher.RunAsync().
The documentation says:
If you are on a worker thread and want to schedule work on the UI thread, use CoreDispatcher::RunAsync.
If you are using MVVMLight, you can also make use of it's DispatcherHelper class' CheckBeginInvokeOnUI method. It's a bit better, since it first checks which thread it is called on and if it's the UI thread, it executes the action immediately and passes it to the UI thread only if needed.
I have a simple tkinter.messagebox.showinfo inside a python code, how can I close the messagebox inside the python code as the code runs?
Thx.
This is not possible as far as I know because the tkinter.messagebox.showinfo waits for user input, which is to click the button. This is what showinfo is supposed to do.
If you want to display something to the user and make it disappear after a while (say a loading... sign) I would suggest using a progrssbar instead of a messagebox.
In any case, you will need another thread to control the functionality of your current thread.
This post may give you more info about using threads this way.
Also note that it's recommended that secondary threads are not given access to tkinter objects.
Are there any Monotouch multitasking sample I can download?
I'm having problems in finding out best practice using multitasking with Monotouch. How I should handle when user presses home button, my application goes to the background, reopens my program and I must show where he left off (how to show the correct form/view) ... a sample of that would I love to see.
Thanks!
Morten
You will have to override the methods DidEnterBackground and WillEnterForeground in the AppDelegate class. Inside these methods, you will have to save the current state of the app on your own (eg. which controller was active, what data was displayed etc).
The implementation of DidEnterBackground should be lightweight. In case you need more time for your app before it gets suspended, check how you could do it in this blog post.
you don't need to do anything.
that should be default behaviour on iPhones that supports Multitasking.
if not so check in you Info.plist for "UIApplicationExitsOnSuspend" or "Application does no run in background" it should be NO.
Is there any way of showing Wait Screen, while some processing is done in backend, using LWUIT in J2ME ? if yes then how if no then is there any alternate ?
You can look at progress bar with LWUIT. Sample Wait screen used in the makeover demo and the browser demo application in current LWUIT Repository. Also see here.
I had this issue as well, but got a workaround: these suggestions here seemed not to be the best for me. The dialog when it displays will block any other action except it is discarded, even if it was created with no commands.
What I did was to add a wait screen to the BorderLayout.CENTER of the main container or the Form, then when the thread running my background task finishes, the component is now replaced with the loaded component.
I dont know if anyone would find this useful since this has already been answered. I just felt like posting my own trick.
You can start a thread in which you do your stuff of getting data and all and in the UI thread show the loading dialog and then dispose that loading dialog once you are done with your services call.