PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Multiple forms (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Multiple forms
#1169
coubilias (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Multiple forms 1 Month, 2 Weeks ago Karma: 0  
I am new to this forum and to gtk all together. I have a series of questions but let me concentrate on my current problem. I have created a basic application with the use of glade and the necessary php code. There is database connection routine, a login scenario and the main window with a menu. Now what I am curious to find out is how do you create multiple forms ( like when you select a menu item eg new customer the necessary form comes up – in the main window and how this is replaced when you select lets say edit by another form within the main window)?

I plain php for web application you simple call other php page. Is that the case and if is that how do you call them? Of there is an other way to it?

I hope that my question makes sense to you :)
 
  The administrator has disabled public write access.
#1170
coubilias (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Multiple forms 1 Month, 2 Weeks ago Karma: 0  
As soon as wrote the above I realised that a require() might solve the problem. So, I tried that and actually it worked even though I am not able to use the same widget name or function names (Is there a way to do that?). But lets say that I use different names for widgets and function ( I wish I would not have to do that) I was unable to hide the initial form created by the first glade – php file.

The code I used to call the second glade – php file was

function on_menuItem_activate(){
require "second.php";
}

I tried to hide probably in a wrong way the first glade-php but got an error.I tried to do that by the following

function on_menuItem_activate(){
$glade-> ->get_widget("mainwindow")->hide();
require "second.php";
}

Any ideas how to hide that ?
 
  The administrator has disabled public write access.
#1184
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:Multiple forms 1 Month, 2 Weeks ago Karma: 8  
Hi,

I've written a number of sample codes that illustrate running multiple applications in multiple windows.

Try to do a search on google:
multiple window site:kksou.com

You should be able to find them.

I would suggest you try to understand those codes first. Once you know how to do it using plain PHP-GTK, then you will find it much clearer and easier moving to PHP-GTK + Glade.

Regards,
/kksou
 
  The administrator has disabled public write access.
#1197
coubilias (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Multiple forms 1 Month, 2 Weeks ago Karma: 0  
Initialy I tried to do it the way you discribed in the example codes in conjuction with glade and had no luck,that is the reason I tried to to use the "require()" function as you would do it when programming for the web.

As soon as I realised that the problem with glade is passing additional parameters with in name of the window to be destroyed or hided, within the function that calls the second window, it was easy to open the new window and close the initial.

As you stated in your examples using "connect()" was the way to pass the additional parameter that was required.

To avoid the "connect()" and use a more "gladish method" was simple enough by seting the glade variable which holds the "new GladeXML" statment as global.
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved