w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Set Tree Store model in glade by code - GTK Glade TreeStore C++
Your code has many construction sides. I will work down a list of those issues that attracted my particular attention. Don't call it c++ if you stick with gtk+ and use plain c instead You tagged your question with c++. However you don't use gtkmm but rather gtk+. Therefore you shouldn't intersperse c++ features that are not compatible with standard c. Related to your code you shouldn't specify default function arguments. That feature is not part of the c programming language and will confuse fellow programmers who work on your code. Declare variables where you need them and keep your function prototypes clean Don't unnecessarily pass variables to functions that actually belongs only to the logical scope of the function itself. For example the function int launchGUI(GtkBuilder *build

Categories : C++

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

When opening a 'child window' from the main site do i have to create an HTML page for each child window or is there a way to make it generate its own?
Using "popup" windows can be troublesome.. some browsers will not open them properly due to their internal "popup blockers" but to answer your question. if you set the URL of the window to the image itself it should load in the window without the need for a page. i.e. http://www.example.com/img/myimage.jpg A better way to do this would be using a javascript library such as jQuery and jQuery-UI to open modal overlays.

Categories : Javascript

Python + Glade + PyGObject. How can I get the value of two text fields at once?
You need to have a reference to both objects in a class using GtkBuilder's get_object(). Then, in the callback of the button just get both text with self.myfield1.get_text() or so. Check this template on how to structure a PyGObject application: How can a program that uses GUI be constructed? Hope it helps. EDIT: About the naming scheme, I would use whatever naming scheme is used on the language that would use the Glade file. When programming in PyGObject, I name the objects on the Glade file the same as Python variables so I can do this: [...] go = self.builder.get_object self.window = go('window') self.my_foobar = go('my_foobar') [...]

Categories : Python

Windows: Notification when child dies (crash or exits normally)
Actually there is a way to interrupt WaitForMultipleObjects(). Create a designated manual-reset event object using CreateEvent(). Include the event handle to WaitForMultipleObjects() along with your existing child process handles. Signal the event with SetEvent() each time a new child process is created. This way, WaitForMultipleObjects() exits whenever a child process exits (for whatever reason) or the event is signaled, then you can update the list of handles as needed, reset the event with ResetEvent(), and call WaitForMultipleObjects() again.

Categories : Windows

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

After while exits, it takes a long time to continue
In fact, there is exactly a 20-second delay after click(img2). This is because you told it to spend up to 20 seconds looking for img1, which no longer exists. You may want to read the documentation for the functions you're calling (here is exists, where you can read about the timeout parameter). You're also doing some very strange things, like checking if img1 exists twice in a row (once in the while and then in the if), and you say that you tried adding sleep and wait statements to make the code wait less. (??) You may want to get someone to help you out.

Categories : Python

In Tkinter How do I make a child window that closes the parent but shows all the widgets in the child?
The basic idea is to start with a containing frame, and then "stack" all of your screens on top of each other. Then, to show a specific screen you simply raise it to the top of the stacking order. Here's an example: import Tkinter as tk class Screen(tk.Frame): '''This defines one "screen"''' def __init__(self, parent, label): tk.Frame.__init__(self, parent) l = tk.Label(self, text=label) self.entry = tk.Entry(self) l.pack(side="top", fill="x") self.entry.pack(side="top", fill="x", padx=20) self.entry.insert(0, "this is the entry for " + label) class Example(tk.Frame): '''This is the main application''' def __init__(self, *args, **kwargs): tk.Frame.__init__(self, *args, **kwargs) # an array of screens, a

Categories : Python

pyGTK how to redisplay a top level window (with child widgets) after window destroy signal is sent
Have you tried making another copy of the window class and showing that one instead? Note: This will reset anything that was set in the window. i.e. if a person did something to make label1 say 'Hi!' instead of 'Hello!', it is going to be reset again to 'Hello!', since you are recreating the window.

Categories : Misc

Closing a process child window (e.g. a Word window) accessing a specific file
I found this very detail post about the subject, maybe it can help you http://forum.sysinternals.com/howto-enumerate-handles_topic18892.html That post hase some disucussions and related questions here http://forum.sysinternals.com/topic19403.html

Categories : C#

Javascript Window.Open how to obtain the opened child window from a different page
First its seen little bit tricky.. you declare some ajax function to send information to server whether child window opened or not.. if child window opened then refresh page. for E.g . -> assume that user opened 2 same page In different tabs1 and tab2. -> user opened opened popup window on tab2 and add/change some information.. -> tab2 content refresh as per ur event. you should also send a one flag to server with session id and tab1 continuous check is that any changes happed to server it will be refresh..

Categories : Javascript

How can I show alert in parent window from child popup window in javascript?
try this code <!DOCTYPE html> <html> <head> <script> function openWin() { myWindow=window.open('','','width=200,height=100'); myWindow.document.write("<p>This is 'myWindow'</p>"); refreshParent(); } function refreshParent() { window.parent.focus(); window.parent.alert("message"); window.parent.location.reload(); } </script> </head> <body> <input type="button" value="Open 'myWindow'" onclick="openWin()" /> </body> </html>

Categories : Javascript

Opening a child dialog window from a main window with Pyside
If your MainWindow have a Menu action named actionAbout, and a slot called openAbout, all you need to do is connect the triggered signal from the actionAbout to the slot openAbout. self.actionAbout.triggered.connect(self.openAbout) The process is similar to what have you done with the pushbutton. Just change the names used in this example with the ones in your application.

Categories : Python

How to execute main window key binding when child window is focussed in wpf?
WPF Behavior: Global Application Shortcut Keys Seems to be what you're looking for. I made a couple small modifications to the author's code to get your required functionality(rather than passing in an InputBindings collection, made the Behavior pick it from the AssociatedObject directly. Also took out the restriction for requiring modifier keys, Although I suggest you do read through the author's notes in the article and incorporate it to your requirements) Sample download for your requirements ^^ I could get your required behavior, however do go through the Behavior<T> to see if you can optimise it better for yourself(only bit's I actually looked into was just stuff relating to your specific requirement.)

Categories : C#

Accessing parent window angular scope from child window
I had a similar need and had the same problem accessing the scope using angular.element. I was was able to solve it as follows though: In your main/parent controller do something like this: $scope.food = 'Mac & Cheese'; window.$windowScope = $scope; $window.open('views/anotherWindow.html', '_blank','menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,personalbar=yes'); Then in the child window controller you can access $windowScope like this: $scope.parentWindow = window.opener.$windowScope; console.log($scope.parentWindow.food); An alternative to putting data directly into the scope would be to use $window scope to broadcast and/or emit events, which is the preferred way of cross-controller communication in angular.

Categories : Javascript

Disable parent window when child popup window is open
Play around with this code in the pop-up: $(window).on("blur", function(){ ... }); This will fire every time the user leaves the window. Inside the argument function you should be able to make the window regain its focus, maybe using $(this).focus() or self.focus(). I haven't tested this myself. Good luck!

Categories : Javascript

Unity WPF window lifetime manager
Nevermind, it's my own fault. This is the problem: public override object GetValue() { object result = null; _uiContext.Send(InternalGetValue, result); return result; } of course the object value set in InternalGetValue is not the same object as that passed in because it's been marshalled to a different thread. Not quite sure how I'll solve this but at least I see the problem now. Edit - in the end I used a static class variable with a semaphore to control access. seems to work perfectly.

Categories : C#

Going back from child window to parent window in Visual C++
First of all if you want to do some navigation kind of things then, Your code of going parent to child is also not work properly. Now what I suggest you is that for going from parent to child create one global variable. Like , Form2^ pp ; initialise it in constructor or create method of parent class Like, //Create method or constructor, pp = gcnew Form2(); And do your navigation Like, private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { this->Hide(); pp->ShowDialog(); } In this case no matter how many time you click on button3 only one instance of child class will show and hide. No your problem is that you want go back to parent window form from child window. You may achieve this using this.Parent as Form Like, priva

Categories : Dotnet

SetFocus to parent window, then back to child window
Big thanks to Hans Passant for solving this! The crash issue was due to my window handle being unreliable. I stopped storing the window handle in a variable, and instead I got it on the spot using GetParent(). I also didn't need to set focus to the current window, all I needed to do was replace my SendMessage with a PostMessage. So the new code: case WM_KEYDOWN: ...code to handle modifiers like shift, ctrl, etc... else { PostMessage(GetParent(win32Frame->getPlatformWindow ()), message, wParam, lParam); }

Categories : C++

Redraw in parent window in child window's onPaint in mfc
One way is to just pass data to the parent window and call its Invalidate function. Then it would paint the grid lines in its own OnPaint. Or you could paint directly on the parent window from the child, but use the parent's GetDC function instead of using the child's DC.

Categories : C++

Accessing the Parent Window's Content from the child window
The root of your problem is same origin policy that won't let you observe load events for external domains. If you try this in developer console while browsing SO, everything's fine: var child = window.open( 'http://stackoverflow.com' ); child.onload = function() { alert( 'Popup loaded!' ); // Fired! }; However if you try to open a page from other domain, it fails: var child = window.open( 'http://stackexchange.com' ); child.onload = function() { // It's not gonna be fired unless you run it from stackexchange.com. alert( 'Popup loaded!' ); }; The same thing happens when you call window.open() or window.open( '' ) as it tries to load about:blank page which is out of your domain's scope and that's why your browser won't fire attached events (same for child.addEventListene

Categories : Javascript

Call JavaScript of parent window from child window
What you're looking for is a reference to the window that opened the popup window. Once you have that, you can call functions in that window, read and write variables in that window, or even manipulate its DOM. That reference is called opener. It gives you the window object for the window that opened the current window. For example, if you have a function in the original window like this: function updateMe( data ) { alert( data ); } then in the popup window you could call it like this: opener.updateMe( 'Hello!' ); Naturally, you need to make sure that updateMe() is a global function in the original page. Or if you have some object in the original page and updateMe() is a method of that object, you can still do it, as long as the object is global. e.g. in the host page: var myOb

Categories : Javascript

How to get child window url from parent window using javascript
You can't detect the event precisely, but you can do a workaround and check the URL all X milliseconds. var self = this var detectsUrl = setInterval(function(){ var a = winRef.document.createElement('a'); a.href = winRef.document.URL; if (a.hostname == "www.myURL.com") { winRef.close(); clearInterval(detectsUrl); self.callback(); }; }, 1000); // Here we check every seconds

Categories : Javascript

Progress indicator during pandas operations (python)
You can easily do this with a decorator from functools import wraps def logging_decorator(func): @wraps def wrapper(*args, **kwargs): wrapper.count += 1 print "The function I modify has been called {0} times(s).".format( wrapper.count) func(*args, **kwargs) wrapper.count = 0 return wrapper modified_function = logging_decorator(feature_rollup) then just use the modified_function (and change when you want it to print)

Categories : Python

How to call method in applet from JarClassLoader and Applet Launcher which returns string data
You will need to use the three-argument for of Class.forName to specify which class loader you are using. (The single-argument form uses the class loader of the immediate calling class, which is a bit naughty.) Note, loading remote code in Java is tricky to do securely.

Categories : Java

How do I bring parent window in front of child modeless dialog when parent window clicked
Take out this line: Owner = Application.Current.MainWindow and you should get the behavior you want. By specifying the owner window you are keeping the child window always in front.

Categories : Wpf

Losing the elemets/objects identity of same objects in parent window when renavigating from child window
When u navigate from the parent window a stale element reference exception is thrown each time you interact with the previously found web elements. In this case, although the replacement elements may look identical they are different; the driver has no way to determine that the replacements are actually the same or what's expected. If the element has been replaced with an identical one, a useful strategy is to look up the element again. To learn more, read this.

Categories : Selenium

Python QT QNetworkRequest exits with "(process:3265): GLib-ERROR **: Creating pipes for GWakeup: Too many open files"
Is your condition self.image_reply.error() == Qt.QNetworkReply.NoError always true? If it ts false, deleteLater will not be called. Try to set 'Connection: close' header: image_request.setRawHeader("Connection", "close"); Also try to call self.image_reply.close() manually.

Categories : Python

How do I register components at run time with unity DI
First of all you need to register Unity configuration section. That looks like this: <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration, Version=2.1.505.0, Culture=neutral, PublickKeyToken=31bf3856ad364e35" /> This is Unity 2 configuration. Next is to add unity section. <unity xmlns="http://schemas.microsoft.com/practices/2010/unity"> <!-- General aliases --> <alias alias="string" type="System.String, mscorlib" /> <alias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <!-- Interface aliases --> <alias

Categories : C#

Create a little python applet in a linux task bar
Status icon is most generic solution, but legacy. Appindicator was designed for ubuntu to easy keep icon and menu in taskbar. There is examples in several languages http://developer.ubuntu.com/resources/technologies/application-indicators/ What is your Desktop Shell? Each shell has a better way to keep applet on taskbar. Some of these solutions has compatibility with other shells (appindicator has support in KDE, Gnome2, Gnome Shell and maybe others).

Categories : Python

Python Child/Parent classes, Child Class Returning String Twice?
I have put your example in a file called test.py: class Character(): """ This is the main parents class for creation of characters, be they player, NPC or monsters they shall all share common traits """ def __init__(self, name, health, defense): """Constructor for Character""" self.name = name self.health = health self.defense = defense class Player(Character): """ The player class is where heros are made They inherit common traits from the Character class """ def __init__(self, name, health, defense, str, int): Character.__init__(self, name, health, defense) self.str = str self.int = int hero = Player("Billy", 200, 10, 10, 2) print hero.name and executed the following (python 2.7 o

Categories : Python

Glade 'Parentless' Widget
Yes, if you right-click on a widget in the widget palette, there is a menu item called something like "Add as toplevel widget" -- I don't have a copy of Glade handy right now to test what the name was exactly. Then when you load your GtkBuilder file, the widget will be created without a parent, but the GtkBuilder will hold a reference to it.

Categories : Ruby

Using Java.applet.Applet in Eclipse
In your project in Eclipse, check if you have JRE System Library, like this If not, Go to Window - Preferences - Java - Installed JREs page to specify the path of your JRE or JDK.

Categories : Java

Glade file opens but no details
It looks like your ui xml is stored in old libglade format. Since libglade is deprecated, you can try to convert this xml to GtkBuilder format: gtk-builder-convert foo.glade foo.ui Note, that gtk-builder-convert is in libgtk2.0-dev package on Debian. Also note, that you will have to update ui creation code to GtkBuilder too, here goes the skeleton: import pygtk pygtk.require("2.0") import gtk class Skeleton(object): def __init__(self): builder = gtk.Builder() builder.add_from_file("foo.ui") builder.connect_signals({ "on_window_destroy" : gtk.main_quit }) self.window = builder.get_object("mainwindow") self.window.show() if __name__ == "__main__": Skeleton() gtk.main() You may also try to change root xml element from glade-

Categories : Python

PyGTK/Glade - Scrollbars don't appear in ScrolledWindow
The simple fix was: TreeView: set Fixed Height Mode to No TreeViewColumn: set Sizing to Automatic or Grow Only With single-column views, the column resizes to fit its contents and scrollbars appear if the contents don't fit. With multiple-column views, the columns will get an initial width and the scrollbars will appear if they don't fit. It's less than obvious that "fixed height mode" for a treeview would mean "fixed width mode" for its columns, but that seems to be the case. Alternately, the columns could be given fixed widths that exceed the width of the ScrolledWindow, but this was about showing scrollbars as-needed.

Categories : Python

Gtk skip_taskbar_hint (seen in Glade-ui-Designer) äquivalent in Qt
It seems that Qt::SplashScreen does the same effect. You can add this flag to your widget using the following code: setWindowFlags(windowFlags() & Qt::SplashScreen); Source

Categories : Qt

glade and pygtk (probably a charset prob?)
 is a backspace character, AFAIR; you should escape the backslash: >>> print "C:lubb.glade" Clubb.glade >>> print "C:\blubb.glade" C:lubb.glade

Categories : Python

GTK pass user data to callback using Glade
In my opinion with respect to glade and callbacks one have to say goodbye to the notion of passing just one single element to callbacks. And thus stop using glade in order to configure the user data that is passed to a specific callback. I get used to pass a struct named App to all callbacks that contains a pointer to every ui element that is loaded from the ui definitions file and already instantiated by GtkBuilder. This also stops the tedious task in glade of clicking back and forth between widgets only to set up the user data of the callbacks. In addition to the ui elements, most of the time this struct contains further elements that are important at runtime on application level. A benefit of this approach is that you are not tempted to think about how to implement an individual call

Categories : C

How to install Gtk.glade module or libglade in python3
GTK objects don't have a glade property. Given a Gtk.Builder object gu, you should be calling something like gu.add_from_file("1111.glade"). Also, don't import pygtk when working with GTK 3. PyGTK only supports GTK 2; GTK 3 is automatically handled by Python bindings for gobject-introspection, which you get when importing gi.repository.

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.